Search in sources :

Example 1 with NamedOperationResolver

use of uk.gov.gchq.gaffer.graph.hook.NamedOperationResolver in project Gaffer by gchq.

the class GraphTest method shouldAddHookAndGetGraphHooks.

@Test
public void shouldAddHookAndGetGraphHooks() throws Exception {
    // Given
    final StoreProperties storeProperties = new StoreProperties();
    storeProperties.setStoreClass(TestStore.class.getName());
    TestStore.mockStore = mock(Store.class);
    given(TestStore.mockStore.isSupported(NamedOperation.class)).willReturn(true);
    final GraphHook graphHook1 = mock(GraphHook.class);
    final NamedOperationResolver graphHook2 = new NamedOperationResolver();
    final Log4jLogger graphHook3 = mock(Log4jLogger.class);
    // When
    final Graph graph = new Graph.Builder().graphId("graphId").storeProperties(storeProperties).addSchemas(StreamUtil.schemas(getClass())).addHook(graphHook1).addHook(graphHook2).addHook(graphHook3).build();
    // Then
    assertEquals(Arrays.asList(NamedViewResolver.class, graphHook1.getClass(), graphHook2.getClass(), graphHook3.getClass(), FunctionAuthoriser.class), graph.getGraphHooks());
}
Also used : NamedOperationResolver(uk.gov.gchq.gaffer.graph.hook.NamedOperationResolver) GraphHook(uk.gov.gchq.gaffer.graph.hook.GraphHook) Store(uk.gov.gchq.gaffer.store.Store) TestStore(uk.gov.gchq.gaffer.integration.store.TestStore) StoreProperties(uk.gov.gchq.gaffer.store.StoreProperties) NamedViewResolver(uk.gov.gchq.gaffer.graph.hook.NamedViewResolver) TestStore(uk.gov.gchq.gaffer.integration.store.TestStore) Log4jLogger(uk.gov.gchq.gaffer.graph.hook.Log4jLogger) FunctionAuthoriser(uk.gov.gchq.gaffer.graph.hook.FunctionAuthoriser) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)1 FunctionAuthoriser (uk.gov.gchq.gaffer.graph.hook.FunctionAuthoriser)1 GraphHook (uk.gov.gchq.gaffer.graph.hook.GraphHook)1 Log4jLogger (uk.gov.gchq.gaffer.graph.hook.Log4jLogger)1 NamedOperationResolver (uk.gov.gchq.gaffer.graph.hook.NamedOperationResolver)1 NamedViewResolver (uk.gov.gchq.gaffer.graph.hook.NamedViewResolver)1 TestStore (uk.gov.gchq.gaffer.integration.store.TestStore)1 Store (uk.gov.gchq.gaffer.store.Store)1 StoreProperties (uk.gov.gchq.gaffer.store.StoreProperties)1