Polishing
1. fix deprecations 2. fix generics 3. use lambda instead of anonymous class 4. mark some fields as final
This commit is contained in:
committed by
Marcus Hert Da Coregio
parent
831d65a97c
commit
11ce4b4561
@@ -49,7 +49,7 @@ class RedisSessionExpirationPolicyTests {
|
||||
// Wed Apr 15 10:27:32 CDT 2015
|
||||
private static final Long ONE_MINUTE_AGO = 1429111652346L;
|
||||
|
||||
@Mock(lenient = true)
|
||||
@Mock(strictness = Mock.Strictness.LENIENT)
|
||||
RedisOperations<String, Object> sessionRedisOperations;
|
||||
|
||||
@Mock
|
||||
|
||||
@@ -59,7 +59,7 @@ class RedisSessionRepositoryTests {
|
||||
|
||||
private static final String TEST_SESSION_KEY = getSessionKey(TEST_SESSION_ID);
|
||||
|
||||
@Mock(lenient = true)
|
||||
@Mock(strictness = Mock.Strictness.LENIENT)
|
||||
private RedisOperations<String, Object> sessionRedisOperations;
|
||||
|
||||
@Mock
|
||||
@@ -311,7 +311,6 @@ class RedisSessionRepositoryTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
void findById_SessionExists_ShouldReturnSession() {
|
||||
Instant now = Instant.now().truncatedTo(ChronoUnit.MILLIS);
|
||||
given(this.sessionHashOperations.entries(eq(TEST_SESSION_KEY)))
|
||||
@@ -334,7 +333,6 @@ class RedisSessionRepositoryTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
void findById_SessionExistsAndIsExpired_ShouldReturnNull() {
|
||||
given(this.sessionHashOperations.entries(eq(TEST_SESSION_KEY)))
|
||||
.willReturn(mapOf(RedisSessionMapper.CREATION_TIME_KEY, Instant.EPOCH.toEpochMilli(),
|
||||
@@ -410,7 +408,7 @@ class RedisSessionRepositoryTests {
|
||||
.plusSeconds(session.getMaxInactiveInterval().getSeconds());
|
||||
}
|
||||
|
||||
private static Map mapOf(Object... objects) {
|
||||
private static Map<String, Object> mapOf(Object... objects) {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
if (objects != null) {
|
||||
for (int i = 0; i < objects.length; i += 2) {
|
||||
|
||||
@@ -37,7 +37,7 @@ import static org.mockito.Mockito.verifyNoMoreInteractions;
|
||||
@ExtendWith(MockitoExtension.class)
|
||||
class RedisIndexedHttpSessionConfigurationMockTests {
|
||||
|
||||
@Mock(lenient = true)
|
||||
@Mock(strictness = Mock.Strictness.LENIENT)
|
||||
RedisConnectionFactory factory;
|
||||
|
||||
@Mock
|
||||
|
||||
Reference in New Issue
Block a user