Skip to content

Commit cab975b

Browse files
committed
refactor: propagate assertThat().isNotNull()
This change is needed in order to simplify automated porting of tests. Part of 1246
1 parent d93b668 commit cab975b

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/test/groovy/ru/mystamps/web/feature/site/LegacyCronServiceImplTest.groovy

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
*/
1818
package ru.mystamps.web.feature.site
1919

20+
import org.assertj.core.api.WithAssertions
2021
import org.slf4j.helpers.NOPLogger
2122
import ru.mystamps.web.feature.account.UserService
2223
import ru.mystamps.web.feature.account.UsersActivationFullDto
@@ -30,7 +31,7 @@ import ru.mystamps.web.service.TestObjects
3031
import spock.lang.Specification
3132

3233
@SuppressWarnings(['ClassJavadoc', 'MethodName', 'NoDef', 'NoTabCharacter', 'TrailingWhitespace'])
33-
class LegacyCronServiceImplTest extends Specification {
34+
class LegacyCronServiceImplTest extends Specification implements WithAssertions {
3435

3536
private final CategoryService categoryService = Mock()
3637
private final CountryService countryService = Mock()
@@ -66,14 +67,14 @@ class LegacyCronServiceImplTest extends Specification {
6667
assert first[Calendar.DAY_OF_MONTH] == second[Calendar.DAY_OF_MONTH]
6768
}
6869

69-
private static void assertMidnightOfYesterday(Date date) {
70-
assert date != null
70+
private void assertMidnightOfYesterday(Date date) {
71+
assertThat(date).isNotNull()
7172
assertDatesEqual(date, new Date().previous())
7273
assertMidnight(date)
7374
}
7475

75-
private static void assertMidnightOfToday(Date date) {
76-
assert date != null
76+
private void assertMidnightOfToday(Date date) {
77+
assertThat(date).isNotNull()
7778
assertDatesEqual(date, new Date())
7879
assertMidnight(date)
7980
}

0 commit comments

Comments
 (0)