use of uk.gov.gchq.gaffer.mapstore.MapStore in project Gaffer by gchq.
the class AddElementsHandlerTest method shouldAddWithNoGroupByProperties.
@Test
public void shouldAddWithNoGroupByProperties() throws OperationException, StoreException {
// Given
final AddElements addElements = mock(AddElements.class);
given(addElements.getInput()).willReturn((Iterable) Arrays.asList(new Edge("group1")));
final Context context = mock(Context.class);
final MapStore store = new SingleUseMapStore();
store.initialise("graphId1", new Schema(), new MapStoreProperties());
final AddElementsHandler handler = new AddElementsHandler();
// When / Then - should not throw NPE
handler.doOperation(addElements, context, store);
}
use of uk.gov.gchq.gaffer.mapstore.MapStore in project Gaffer by gchq.
the class ElementClonerTest method testElementCloner.
@Test
public void testElementCloner() throws StoreException {
// Given
final ElementCloner cloner = new ElementCloner();
final MapStore mapStore = new MapStore();
mapStore.initialise("graphId", GetAllElementsHandlerTest.getSchema(), new MapStoreProperties());
// Then
Streams.toStream(GetAllElementsHandlerTest.getElements()).map(element -> new Pair<>(element, cloner.cloneElement(element, mapStore.getSchema()))).forEach(pair -> assertEquals(pair.getFirst(), pair.getSecond()));
}
Aggregations