Skip to content

Commit fad9082

Browse files
committed
refactor: use getters explicitly.
This change is needed in order to simplify automated porting of tests. Part of 1246
1 parent 3b3bd49 commit fad9082

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/test/groovy/ru/mystamps/web/feature/account/LegacyUserServiceImplTest.groovy

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,19 @@ class LegacyUserServiceImplTest extends Specification {
3636
private UserService service
3737
private ActivateAccountForm activationForm
3838

39+
@SuppressWarnings('UnnecessaryGetter')
3940
def setup() {
4041
AddUserDbDto user = TestObjects.createAddUserDbDto()
4142

42-
encoder.encode(_ as String) >> user.hash
43+
encoder.encode(_ as String) >> user.getHash()
4344

4445
UsersActivationDto activation = TestObjects.createUsersActivationDto()
4546
usersActivationService.findByActivationKey(_ as String) >> activation
4647

4748
activationForm = new ActivateAccountForm()
48-
activationForm.setLogin(user.login)
49+
activationForm.setLogin(user.getLogin())
4950
activationForm.setPassword(TestObjects.TEST_PASSWORD)
50-
activationForm.setName(user.name)
51+
activationForm.setName(user.getName())
5152
activationForm.setActivationKey(TestObjects.TEST_ACTIVATION_KEY)
5253

5354
service = new UserServiceImpl(

src/test/groovy/ru/mystamps/web/feature/image/LegacyImageServiceImplTest.groovy

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,11 @@ class LegacyImageServiceImplTest extends Specification {
4040
imageDao
4141
)
4242

43+
@SuppressWarnings('UnnecessaryGetter')
4344
def setup() {
44-
multipartFile.size >> 1024L
45-
multipartFile.contentType >> 'image/png'
46-
multipartFile.originalFilename >> 'super-image.png'
45+
multipartFile.getSize() >> 1024L
46+
multipartFile.getContentType() >> 'image/png'
47+
multipartFile.getOriginalFilename() >> 'super-image.png'
4748
imageDao.add(_ as String, _ as String) >> 17
4849
}
4950

0 commit comments

Comments
 (0)