Remove an unused hasMessages method

This commit is contained in:
Jon Chambers authored and Jon Chambers committed 2025-08-04 09:59:17 -04:00
1 parent 6fa01a5d48
commit 7bb4a4bc90
2 files changed
-16

No files matched your search

@@ -285,11 +285,6 @@ public class MessagesCache {
}
public boolean hasMessages(final UUID destinationUuid, final byte destinationDevice) {
return redisCluster.withBinaryCluster(
connection -> connection.sync().zcard(getMessageQueueKey(destinationUuid, destinationDevice)) > 0);
}
public CompletableFuture<Boolean> hasMessagesAsync(final UUID destinationUuid, final byte destinationDevice) {
return redisCluster.withBinaryCluster(connection ->
connection.async().zcard(getMessageQueueKey(destinationUuid, destinationDevice))
@@ -193,17 +193,6 @@ class MessagesCacheTest {
assertEquals(messagesToPreserve, get(DESTINATION_UUID, DESTINATION_DEVICE_ID, messageCount));
}
@Test
void testHasMessages() {
assertFalse(messagesCache.hasMessages(DESTINATION_UUID, DESTINATION_DEVICE_ID));
final UUID messageGuid = UUID.randomUUID();
final MessageProtos.Envelope message = generateRandomMessage(messageGuid, true);
messagesCache.insert(messageGuid, DESTINATION_UUID, DESTINATION_DEVICE_ID, message).join();
assertTrue(messagesCache.hasMessages(DESTINATION_UUID, DESTINATION_DEVICE_ID));
}
@Test
void testHasMessagesAsync() {
assertFalse(messagesCache.hasMessagesAsync(DESTINATION_UUID, DESTINATION_DEVICE_ID).join());