use of uk.gov.gchq.gaffer.mapstore.MapStoreProperties in project Gaffer by gchq.
the class JobControllerIT method setupGraph.
@Before
public void setupGraph() {
StoreProperties properties = new MapStoreProperties();
properties.setStoreClass(SingleUseMapStore.class);
properties.setJobTrackerEnabled(true);
properties.set(CACHE_SERVICE_CLASS, HashMapCacheService.class.getName());
properties.set(OPERATION_DECLARATIONS, "ResultCacheExportOperations.json");
Graph graph = new Graph.Builder().config(new GraphConfig("myGraph")).storeProperties(properties).addSchema(Schema.fromJson(StreamUtil.schema(JobControllerIT.class))).build();
when(graphFactory.getGraph()).thenReturn(graph);
}
use of uk.gov.gchq.gaffer.mapstore.MapStoreProperties in project Gaffer by gchq.
the class ProxyStoreIT method setUpGraph.
@Before
public void setUpGraph() {
delegateRestApiGraph = new Graph.Builder().storeProperties(new MapStoreProperties()).config(new GraphConfig("myGraph")).addSchema(Schema.fromJson(StreamUtil.openStream(getClass(), "/schema/schema.json"))).build();
when(graphFactory.getGraph()).thenReturn(delegateRestApiGraph);
}
use of uk.gov.gchq.gaffer.mapstore.MapStoreProperties in project Gaffer by gchq.
the class GraphConfigurationControllerIT method shouldReturn200WithAllStoreTraits.
@Test
public void shouldReturn200WithAllStoreTraits() {
// Given
Graph emptyGraph = new Graph.Builder().config(new GraphConfig.Builder().graphId("id").build()).storeProperties(new MapStoreProperties()).addSchema(new Schema()).build();
when(graphFactory.getGraph()).thenReturn(emptyGraph);
// When
ResponseEntity<Set> response = get("/graph/config/storeTraits", Set.class);
// The response will come back as a Set of strings. We'll convert these to store traits
Set<StoreTrait> responseTraits = new HashSet<>();
response.getBody().forEach(trait -> responseTraits.add(StoreTrait.valueOf((String) trait)));
// Then
checkResponse(response, 200);
assertThat(responseTraits).isEqualTo(MapStore.TRAITS);
}
use of uk.gov.gchq.gaffer.mapstore.MapStoreProperties in project Gaffer by gchq.
the class GraphConfigurationControllerIT method shouldReturn200WithListOfAllObjectGenerators.
@Test
public void shouldReturn200WithListOfAllObjectGenerators() {
// Given
Graph emptyGraph = new Graph.Builder().config(new GraphConfig.Builder().graphId("id").build()).storeProperties(new MapStoreProperties()).addSchema(new Schema()).build();
when(graphFactory.getGraph()).thenReturn(emptyGraph);
// When
ResponseEntity<Set> response = get("/graph/config/objectGenerators", Set.class);
// Then
checkResponse(response, 200);
}
use of uk.gov.gchq.gaffer.mapstore.MapStoreProperties in project Gaffer by gchq.
the class GraphConfigurationControllerIT method shouldReturn500WhenANonExistentClassIsProvidedForGetSerialiseFields.
@Test
public void shouldReturn500WhenANonExistentClassIsProvidedForGetSerialiseFields() {
// Given
Graph emptyGraph = new Graph.Builder().config(new GraphConfig.Builder().graphId("id").build()).storeProperties(new MapStoreProperties()).addSchema(new Schema()).build();
when(graphFactory.getGraph()).thenReturn(emptyGraph);
// When
ResponseEntity<Error> response = get("/graph/config/serialisedFields/a.random.class", Error.class);
// Then
checkResponse(response, 500);
assertThat(response.getBody().getSimpleMessage()).isEqualTo("Class name was not recognised: a.random.class");
}
Aggregations