Skip to content

Commit c4fe009

Browse files
committed
SeriesImportService: rename add() to addRequest().
Prerequisite for #700 No functional changes.
1 parent 77dbdb2 commit c4fe009

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

src/main/java/ru/mystamps/web/controller/SeriesImportController.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public String processRequestImportForm(
8080
return null;
8181
}
8282

83-
Integer requestId = seriesImportService.add(form, currentUserId);
83+
Integer requestId = seriesImportService.addRequest(form, currentUserId);
8484

8585
ImportRequestCreated requestCreated =
8686
new ImportRequestCreated(this, requestId, form.getUrl());

src/main/java/ru/mystamps/web/service/SeriesImportService.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import ru.mystamps.web.service.dto.RequestImportDto;
2424

2525
public interface SeriesImportService {
26-
Integer add(RequestImportDto dto, Integer userId);
26+
Integer addRequest(RequestImportDto dto, Integer userId);
2727
void changeStatus(Integer requestId, String oldStatus, String newStatus);
2828
ImportRequestDto findById(Integer requestId);
2929
void saveDownloadedContent(Integer requestId, String content);

src/main/java/ru/mystamps/web/service/SeriesImportServiceImpl.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public class SeriesImportServiceImpl implements SeriesImportService {
5959
@Transactional
6060
@PreAuthorize(HasAuthority.IMPORT_SERIES)
6161
@SuppressWarnings({ "PMD.NPathComplexity", "PMD.ModifiedCyclomaticComplexity" })
62-
public Integer add(RequestImportDto dto, Integer userId) {
62+
public Integer addRequest(RequestImportDto dto, Integer userId) {
6363
Validate.isTrue(dto != null, "DTO must be non null");
6464
Validate.isTrue(userId != null, "Current user id must be non null");
6565

src/test/groovy/ru/mystamps/web/service/SeriesImportServiceImplTest.groovy

+7-7
Original file line numberDiff line numberDiff line change
@@ -49,33 +49,33 @@ class SeriesImportServiceImplTest extends Specification {
4949
}
5050

5151
//
52-
// Tests for add()
52+
// Tests for addRequest()
5353
//
5454

55-
def 'add() should throw exception if dto is null'() {
55+
def 'addRequest() should throw exception if dto is null'() {
5656
when:
57-
service.add(null, Random.userId())
57+
service.addRequest(null, Random.userId())
5858
then:
5959
thrown IllegalArgumentException
6060
}
6161

62-
def 'add() should throw exception if user id is null'() {
62+
def 'addRequest() should throw exception if user id is null'() {
6363
when:
64-
service.add(form, null)
64+
service.addRequest(form, null)
6565
then:
6666
thrown IllegalArgumentException
6767
}
6868

6969
@SuppressWarnings(['ClosureAsLastMethodParameter', 'UnnecessaryReturnKeyword'])
70-
def 'add() should pass dto to dao and return its result'() {
70+
def 'addRequest() should pass dto to dao and return its result'() {
7171
given:
7272
String expectedUrl = Random.url()
7373
form.setUrl(expectedUrl)
7474
and:
7575
Integer expectedUserId = Random.userId()
7676
Integer expectedResult = Random.id()
7777
when:
78-
Integer result = service.add(form, expectedUserId)
78+
Integer result = service.addRequest(form, expectedUserId)
7979
then:
8080
1 * seriesImportDao.add({ ImportSeriesDbDto request ->
8181
assert request.url == expectedUrl

0 commit comments

Comments
 (0)