Skip to content

Commit 0a97484

Browse files
committed
test(CountryServiceImpl.findIdsByNames): add unit test for conversion to lower case.
Fix #826 No functional changes.
1 parent 31c7219 commit 0a97484

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/main/java/ru/mystamps/web/feature/country/CountryServiceImpl.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ public String add(AddCountryDto dto, Integer userId) {
7474
return slug;
7575
}
7676

77-
// @todo #819 CountryServiceImpl.findIdsByNames(): add unit test for converting to lower case
7877
@Override
7978
@Transactional(readOnly = true)
8079
public List<Integer> findIdsByNames(List<String> names) {

src/test/groovy/ru/mystamps/web/feature/country/CountryServiceImplTest.groovy

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,16 @@ class CountryServiceImplTest extends Specification {
170170
result == expectedResult
171171
}
172172

173+
def 'findIdsByNames() should pass names to dao in lower case'() {
174+
given:
175+
List<String> names = [ 'Foo', 'BAR' ]
176+
List<String> expectedNames = [ 'foo', 'bar' ]
177+
when:
178+
service.findIdsByNames(names)
179+
then:
180+
1 * countryDao.findIdsByNames(expectedNames) >> Random.listOfIntegers()
181+
}
182+
173183
//
174184
// Tests for findIdsWhenNameStartsWith()
175185
//

0 commit comments

Comments
 (0)