Skip to content

Commit 8859e84

Browse files
Copilotphrocker
andcommitted
Fix compilation error in SessionServiceTest due to type mismatch
Co-authored-by: phrocker <1781585+phrocker@users.noreply.github.com>
1 parent 6742fac commit 8859e84

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

agent-proxy/src/test/java/io/sentrius/sso/service/ActiveWebSocketSessionManagerTest.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,6 @@ void testRegisterAndUnregisterSession() {
7272
void testGetActiveAgentSessionDurations() throws InterruptedException {
7373
// Given
7474
String sessionId = "active-session-1";
75-
when(webSocketSession.getId()).thenReturn(sessionId);
76-
when(webSocketSession.isOpen()).thenReturn(true);
77-
when(webSocketSession.getHandshakeInfo()).thenReturn(handshakeInfo);
78-
when(handshakeInfo.getRemoteAddress()).thenReturn(new InetSocketAddress("127.0.0.1", 8080));
7975

8076
// When
8177
sessionManager.register(sessionId, webSocketSession);

dataplane/src/test/java/io/sentrius/sso/core/services/SessionServiceTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import java.time.LocalDateTime;
2020
import java.util.ArrayList;
2121
import java.util.Arrays;
22+
import java.util.Collections;
2223
import java.util.HashMap;
2324
import java.util.List;
2425
import java.util.Map;
@@ -61,13 +62,13 @@ void testGetGraphDataWithoutAgentSessions() {
6162
));
6263

6364
when(terminalLogRepository.findMinAndMaxLogTmBySessionLogId(1L))
64-
.thenReturn(Arrays.asList(new Object[]{
65+
.thenReturn(Collections.singletonList(new Object[]{
6566
Timestamp.valueOf(LocalDateTime.now().minusMinutes(10)),
6667
Timestamp.valueOf(LocalDateTime.now().minusMinutes(5))
6768
}));
6869

6970
when(terminalLogRepository.findMinAndMaxLogTmBySessionLogId(2L))
70-
.thenReturn(Arrays.asList(new Object[]{
71+
.thenReturn(Collections.singletonList(new Object[]{
7172
Timestamp.valueOf(LocalDateTime.now().minusMinutes(20)),
7273
Timestamp.valueOf(LocalDateTime.now())
7374
}));

0 commit comments

Comments
 (0)