Search in sources :

Example 1 with GetExports

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());
}
Also used : GetExports(uk.gov.gchq.gaffer.operation.impl.export.GetExports) OperationTest(uk.gov.gchq.gaffer.operation.OperationTest) Test(org.junit.Test)

Example 2 with GetExports

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());
}
Also used : GetExports(uk.gov.gchq.gaffer.operation.impl.export.GetExports) Test(org.junit.jupiter.api.Test) OperationTest(uk.gov.gchq.gaffer.operation.OperationTest)

Example 3 with GetExports

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());
}
Also used : GetExports(uk.gov.gchq.gaffer.operation.impl.export.GetExports) Test(org.junit.jupiter.api.Test) OperationTest(uk.gov.gchq.gaffer.operation.OperationTest)

Example 4 with GetExports

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);
}
Also used : GetExports(uk.gov.gchq.gaffer.operation.impl.export.GetExports) GetSetExport(uk.gov.gchq.gaffer.operation.impl.export.set.GetSetExport) Test(org.junit.jupiter.api.Test) OperationTest(uk.gov.gchq.gaffer.operation.OperationTest)

Aggregations

OperationTest (uk.gov.gchq.gaffer.operation.OperationTest)4 GetExports (uk.gov.gchq.gaffer.operation.impl.export.GetExports)4 Test (org.junit.jupiter.api.Test)3 Test (org.junit.Test)1 GetSetExport (uk.gov.gchq.gaffer.operation.impl.export.set.GetSetExport)1