Search in sources :

Example 6 with GetGafferResultCacheExport

use of uk.gov.gchq.gaffer.operation.impl.export.resultcache.GetGafferResultCacheExport in project Gaffer by gchq.

the class GetGafferResultCacheExportTest method shouldJSONSerialiseAndDeserialise.

@Test
public void shouldJSONSerialiseAndDeserialise() throws SerialisationException {
    // Given
    final String key = "key";
    final GetGafferResultCacheExport op = new GetGafferResultCacheExport.Builder().key(key).build();
    // When
    byte[] json = JSONSerialiser.serialise(op, true);
    final GetGafferResultCacheExport deserialisedOp = JSONSerialiser.deserialise(json, GetGafferResultCacheExport.class);
    // Then
    assertEquals(key, deserialisedOp.getKey());
}
Also used : GetGafferResultCacheExport(uk.gov.gchq.gaffer.operation.impl.export.resultcache.GetGafferResultCacheExport) Test(org.junit.jupiter.api.Test) OperationTest(uk.gov.gchq.gaffer.operation.OperationTest)

Example 7 with GetGafferResultCacheExport

use of uk.gov.gchq.gaffer.operation.impl.export.resultcache.GetGafferResultCacheExport in project Gaffer by gchq.

the class GetGafferResultCacheExportTest method shouldShallowCloneOperation.

@Test
@Override
public void shouldShallowCloneOperation() {
    // Given
    final String key = "key";
    final String jobId = "jobId";
    final GetGafferResultCacheExport getGafferResultCacheExport = new GetGafferResultCacheExport.Builder().key(key).jobId(jobId).build();
    // When
    GetGafferResultCacheExport clone = getGafferResultCacheExport.shallowClone();
    // Then
    assertNotSame(getGafferResultCacheExport, clone);
    assertEquals(key, clone.getKey());
    assertEquals(jobId, clone.getJobId());
}
Also used : GetGafferResultCacheExport(uk.gov.gchq.gaffer.operation.impl.export.resultcache.GetGafferResultCacheExport) Test(org.junit.jupiter.api.Test) OperationTest(uk.gov.gchq.gaffer.operation.OperationTest)

Aggregations

GetGafferResultCacheExport (uk.gov.gchq.gaffer.operation.impl.export.resultcache.GetGafferResultCacheExport)7 Test (org.junit.jupiter.api.Test)5 OperationTest (uk.gov.gchq.gaffer.operation.OperationTest)4 Test (org.junit.Test)2 CloseableIterable (uk.gov.gchq.gaffer.commonutil.iterable.CloseableIterable)2 WrappedCloseableIterable (uk.gov.gchq.gaffer.commonutil.iterable.WrappedCloseableIterable)2 TestStore (uk.gov.gchq.gaffer.integration.store.TestStore)2 GafferResultCacheExporter (uk.gov.gchq.gaffer.operation.export.resultcache.GafferResultCacheExporter)2 GetElements (uk.gov.gchq.gaffer.operation.impl.get.GetElements)2 Context (uk.gov.gchq.gaffer.store.Context)2 Store (uk.gov.gchq.gaffer.store.Store)2 View (uk.gov.gchq.gaffer.data.elementdefinition.view.View)1 OperationChain (uk.gov.gchq.gaffer.operation.OperationChain)1 Builder (uk.gov.gchq.gaffer.operation.OperationChain.Builder)1 EntitySeed (uk.gov.gchq.gaffer.operation.data.EntitySeed)1 EntityIdExtractor (uk.gov.gchq.gaffer.operation.data.generator.EntityIdExtractor)1 DiscardOutput (uk.gov.gchq.gaffer.operation.impl.DiscardOutput)1 ExportToGafferResultCache (uk.gov.gchq.gaffer.operation.impl.export.resultcache.ExportToGafferResultCache)1