use of uk.gov.gchq.gaffer.federatedstore.operation.handler.FederatedTransformHandler in project Gaffer by gchq.
the class FederatedStore method addAdditionalOperationHandlers.
@Override
protected void addAdditionalOperationHandlers() {
// Override the Operations that don't have an output
getSupportedOperations().stream().filter(op -> !Output.class.isAssignableFrom(op) && !AddElements.class.equals(op) && !AddNamedOperation.class.equals(op) && !AddNamedView.class.equals(op)).forEach(op -> addOperationHandler(op, new FederatedOperationHandler()));
addOperationHandler(GetSchema.class, new FederatedGetSchemaHandler());
addOperationHandler(Filter.class, new FederatedFilterHandler());
addOperationHandler(Aggregate.class, new FederatedAggregateHandler());
addOperationHandler(Transform.class, new FederatedTransformHandler());
addOperationHandler(Validate.class, new FederatedValidateHandler());
addOperationHandler(GetAllGraphIds.class, new FederatedGetAllGraphIDHandler());
addOperationHandler(AddGraph.class, new FederatedAddGraphHandler());
addOperationHandler(AddGraphWithHooks.class, new FederatedAddGraphWithHooksHandler());
addOperationHandler(RemoveGraph.class, new FederatedRemoveGraphHandler());
addOperationHandler(FederatedOperationChain.class, new FederatedOperationChainHandler());
addOperationHandler(GetTraits.class, new FederatedGetTraitsHandler());
addOperationHandler(GetAllGraphInfo.class, new FederatedGetAllGraphInfoHandler());
addOperationHandler(ChangeGraphAccess.class, new FederatedChangeGraphAccessHandler());
addOperationHandler(ChangeGraphId.class, new FederatedChangeGraphIdHandler());
}
use of uk.gov.gchq.gaffer.federatedstore.operation.handler.FederatedTransformHandler in project Gaffer by gchq.
the class FederatedTransformHandlerTest method shouldDelegateToHandler.
@Test
public void shouldDelegateToHandler() throws OperationException {
// Given
final FederatedStore store = mock(FederatedStore.class);
final TransformHandler handler = mock(TransformHandler.class);
final Transform op = mock(Transform.class);
final Context context = mock(Context.class);
final Iterable expectedResult = mock(Iterable.class);
final Schema schema = mock(Schema.class);
given(store.getSchema(op, context)).willReturn(schema);
given(handler.doOperation(op, schema)).willReturn(expectedResult);
final FederatedTransformHandler federatedHandler = new FederatedTransformHandler(handler);
// When
final Object result = federatedHandler.doOperation(op, context, store);
// Then
assertSame(expectedResult, result);
verify(handler).doOperation(op, schema);
}
Aggregations