Skip to content

Commit

Permalink
Fixed test for resume publish reenter with right message size
Browse files Browse the repository at this point in the history
  • Loading branch information
sacOO7 committed Jan 30, 2024
1 parent d13051f commit 5449a9b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1717,7 +1717,7 @@ public void onPresenceMessage(PresenceMessage message) {
!receivedMessageStack.get(receivedMessageStack.size()-1).data.equals("Dolor sit!"))
receivedMessageStack.wait();
}
} catch(InterruptedException e) {}
} catch(InterruptedException ignored) {}

/* Validate that,
*- we received specific actions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
Expand Down Expand Up @@ -1062,13 +1064,13 @@ public void onConnectionStateChanged(ConnectionStateChange state) {
System.out.println("presence_resume_test: sent message with client: "+presenceMessage.clientId +" " +
" action:"+presenceMessage.action);
}
assertEquals("Second round of messages has incorrect size", 9, transport.getSentPresenceMessages().size());
assertEquals("Second round of messages has incorrect size", 6, transport.getSentPresenceMessages().size());
//make sure they were sent with correct client ids
final Map<String,PresenceMessage> sentPresenceMap = new HashMap<>();
for (PresenceMessage presenceMessage: transport.getSentPresenceMessages()){
sentPresenceMap.put(presenceMessage.clientId, presenceMessage);
}
for (String client : clients) {
for (String client : Arrays.stream(clients).skip(3).collect(Collectors.toList())) {
assertTrue("Client id isn't there:" + client, sentPresenceMap.containsKey(client));
}
}
Expand Down

0 comments on commit 5449a9b

Please sign in to comment.