Skip to content

Commit 4f72784

Browse files
committed
CountryServiceImplTest: modify return values from mock methods.
Should be in ab95ef6 commit. No functional changes.
1 parent 22064d2 commit 4f72784

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class CountryServiceImplTest extends Specification {
8686

8787
def "add() should call dao"() {
8888
given:
89-
Integer expectedId = 7
89+
Integer expectedId = 10
9090
and:
9191
form.setName('Example Country')
9292
and:
@@ -111,7 +111,7 @@ class CountryServiceImplTest extends Specification {
111111
1 * jdbcCountryDao.add({ AddCountryDbDto country ->
112112
assert country?.name == expectedCountryName
113113
return true
114-
}) >> 10
114+
}) >> 20
115115
}
116116

117117
def "add() should pass country name on Russian to dao"() {
@@ -124,7 +124,7 @@ class CountryServiceImplTest extends Specification {
124124
1 * jdbcCountryDao.add({ AddCountryDbDto country ->
125125
assert country?.nameRu == expectedCountryName
126126
return true
127-
}) >> 20
127+
}) >> 30
128128
}
129129

130130
def "add() should throw exception when name can't be converted to slug"() {
@@ -149,7 +149,7 @@ class CountryServiceImplTest extends Specification {
149149
1 * jdbcCountryDao.add({ AddCountryDbDto country ->
150150
assert country?.slug == slug
151151
return true
152-
}) >> 30
152+
}) >> 40
153153
}
154154

155155
def "add() should assign created at to current date"() {
@@ -159,7 +159,7 @@ class CountryServiceImplTest extends Specification {
159159
1 * jdbcCountryDao.add({ AddCountryDbDto country ->
160160
assert DateUtils.roughlyEqual(country?.createdAt, new Date())
161161
return true
162-
}) >> 40
162+
}) >> 50
163163
}
164164

165165
def "add() should assign updated at to current date"() {
@@ -169,7 +169,7 @@ class CountryServiceImplTest extends Specification {
169169
1 * jdbcCountryDao.add({ AddCountryDbDto country ->
170170
assert DateUtils.roughlyEqual(country?.updatedAt, new Date())
171171
return true
172-
}) >> 50
172+
}) >> 60
173173
}
174174

175175
def "add() should assign created by to user"() {
@@ -179,7 +179,7 @@ class CountryServiceImplTest extends Specification {
179179
1 * jdbcCountryDao.add({ AddCountryDbDto country ->
180180
assert country?.createdBy == user.id
181181
return true
182-
}) >> 60
182+
}) >> 70
183183
}
184184

185185
def "add() should assign updated by to user"() {
@@ -189,7 +189,7 @@ class CountryServiceImplTest extends Specification {
189189
1 * jdbcCountryDao.add({ AddCountryDbDto country ->
190190
assert country?.updatedBy == user.id
191191
return true
192-
}) >> 70
192+
}) >> 80
193193
}
194194

195195
//

0 commit comments

Comments
 (0)