Search in sources :

Example 1 with DefaultGraphFactory

use of uk.gov.gchq.gaffer.rest.factory.DefaultGraphFactory in project Gaffer by gchq.

the class DisableOperationsTest method shouldDisableOperationsUsingOperationDeclarations.

@Test
public void shouldDisableOperationsUsingOperationDeclarations() {
    Class<? extends Operation>[] disabledOperations = getDisabledOperations();
    // Given
    System.setProperty(SystemProperty.STORE_PROPERTIES_PATH, storePropsPath.getAbsolutePath());
    System.setProperty(SystemProperty.SCHEMA_PATHS, schemaPath.getAbsolutePath());
    System.setProperty(SystemProperty.GRAPH_CONFIG_PATH, graphConfigPath.getAbsolutePath());
    final DefaultGraphFactory factory = new DefaultGraphFactory();
    // When
    final Graph graph = factory.createGraph();
    // Then
    for (final Class<? extends Operation> disabledOperation : disabledOperations) {
        assertFalse(graph.isSupported(disabledOperation), disabledOperation.getSimpleName() + " should not be supported");
    }
}
Also used : Graph(uk.gov.gchq.gaffer.graph.Graph) DefaultGraphFactory(uk.gov.gchq.gaffer.rest.factory.DefaultGraphFactory) Operation(uk.gov.gchq.gaffer.operation.Operation) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)1 Graph (uk.gov.gchq.gaffer.graph.Graph)1 Operation (uk.gov.gchq.gaffer.operation.Operation)1 DefaultGraphFactory (uk.gov.gchq.gaffer.rest.factory.DefaultGraphFactory)1