use of uk.gov.gchq.gaffer.access.predicate.NoAccessPredicate in project Gaffer by gchq.
the class FederatedRemoveGraphHandlerTest method shouldNotRemoveGraphConfiguredWithNoAccessWritePredicate.
@Test
public void shouldNotRemoveGraphConfiguredWithNoAccessWritePredicate() throws Exception {
FederatedStore store = new FederatedStore();
final FederatedStoreProperties federatedStoreProperties = new FederatedStoreProperties();
federatedStoreProperties.setCacheProperties(CACHE_SERVICE_CLASS_STRING);
store.initialise(FEDERATEDSTORE_GRAPH_ID, null, federatedStoreProperties);
final AccessPredicate noAccessPredicate = new NoAccessPredicate();
store.addGraphs(testUser.getOpAuths(), "other", false, false, null, noAccessPredicate, new GraphSerialisable.Builder().config(new GraphConfig(EXPECTED_GRAPH_ID)).schema(new Schema.Builder().build()).properties(PROPERTIES).build());
assertEquals(1, store.getGraphs(testUser, null, ignore).size());
new FederatedRemoveGraphHandler().doOperation(new RemoveGraph.Builder().graphId(EXPECTED_GRAPH_ID).build(), new Context(testUser), store);
Collection<Graph> graphs = store.getGraphs(testUser, null, ignore);
assertThat(graphs).hasSize(1);
}
Aggregations