Fix Formatting & Checkstyle
Signed-off-by: Rob Winch <362503+rwinch@users.noreply.github.com>
This commit is contained in:
@@ -911,42 +911,42 @@ public class JdbcIndexedSessionRepository implements
|
||||
if (JdbcSession.this.changed) {
|
||||
deltaActions.add(() -> {
|
||||
Map<String, String> indexes = JdbcIndexedSessionRepository.this.indexResolver
|
||||
.resolveIndexesFor(JdbcSession.this);
|
||||
.resolveIndexesFor(JdbcSession.this);
|
||||
JdbcIndexedSessionRepository.this.jdbcOperations
|
||||
.update(JdbcIndexedSessionRepository.this.updateSessionQuery, (ps) -> {
|
||||
ps.setString(1, getId());
|
||||
ps.setLong(2, getLastAccessedTime().toEpochMilli());
|
||||
ps.setInt(3, (int) getMaxInactiveInterval().getSeconds());
|
||||
ps.setLong(4, getExpiryTime().toEpochMilli());
|
||||
ps.setString(5, indexes.get(PRINCIPAL_NAME_INDEX_NAME));
|
||||
ps.setString(6, JdbcSession.this.primaryKey);
|
||||
});
|
||||
.update(JdbcIndexedSessionRepository.this.updateSessionQuery, (ps) -> {
|
||||
ps.setString(1, getId());
|
||||
ps.setLong(2, getLastAccessedTime().toEpochMilli());
|
||||
ps.setInt(3, (int) getMaxInactiveInterval().getSeconds());
|
||||
ps.setLong(4, getExpiryTime().toEpochMilli());
|
||||
ps.setString(5, indexes.get(PRINCIPAL_NAME_INDEX_NAME));
|
||||
ps.setString(6, JdbcSession.this.primaryKey);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
List<String> addedAttributeNames = JdbcSession.this.delta.entrySet()
|
||||
.stream()
|
||||
.filter((entry) -> entry.getValue() == DeltaValue.ADDED)
|
||||
.map(Map.Entry::getKey)
|
||||
.collect(Collectors.toList());
|
||||
.stream()
|
||||
.filter((entry) -> entry.getValue() == DeltaValue.ADDED)
|
||||
.map(Map.Entry::getKey)
|
||||
.collect(Collectors.toList());
|
||||
if (!addedAttributeNames.isEmpty()) {
|
||||
deltaActions.add(() -> insertSessionAttributes(JdbcSession.this, addedAttributeNames));
|
||||
}
|
||||
|
||||
List<String> updatedAttributeNames = JdbcSession.this.delta.entrySet()
|
||||
.stream()
|
||||
.filter((entry) -> entry.getValue() == DeltaValue.UPDATED)
|
||||
.map(Map.Entry::getKey)
|
||||
.collect(Collectors.toList());
|
||||
.stream()
|
||||
.filter((entry) -> entry.getValue() == DeltaValue.UPDATED)
|
||||
.map(Map.Entry::getKey)
|
||||
.collect(Collectors.toList());
|
||||
if (!updatedAttributeNames.isEmpty()) {
|
||||
deltaActions.add(() -> updateSessionAttributes(JdbcSession.this, updatedAttributeNames));
|
||||
}
|
||||
|
||||
List<String> removedAttributeNames = JdbcSession.this.delta.entrySet()
|
||||
.stream()
|
||||
.filter((entry) -> entry.getValue() == DeltaValue.REMOVED)
|
||||
.map(Map.Entry::getKey)
|
||||
.collect(Collectors.toList());
|
||||
.stream()
|
||||
.filter((entry) -> entry.getValue() == DeltaValue.REMOVED)
|
||||
.map(Map.Entry::getKey)
|
||||
.collect(Collectors.toList());
|
||||
if (!removedAttributeNames.isEmpty()) {
|
||||
deltaActions.add(() -> deleteSessionAttributes(JdbcSession.this, removedAttributeNames));
|
||||
}
|
||||
|
||||
@@ -67,7 +67,6 @@ import static org.mockito.Mockito.lenient;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.times;
|
||||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.verifyNoInteractions;
|
||||
import static org.mockito.Mockito.verifyNoMoreInteractions;
|
||||
|
||||
/**
|
||||
@@ -92,17 +91,18 @@ class JdbcIndexedSessionRepositoryTests {
|
||||
@BeforeEach
|
||||
void setUp() {
|
||||
// Mock transaction callbacks to the real consumer
|
||||
lenient().doAnswer(answer -> {
|
||||
lenient().doAnswer((answer) -> {
|
||||
answer.getArgument(0, Consumer.class).accept(mock(TransactionStatus.class));
|
||||
return null;
|
||||
}).when(transactionOperations).executeWithoutResult(any());
|
||||
}).when(this.transactionOperations).executeWithoutResult(any());
|
||||
|
||||
lenient().doAnswer(answer ->
|
||||
answer.getArgument(0, TransactionCallback.class).doInTransaction(mock(TransactionStatus.class))
|
||||
).when(transactionOperations).execute(any());
|
||||
lenient()
|
||||
.doAnswer((answer) -> answer.getArgument(0, TransactionCallback.class)
|
||||
.doInTransaction(mock(TransactionStatus.class)))
|
||||
.when(this.transactionOperations)
|
||||
.execute(any());
|
||||
|
||||
this.repository = new JdbcIndexedSessionRepository(this.jdbcOperations,
|
||||
transactionOperations);
|
||||
this.repository = new JdbcIndexedSessionRepository(this.jdbcOperations, this.transactionOperations);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user