use of uk.gov.gchq.gaffer.federatedstore.FederatedStoreProperties in project Gaffer by gchq.
the class FederatedGetSchemaHandlerTest method setup.
@BeforeEach
public void setup() throws StoreException {
HashMapGraphLibrary.clear();
CacheServiceLoader.shutdown();
handler = new FederatedGetSchemaHandler();
user = new User("testUser");
context = new Context(user);
properties = new FederatedStoreProperties();
properties.set(HashMapCacheService.STATIC_CACHE, String.valueOf(true));
fStore = new FederatedStore();
fStore.initialise(TEST_FED_STORE, null, properties);
library.clear();
}
use of uk.gov.gchq.gaffer.federatedstore.FederatedStoreProperties in project Gaffer by gchq.
the class FederatedAddGraphHandlerTest method setUp.
@BeforeEach
public void setUp() throws Exception {
CacheServiceLoader.shutdown();
this.store = new FederatedStore();
federatedStoreProperties = new FederatedStoreProperties();
federatedStoreProperties.setCacheProperties(CACHE_SERVICE_CLASS_STRING);
testUser = testUser();
authUser = authUser();
blankUser = blankUser();
ignore = new IgnoreOptions();
}
use of uk.gov.gchq.gaffer.federatedstore.FederatedStoreProperties 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);
}
use of uk.gov.gchq.gaffer.federatedstore.FederatedStoreProperties in project Gaffer by gchq.
the class FederatedAddGraphWithHooksHandlerTest method setUp.
@BeforeEach
public void setUp() throws Exception {
CacheServiceLoader.shutdown();
this.store = new FederatedStore();
federatedStoreProperties = new FederatedStoreProperties();
federatedStoreProperties.setCacheProperties(CACHE_SERVICE_CLASS_STRING);
testUser = testUser();
authUser = authUser();
blankUser = blankUser();
ignore = new IgnoreOptions();
}
use of uk.gov.gchq.gaffer.federatedstore.FederatedStoreProperties in project Gaffer by gchq.
the class FederatedGetTraitsHandlerTest method setUp.
@BeforeEach
public void setUp() throws Exception {
federatedStore = new FederatedStore();
properties = new FederatedStoreProperties();
HashMapGraphLibrary.clear();
CacheServiceLoader.shutdown();
storeProperties = new StoreProperties();
storeProperties.setStoreClass(TestStoreImpl.class);
}
Aggregations