Store destination UUIDs when persisting messages to DynamoDB

This commit is contained in:
Jon Chambers authored and Jon Chambers committed 2021-12-02 12:17:08 -05:00
1 parent 394f58f6cc
commit c5f261305d
3 files changed
+16 -12

No files matched your search

@@ -154,6 +154,7 @@ class MessagePersisterIntegrationTest {
.setTimestamp(AttributeValues.getLong(item, "TS", -1))
.setServerTimestamp(extractServerTimestamp(AttributeValues.getByteArray(item, "S", null)))
.setContent(ByteString.copyFrom(AttributeValues.getByteArray(item, "C", null)))
.setDestinationUuid(AttributeValues.getUUID(item, "DU", null).toString())
.build());
}
@@ -174,6 +175,7 @@ class MessagePersisterIntegrationTest {
.setContent(ByteString.copyFromUtf8(RandomStringUtils.randomAlphanumeric(256)))
.setType(MessageProtos.Envelope.Type.CIPHERTEXT)
.setServerGuid(messageGuid.toString())
.setDestinationUuid(UUID.randomUUID().toString())
.build();
}
}
@@ -248,17 +248,18 @@ class WebSocketConnectionIntegrationTest {
assertTrue(expectedMessages.containsAll(sentMessages));
});
}
}
private MessageProtos.Envelope generateRandomMessage(final UUID messageGuid) {
final long timestamp = serialTimestamp++;
private MessageProtos.Envelope generateRandomMessage(final UUID messageGuid) {
final long timestamp = serialTimestamp++;
return MessageProtos.Envelope.newBuilder()
.setTimestamp(timestamp)
.setServerTimestamp(timestamp)
.setContent(ByteString.copyFromUtf8(RandomStringUtils.randomAlphanumeric(256)))
.setType(MessageProtos.Envelope.Type.CIPHERTEXT)
.setServerGuid(messageGuid.toString())
.build();
}
return MessageProtos.Envelope.newBuilder()
.setTimestamp(timestamp)
.setServerTimestamp(timestamp)
.setContent(ByteString.copyFromUtf8(RandomStringUtils.randomAlphanumeric(256)))
.setType(MessageProtos.Envelope.Type.CIPHERTEXT)
.setServerGuid(messageGuid.toString())
.setDestinationUuid(UUID.randomUUID().toString())
.build();
}
}