use of uk.gov.gchq.gaffer.serialisation.CustomMapSerialiser in project Gaffer by gchq.
the class RBMBackedTimestampSetSerialiserTest method shouldSerialiserStringRBMBackedTimestampSet.
@Test
public void shouldSerialiserStringRBMBackedTimestampSet() throws SerialisationException {
// Given
final Serialiser<CustomMap, byte[]> customMapSerialiser = new CustomMapSerialiser();
final RBMBackedTimestampSet timestampSet1 = new RBMBackedTimestampSet.Builder().timeBucket(TimeBucket.MINUTE).timestamps(Lists.newArrayList(Instant.ofEpochSecond(10))).timestamps(Lists.newArrayList(Instant.ofEpochSecond(20))).build();
final RBMBackedTimestampSet timestampSet2 = new RBMBackedTimestampSet.Builder().timeBucket(TimeBucket.MINUTE).timestamps(Lists.newArrayList(Instant.ofEpochSecond(111))).timestamps(Lists.newArrayList(Instant.ofEpochSecond(222))).build();
final CustomMap<String, RBMBackedTimestampSet> expected = new CustomMap<String, RBMBackedTimestampSet>(new StringSerialiser(), new RBMBackedTimestampSetSerialiser());
expected.put("OneTimeStamp", timestampSet1);
expected.put("TwoTimeStamp", timestampSet2);
// When
final CustomMap deserialise = customMapSerialiser.deserialise(customMapSerialiser.serialise(expected));
// Then
detailedEquals(expected, deserialise, String.class, RBMBackedTimestampSet.class, new StringSerialiser(), new RBMBackedTimestampSetSerialiser());
}
Aggregations