Update spring-javaformat to 0.0.39

Closes gh-2528
This commit is contained in:
Marcus Da Coregio
2023-10-19 10:33:00 -03:00
parent db7b19bf88
commit 2b69cff478
101 changed files with 765 additions and 655 deletions

View File

@@ -81,7 +81,7 @@ class ReactiveRedisSessionRepositoryITests extends AbstractRedisITests {
assertThat(session.getId()).isEqualTo(toSave.getId());
assertThat(session.getAttributeNames()).isEqualTo(toSave.getAttributeNames());
assertThat(session.<String>getAttribute(expectedAttributeName))
.isEqualTo(toSave.getAttribute(expectedAttributeName));
.isEqualTo(toSave.getAttribute(expectedAttributeName));
this.repository.deleteById(toSave.getId()).block();
@@ -229,7 +229,7 @@ class ReactiveRedisSessionRepositoryITests extends AbstractRedisITests {
toSave.setLastAccessedTime(Instant.now());
assertThatIllegalStateException().isThrownBy(() -> this.repository.save(toSave).block())
.withMessage("Session was invalidated");
.withMessage("Session was invalidated");
assertThat(this.repository.findById(sessionId).block()).isNull();
assertThat(this.repository.findById(session.getId()).block()).isNotNull();
@@ -240,7 +240,7 @@ class ReactiveRedisSessionRepositoryITests extends AbstractRedisITests {
@SuppressWarnings("unchecked")
void saveChangeSessionIdAfterCheckWhenOriginalKeyDoesNotExistsThenIgnoreError() {
ReactiveRedisOperations<String, Object> sessionRedisOperations = (ReactiveRedisOperations<String, Object>) ReflectionTestUtils
.getField(this.repository, "sessionRedisOperations");
.getField(this.repository, "sessionRedisOperations");
ReactiveRedisOperations<String, Object> spyOperations = spy(sessionRedisOperations);
ReflectionTestUtils.setField(this.repository, "sessionRedisOperations", spyOperations);
@@ -267,7 +267,8 @@ class ReactiveRedisSessionRepositoryITests extends AbstractRedisITests {
ReactiveHashOperations<String, Object, Object> opsForHash = spy(this.sessionRedisOperations.opsForHash());
given(spy.opsForHash()).willReturn(opsForHash);
willAnswer((invocation) -> Mono.delay(Duration.ofSeconds(1)).then((Mono<Void>) invocation.callRealMethod()))
.given(opsForHash).putAll(anyString(), any());
.given(opsForHash)
.putAll(anyString(), any());
RedisSession toSave = this.repository.createSession().block();
String expectedAttributeName = "a";

View File

@@ -81,7 +81,7 @@ class RedisIndexedSessionRepositoryDynamicITests extends AbstractRedisITests {
this.context.refresh();
this.sessionRepository = this.context.getBean(RedisIndexedSessionRepository.class);
RedisOperations<String, Object> redisOperations = (RedisOperations<String, Object>) ReflectionTestUtils
.getField(this.sessionRepository, "sessionRedisOperations");
.getField(this.sessionRepository, "sessionRedisOperations");
this.spyOperations = spy(redisOperations);
ReflectionTestUtils.setField(this.sessionRepository, "sessionRedisOperations", this.spyOperations);
}

View File

@@ -119,7 +119,7 @@ class RedisIndexedSessionRepositoryITests extends AbstractRedisITests {
assertThat(session.getId()).isEqualTo(toSave.getId());
assertThat(session.getAttributeNames()).isEqualTo(toSave.getAttributeNames());
assertThat(session.<String>getAttribute(expectedAttributeName))
.isEqualTo(toSave.getAttribute(expectedAttributeName));
.isEqualTo(toSave.getAttribute(expectedAttributeName));
this.registry.clear();
@@ -127,11 +127,11 @@ class RedisIndexedSessionRepositoryITests extends AbstractRedisITests {
assertThat(this.repository.findById(toSave.getId())).isNull();
assertThat(this.registry.<SessionDestroyedEvent>getEvent(toSave.getId()))
.isInstanceOf(SessionDestroyedEvent.class);
.isInstanceOf(SessionDestroyedEvent.class);
assertThat(this.redis.boundSetOps(usernameSessionKey).members()).doesNotContain(toSave.getId());
assertThat(this.registry.getEvent(toSave.getId()).getSession().<String>getAttribute(expectedAttributeName))
.isEqualTo(expectedAttributeValue);
.isEqualTo(expectedAttributeValue);
}
@Test

View File

@@ -54,7 +54,7 @@ class RedisSessionRepositoryITests extends AbstractRedisITests {
void save_NewSession_ShouldSaveSession() {
RedisSession session = createAndSaveSession(Instant.now());
assertThat(session.getMaxInactiveInterval())
.isEqualTo(Duration.ofSeconds(MapSession.DEFAULT_MAX_INACTIVE_INTERVAL_SECONDS));
.isEqualTo(Duration.ofSeconds(MapSession.DEFAULT_MAX_INACTIVE_INTERVAL_SECONDS));
assertThat(session.getAttributeNames()).isEqualTo(Collections.singleton("attribute1"));
assertThat(session.<String>getAttribute("attribute1")).isEqualTo("value1");
}
@@ -69,7 +69,7 @@ class RedisSessionRepositoryITests extends AbstractRedisITests {
RedisSession session = createAndSaveSession(Instant.now());
this.sessionRepository.deleteById(session.getId());
assertThatIllegalStateException().isThrownBy(() -> this.sessionRepository.save(session))
.withMessage("Session was invalidated");
.withMessage("Session was invalidated");
}
@Test
@@ -160,7 +160,7 @@ class RedisSessionRepositoryITests extends AbstractRedisITests {
updateSession(session, Instant.now(), "attribute1", "value1");
String newSessionId = session.changeSessionId();
assertThatIllegalStateException().isThrownBy(() -> this.sessionRepository.save(session))
.withMessage("Session was invalidated");
.withMessage("Session was invalidated");
assertThat(this.sessionRepository.findById(newSessionId)).isNull();
assertThat(this.sessionRepository.findById(originalSessionId)).isNull();
}
@@ -177,7 +177,7 @@ class RedisSessionRepositoryITests extends AbstractRedisITests {
updateSession(copy2, now.plusSeconds(2L), "attribute3", "value3");
String newSessionId2 = copy2.changeSessionId();
assertThatIllegalStateException().isThrownBy(() -> this.sessionRepository.save(copy2))
.withMessage("Session was invalidated");
.withMessage("Session was invalidated");
assertThat(this.sessionRepository.findById(newSessionId1)).isNotNull();
assertThat(this.sessionRepository.findById(newSessionId2)).isNull();
assertThat(this.sessionRepository.findById(originalSessionId)).isNull();

View File

@@ -56,7 +56,7 @@ class RedisListenerContainerTaskExecutorITests extends AbstractRedisITests {
@Test
void testRedisDelEventsAreDispatchedInSessionTaskExecutor() throws InterruptedException {
BoundSetOperations<Object, Object> ops = this.redis
.boundSetOps("spring:session:RedisListenerContainerTaskExecutorITests:expirations:dummy");
.boundSetOps("spring:session:RedisListenerContainerTaskExecutorITests:expirations:dummy");
ops.add("value");
ops.remove("value");
assertThat(this.executor.taskDispatched()).isTrue();