Search in sources :

Example 11 with FederatedStoreProperties

use of uk.gov.gchq.gaffer.federatedstore.FederatedStoreProperties in project Gaffer by gchq.

the class FederatedOperationChainValidatorTest method shouldNotErrorWithInvalidViewFromMissingGraph.

@Test
public void shouldNotErrorWithInvalidViewFromMissingGraph() throws OperationException {
    // given
    String missingGraph = "missingGraph";
    final Graph graph = new Graph.Builder().addStoreProperties(new FederatedStoreProperties()).config(new GraphConfig.Builder().graphId("testFedGraph").build()).build();
    try {
        // when
        graph.execute(new GetAllElements.Builder().view(new View.Builder().entity("missingEntity").build()).option(FederatedStoreConstants.KEY_OPERATION_OPTIONS_GRAPH_IDS, missingGraph).build(), new Context());
        fail("exception expected");
    } catch (final IllegalArgumentException e) {
        // then
        assertEquals(String.format(FederatedGraphStorage.GRAPH_IDS_NOT_VISIBLE, Lists.newArrayList(missingGraph)), e.getMessage());
    }
}
Also used : Context(uk.gov.gchq.gaffer.store.Context) Graph(uk.gov.gchq.gaffer.graph.Graph) FederatedStoreProperties(uk.gov.gchq.gaffer.federatedstore.FederatedStoreProperties) Test(org.junit.jupiter.api.Test)

Aggregations

FederatedStoreProperties (uk.gov.gchq.gaffer.federatedstore.FederatedStoreProperties)11 FederatedStore (uk.gov.gchq.gaffer.federatedstore.FederatedStore)7 Graph (uk.gov.gchq.gaffer.graph.Graph)6 Context (uk.gov.gchq.gaffer.store.Context)6 Test (org.junit.jupiter.api.Test)5 Schema (uk.gov.gchq.gaffer.store.schema.Schema)5 BeforeEach (org.junit.jupiter.api.BeforeEach)4 RemoveGraph (uk.gov.gchq.gaffer.federatedstore.operation.RemoveGraph)4 GraphConfig (uk.gov.gchq.gaffer.graph.GraphConfig)4 GraphSerialisable (uk.gov.gchq.gaffer.graph.GraphSerialisable)3 User (uk.gov.gchq.gaffer.user.User)3 HashMapCacheService (uk.gov.gchq.gaffer.cache.impl.HashMapCacheService)2 Element (uk.gov.gchq.gaffer.data.element.Element)2 AddGraph (uk.gov.gchq.gaffer.federatedstore.operation.AddGraph)2 GetAllElements (uk.gov.gchq.gaffer.operation.impl.get.GetAllElements)2 ArrayList (java.util.ArrayList)1 AccessPredicate (uk.gov.gchq.gaffer.access.predicate.AccessPredicate)1 NoAccessPredicate (uk.gov.gchq.gaffer.access.predicate.NoAccessPredicate)1 CloseableIterable (uk.gov.gchq.gaffer.commonutil.iterable.CloseableIterable)1 RoadAndRoadUseWithTimesAndCardinalitiesElementGenerator (uk.gov.gchq.gaffer.doc.user.generator.RoadAndRoadUseWithTimesAndCardinalitiesElementGenerator)1