use of org.apache.rya.periodic.notification.notification.PeriodicNotification in project incubator-rya by apache.
the class CommandNotificationSerializerTest method basicSerializationTest.
@Test
public void basicSerializationTest() {
PeriodicNotification notification = PeriodicNotification.builder().id(UUID.randomUUID().toString()).period(24).timeUnit(TimeUnit.DAYS).initialDelay(1).build();
CommandNotification command = new CommandNotification(Command.ADD, notification);
Assert.assertEquals(command, serializer.deserialize(topic, serializer.serialize(topic, command)));
PeriodicNotification notification1 = PeriodicNotification.builder().id(UUID.randomUUID().toString()).period(32).timeUnit(TimeUnit.SECONDS).initialDelay(15).build();
CommandNotification command1 = new CommandNotification(Command.ADD, notification1);
Assert.assertEquals(command1, serializer.deserialize(topic, serializer.serialize(topic, command1)));
PeriodicNotification notification2 = PeriodicNotification.builder().id(UUID.randomUUID().toString()).period(32).timeUnit(TimeUnit.SECONDS).initialDelay(15).build();
CommandNotification command2 = new CommandNotification(Command.ADD, notification2);
Assert.assertEquals(command2, serializer.deserialize(topic, serializer.serialize(topic, command2)));
BasicNotification notification3 = new BasicNotification(UUID.randomUUID().toString());
CommandNotification command3 = new CommandNotification(Command.ADD, notification3);
Assert.assertEquals(command3, serializer.deserialize(topic, serializer.serialize(topic, command3)));
}
Aggregations