Make MessagesCache#clear methods asynchronous

This commit is contained in:
Jon Chambers
2023-08-08 10:34:58 -04:00
committed by Jon Chambers
parent 4d8c4d6693
commit 5caa951c61
3 changed files with 17 additions and 20 deletions

View File

@@ -320,7 +320,7 @@ class MessagesCacheTest {
}
}
messagesCache.clear(DESTINATION_UUID, DESTINATION_DEVICE_ID);
messagesCache.clear(DESTINATION_UUID, DESTINATION_DEVICE_ID).join();
assertEquals(Collections.emptyList(), get(DESTINATION_UUID, DESTINATION_DEVICE_ID, messageCount));
assertEquals(messageCount, get(DESTINATION_UUID, DESTINATION_DEVICE_ID + 1, messageCount).size());
@@ -340,18 +340,12 @@ class MessagesCacheTest {
}
}
messagesCache.clear(DESTINATION_UUID);
messagesCache.clear(DESTINATION_UUID).join();
assertEquals(Collections.emptyList(), get(DESTINATION_UUID, DESTINATION_DEVICE_ID, messageCount));
assertEquals(Collections.emptyList(), get(DESTINATION_UUID, DESTINATION_DEVICE_ID + 1, messageCount));
}
@Test
void testClearNullUuid() {
// We're happy as long as this doesn't throw an exception
messagesCache.clear(null);
}
@Test
void testGetAccountFromQueueName() {
assertEquals(DESTINATION_UUID,