Skip to content

Commit

Permalink
changes done
Browse files Browse the repository at this point in the history
Signed-off-by: Md-Humair-KK <[email protected]>
  • Loading branch information
Md-Humair-KK committed Jan 7, 2025
1 parent 1c445db commit 79db939
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ public void onDisconnected(SessionDisconnectEvent disconnectEvent) {
String slotId = username.split(VALUE_SEPARATOR)[1];

log.info("WebSocket Disconnected >>>>>> {}", username);
log.info("WebSocket Disconnected Status>>>>>> {}", disconnectEvent.getCloseStatus());
if(!CloseStatus.NORMAL.equals(disconnectEvent.getCloseStatus())){
IdentityVerificationTransaction transaction =
cacheUtilService.getVerifiedSlotTransaction(slotId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ public String getName() {
return "TID"+VALUE_SEPARATOR+"SID";
}
});
IdentityVerificationTransaction transaction = new IdentityVerificationTransaction();
transaction.setStatus(VerificationStatus.FAILED);
Mockito.when(cacheUtilService.getVerifiedSlotTransaction(Mockito.anyString())).thenReturn(transaction);
webSocketController.onDisconnected(sessionDisconnectEvent);
Mockito.verify(cacheUtilService, Mockito.times(1)).removeFromSlotConnected(Mockito.anyString());
Mockito.verify(cacheUtilService, Mockito.times(1)).evictSlotAllottedTransaction(Mockito.anyString(),Mockito.anyString());
Expand All @@ -133,7 +136,7 @@ public String getName() {
}

@Test
public void onDisconnectedAbnormalClosedState_test() {
public void onDisconnected_WithAbnormalClosedState_test() {
SessionDisconnectEvent sessionDisconnectEvent = Mockito.mock(SessionDisconnectEvent.class);
Mockito.when(sessionDisconnectEvent.getUser()).thenReturn(new java.security.Principal() {
@Override
Expand Down

0 comments on commit 79db939

Please sign in to comment.