use of uk.gov.gchq.gaffer.hbasestore.retriever.HBaseRetriever in project Gaffer by gchq.
the class GetElementsHandlerTest method shouldReturnHBaseRetrieverWithIncludeMatchedVertexWhenSeedMatchingIsNull.
@Test
public void shouldReturnHBaseRetrieverWithIncludeMatchedVertexWhenSeedMatchingIsNull() throws OperationException, StoreException {
// Given
final Iterable<EntityId> ids = mock(Iterable.class);
final Context context = mock(Context.class);
final User user = mock(User.class);
final HBaseStore store = mock(HBaseStore.class);
final HBaseRetriever<GetElements> hbaseRetriever = mock(HBaseRetriever.class);
final GetElementsHandler handler = new GetElementsHandler();
final GetElements getElements = new GetElements.Builder().inputIds(ids).seedMatching(null).build();
given(context.getUser()).willReturn(user);
given(store.createRetriever(getElements, user, ids, true)).willReturn(hbaseRetriever);
// When
final HBaseRetriever<GetElements> result = (HBaseRetriever<GetElements>) handler.doOperation(getElements, context, store);
// Then
assertSame(hbaseRetriever, result);
}
use of uk.gov.gchq.gaffer.hbasestore.retriever.HBaseRetriever in project Gaffer by gchq.
the class GetElementsHandlerTest method shouldReturnHBaseRetrieverWithoutIncludeMatchdxVertex.
@Test
public void shouldReturnHBaseRetrieverWithoutIncludeMatchdxVertex() throws OperationException, StoreException {
// Given
final Iterable<EntityId> ids = mock(Iterable.class);
final Context context = mock(Context.class);
final User user = mock(User.class);
final HBaseStore store = mock(HBaseStore.class);
final HBaseRetriever<GetElements> hbaseRetriever = mock(HBaseRetriever.class);
final GetElementsHandler handler = new GetElementsHandler();
final GetElements getElements = new GetElements.Builder().inputIds(ids).seedMatching(SeedMatching.SeedMatchingType.EQUAL).build();
given(context.getUser()).willReturn(user);
given(store.createRetriever(getElements, user, ids, false)).willReturn(hbaseRetriever);
// When
final HBaseRetriever<GetElements> result = (HBaseRetriever<GetElements>) handler.doOperation(getElements, context, store);
// Then
assertSame(hbaseRetriever, result);
}
use of uk.gov.gchq.gaffer.hbasestore.retriever.HBaseRetriever in project Gaffer by gchq.
the class GetElementsHandlerTest method shouldReturnHBaseRetrieverWithIncludeMatchedVertex.
@Test
public void shouldReturnHBaseRetrieverWithIncludeMatchedVertex() throws OperationException, StoreException {
// Given
final Iterable<EntityId> ids = mock(Iterable.class);
final Context context = mock(Context.class);
final User user = mock(User.class);
final HBaseStore store = mock(HBaseStore.class);
final HBaseRetriever<GetElements> hbaseRetriever = mock(HBaseRetriever.class);
final GetElementsHandler handler = new GetElementsHandler();
final GetElements getElements = new GetElements.Builder().inputIds(ids).seedMatching(SeedMatching.SeedMatchingType.RELATED).build();
given(context.getUser()).willReturn(user);
given(store.createRetriever(getElements, user, ids, true)).willReturn(hbaseRetriever);
// When
final HBaseRetriever<GetElements> result = (HBaseRetriever<GetElements>) handler.doOperation(getElements, context, store);
// Then
assertSame(hbaseRetriever, result);
}
use of uk.gov.gchq.gaffer.hbasestore.retriever.HBaseRetriever in project Gaffer by gchq.
the class GetAllElementsHandlerTest method shouldReturnHBaseRetriever.
@Test
public void shouldReturnHBaseRetriever() throws OperationException, StoreException {
// Given
final Context context = mock(Context.class);
final User user = mock(User.class);
final HBaseStore store = mock(HBaseStore.class);
final HBaseRetriever<GetAllElements> hbaseRetriever = mock(HBaseRetriever.class);
final GetAllElementsHandler handler = new GetAllElementsHandler();
final GetAllElements getElements = new GetAllElements();
given(context.getUser()).willReturn(user);
given(store.createRetriever(getElements, user, null, false, ElementDedupeFilterProcessor.class)).willReturn(hbaseRetriever);
// When
final HBaseRetriever<GetAllElements> result = (HBaseRetriever<GetAllElements>) handler.doOperation(getElements, context, store);
// Then
assertSame(hbaseRetriever, result);
}
Aggregations