use of uk.gov.gchq.gaffer.federatedstore.FederatedStore in project Gaffer by gchq.
the class FederatedValidateHandlerTest method shouldDelegateToHandler.
@Test
public void shouldDelegateToHandler() throws OperationException {
// Given
final FederatedStore store = mock(FederatedStore.class);
final ValidateHandler handler = mock(ValidateHandler.class);
final Validate op = mock(Validate.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 FederatedValidateHandler federatedHandler = new FederatedValidateHandler(handler);
// When
final Object result = federatedHandler.doOperation(op, context, store);
// Then
assertSame(expectedResult, result);
verify(handler).doOperation(op, schema);
}
use of uk.gov.gchq.gaffer.federatedstore.FederatedStore in project Gaffer by gchq.
the class FederatedGetTraitsHandlerTest method setUp.
@BeforeEach
public void setUp() throws Exception {
federatedStore = new FederatedStore();
properties = new FederatedStoreProperties();
HashMapGraphLibrary.clear();
CacheServiceLoader.shutdown();
storeProperties = new StoreProperties();
storeProperties.setStoreClass(TestStoreImpl.class);
}
use of uk.gov.gchq.gaffer.federatedstore.FederatedStore in project Gaffer by gchq.
the class FederatedOperationChainValidatorTest method shouldGetFederatedSchema.
@Test
public void shouldGetFederatedSchema() {
// Given
final ViewValidator viewValidator = mock(FederatedViewValidator.class);
final FederatedOperationChainValidator validator = new FederatedOperationChainValidator(viewValidator);
final FederatedStore store = mock(FederatedStore.class);
final User user = mock(User.class);
final Operation op = mock(Operation.class);
final Schema schema = mock(Schema.class);
given(store.getSchema(op, user)).willReturn(schema);
// When
final Schema actualSchema = validator.getSchema(op, user, store);
// Then
assertSame(schema, actualSchema);
}
Aggregations