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());
}
Aggregations