use of uk.gov.gchq.gaffer.operation.impl.export.GetExports in project Gaffer by gchq.
the class GetExportsTest method shouldSerialiseAndDeserialiseOperation.
@Test
@Override
public void shouldSerialiseAndDeserialiseOperation() throws SerialisationException {
// Given
final GetExports op = new GetExports.Builder().exports(new GetSetExport.Builder().key("key1").build(), new GetSetExport.Builder().key("key2").build()).build();
// When
byte[] json = serialiser.serialise(op, true);
final GetExports deserialisedOp = serialiser.deserialise(json, GetExports.class);
// Then
assertEquals("key1", deserialisedOp.getGetExports().get(0).getKey());
assertEquals("key2", deserialisedOp.getGetExports().get(1).getKey());
}
use of uk.gov.gchq.gaffer.operation.impl.export.GetExports in project Gaffer by gchq.
the class GetExportsTest method shouldJSONSerialiseAndDeserialise.
@Test
public void shouldJSONSerialiseAndDeserialise() throws SerialisationException {
// Given
final GetExports op = new GetExports.Builder().exports(new GetSetExport.Builder().key("key1").build(), new GetSetExport.Builder().key("key2").build()).build();
// When
byte[] json = JSONSerialiser.serialise(op, true);
final GetExports deserialisedOp = JSONSerialiser.deserialise(json, GetExports.class);
// Then
assertEquals("key1", deserialisedOp.getGetExports().get(0).getKey());
assertEquals("key2", deserialisedOp.getGetExports().get(1).getKey());
}
use of uk.gov.gchq.gaffer.operation.impl.export.GetExports in project Gaffer by gchq.
the class GetExportsTest method builderShouldCreatePopulatedOperation.
@Test
@Override
public void builderShouldCreatePopulatedOperation() {
// When
final GetExports op = new GetExports.Builder().exports(new GetSetExport.Builder().key("key1").build(), new GetSetExport.Builder().key("key2").build()).build();
// Then
assertEquals("key1", op.getGetExports().get(0).getKey());
assertEquals("key2", op.getGetExports().get(1).getKey());
}
use of uk.gov.gchq.gaffer.operation.impl.export.GetExports in project Gaffer by gchq.
the class GetExportsTest method shouldShallowCloneOperation.
@Test
@Override
public void shouldShallowCloneOperation() {
// Given
final GetSetExport getSetExport = new GetSetExport.Builder().key("key1").build();
final GetExports getExports = new GetExports.Builder().exports(getSetExport).build();
// When
final GetExports clone = getExports.shallowClone();
// Then
assertNotSame(getExports, clone);
assertThat(clone.getGetExports().iterator().next()).isEqualTo(getSetExport);
}
Aggregations