use of uk.gov.gchq.koryphe.impl.predicate.IsTrue in project Gaffer by gchq.
the class FederatedOperationChainHandlerTest method createStore.
private FederatedStore createStore() throws OperationException {
final Schema schema = new Schema.Builder().entity(TestGroups.ENTITY, new SchemaEntityDefinition.Builder().vertex(TestTypes.ID_STRING).aggregate(false).build()).edge(TestGroups.EDGE, new SchemaEdgeDefinition.Builder().source(TestTypes.ID_STRING).destination(TestTypes.ID_STRING).directed(TestTypes.DIRECTED_TRUE).aggregate(false).build()).type(TestTypes.ID_STRING, new TypeDefinition.Builder().clazz(String.class).build()).type(TestTypes.DIRECTED_TRUE, new TypeDefinition.Builder().clazz(Boolean.class).validateFunctions(new IsTrue()).build()).build();
final FederatedStore store = (FederatedStore) Store.createStore("federatedGraph", schema, StoreProperties.loadStoreProperties(StreamUtil.openStream(FederatedStoreITs.class, "predefinedFederatedStore.properties")));
final Context context = new Context();
store.execute(new AddElements.Builder().input(elements).build(), context);
return store;
}
use of uk.gov.gchq.koryphe.impl.predicate.IsTrue in project Gaffer by gchq.
the class FederatedStoreUtilTest method createGraph.
protected Graph createGraph() {
final Store store = mock(Store.class);
final Schema schema = new Schema.Builder().entity(TestGroups.ENTITY, new SchemaEntityDefinition.Builder().vertex(TestTypes.ID_STRING).aggregate(false).build()).edge(TestGroups.EDGE, new SchemaEdgeDefinition.Builder().source(TestTypes.ID_STRING).destination(TestTypes.ID_STRING).directed(TestTypes.DIRECTED_TRUE).aggregate(false).build()).type(TestTypes.ID_STRING, new TypeDefinition.Builder().clazz(String.class).build()).type(TestTypes.DIRECTED_TRUE, new TypeDefinition.Builder().clazz(Boolean.class).validateFunctions(new IsTrue()).build()).build();
given(store.getSchema()).willReturn(schema);
given(store.getOriginalSchema()).willReturn(schema);
StoreProperties storeProperties = new StoreProperties();
given(store.getProperties()).willReturn(storeProperties);
return new Graph.Builder().config(new GraphConfig.Builder().graphId("graphId").build()).store(store).build();
}
Aggregations