Search in sources :

Example 1 with MockNamedOperationCache

use of uk.gov.gchq.gaffer.named.operation.cache.MockNamedOperationCache in project Gaffer by gchq.

the class AddNamedOperationHandlerTest method before.

@Before
public void before() {
    addNamedOperation.setOperationName(OPERATION_NAME);
    handler.setCache(new MockNamedOperationCache());
}
Also used : MockNamedOperationCache(uk.gov.gchq.gaffer.named.operation.cache.MockNamedOperationCache) Before(org.junit.Before)

Example 2 with MockNamedOperationCache

use of uk.gov.gchq.gaffer.named.operation.cache.MockNamedOperationCache in project Gaffer by gchq.

the class NamedOperationHandlerTest method shouldLoadCacheFromOperationsDeclarationsFile.

@Test
public void shouldLoadCacheFromOperationsDeclarationsFile() throws SerialisationException {
    final InputStream s = StreamUtil.openStream(getClass(), "NamedOperationDeclarations.json");
    final OperationDeclarations deserialised = json.deserialise(s, OperationDeclarations.class);
    INamedOperationCache cache = ((AddNamedOperationHandler) deserialised.getOperations().get(0).getHandler()).getCache();
    assert (cache instanceof MockNamedOperationCache);
}
Also used : InputStream(java.io.InputStream) MockNamedOperationCache(uk.gov.gchq.gaffer.named.operation.cache.MockNamedOperationCache) INamedOperationCache(uk.gov.gchq.gaffer.named.operation.cache.INamedOperationCache) OperationDeclarations(uk.gov.gchq.gaffer.store.operationdeclaration.OperationDeclarations) Test(org.junit.Test)

Aggregations

MockNamedOperationCache (uk.gov.gchq.gaffer.named.operation.cache.MockNamedOperationCache)2 InputStream (java.io.InputStream)1 Before (org.junit.Before)1 Test (org.junit.Test)1 INamedOperationCache (uk.gov.gchq.gaffer.named.operation.cache.INamedOperationCache)1 OperationDeclarations (uk.gov.gchq.gaffer.store.operationdeclaration.OperationDeclarations)1