use of uk.gov.gchq.gaffer.types.TypeValue in project Gaffer by gchq.
the class TypeValueSerialiserTest method testCanSerialiseDeSerialiseCorrectly.
@Test
public void testCanSerialiseDeSerialiseCorrectly() throws SerialisationException {
TypeValue typeValue = new TypeValue("testType", "testValue");
byte[] bytes = serialiser.serialise(typeValue);
String serialisedForm = new String(bytes);
assertEquals("testType\0testValue", serialisedForm);
TypeValue deSerialisedTypeValue = (TypeValue) serialiser.deserialise(bytes);
assertEquals(typeValue.getType(), deSerialisedTypeValue.getType());
assertEquals(typeValue.getValue(), deSerialisedTypeValue.getValue());
assertEquals(typeValue, deSerialisedTypeValue);
}
Aggregations