Search in sources :

Example 6 with AddNamedView

use of uk.gov.gchq.gaffer.named.view.AddNamedView in project Gaffer by gchq.

the class AddNamedViewHandlerTest method shouldNotAddNestedNamedView.

@Test
public void shouldNotAddNestedNamedView() throws OperationException {
    final NamedView nestedNamedView = new NamedView.Builder().name(testNamedViewName + 1).edge(TestGroups.EDGE).build();
    addNamedView = new AddNamedView.Builder().name(testNamedViewName).view(nestedNamedView).overwrite(false).build();
    try {
        handler.doOperation(addNamedView, context, store);
    } catch (final OperationException e) {
        assertTrue(e.getMessage().equals("NamedView can not be nested within NamedView"));
    }
}
Also used : NamedView(uk.gov.gchq.gaffer.data.elementdefinition.view.NamedView) AddNamedView(uk.gov.gchq.gaffer.named.view.AddNamedView) AddNamedView(uk.gov.gchq.gaffer.named.view.AddNamedView) OperationException(uk.gov.gchq.gaffer.operation.OperationException) Test(org.junit.jupiter.api.Test)

Example 7 with AddNamedView

use of uk.gov.gchq.gaffer.named.view.AddNamedView in project Gaffer by gchq.

the class AddNamedViewHandlerTest method before.

@BeforeEach
public void before() {
    testParameters.put("testParam", TEST_PARAM_VALUE);
    view = new View.Builder().edge(TestGroups.EDGE).build();
    addNamedView = new AddNamedView.Builder().name(testNamedViewName).view(view).overwrite(false).writeAccessRoles(writeAccessRoles).build();
    StoreProperties properties = new StoreProperties();
    properties.set("gaffer.cache.service.class", "uk.gov.gchq.gaffer.cache.impl.HashMapCacheService");
    CacheServiceLoader.initialise(properties.getProperties());
    given(store.getProperties()).willReturn(new StoreProperties());
}
Also used : StoreProperties(uk.gov.gchq.gaffer.store.StoreProperties) NamedView(uk.gov.gchq.gaffer.data.elementdefinition.view.NamedView) View(uk.gov.gchq.gaffer.data.elementdefinition.view.View) AddNamedView(uk.gov.gchq.gaffer.named.view.AddNamedView) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

AddNamedView (uk.gov.gchq.gaffer.named.view.AddNamedView)7 NamedView (uk.gov.gchq.gaffer.data.elementdefinition.view.NamedView)4 View (uk.gov.gchq.gaffer.data.elementdefinition.view.View)4 ViewParameterDetail (uk.gov.gchq.gaffer.data.elementdefinition.view.ViewParameterDetail)3 DeleteNamedView (uk.gov.gchq.gaffer.named.view.DeleteNamedView)3 OperationException (uk.gov.gchq.gaffer.operation.OperationException)3 BeforeEach (org.junit.jupiter.api.BeforeEach)2 EntitySeed (uk.gov.gchq.gaffer.operation.data.EntitySeed)2 AddElements (uk.gov.gchq.gaffer.operation.impl.add.AddElements)2 StoreProperties (uk.gov.gchq.gaffer.store.StoreProperties)2 Test (org.junit.Test)1 Test (org.junit.jupiter.api.Test)1 CloseableIterable (uk.gov.gchq.gaffer.commonutil.iterable.CloseableIterable)1 Edge (uk.gov.gchq.gaffer.data.element.Edge)1 Element (uk.gov.gchq.gaffer.data.element.Element)1 ElementFilter (uk.gov.gchq.gaffer.data.element.function.ElementFilter)1 EntityId (uk.gov.gchq.gaffer.data.element.id.EntityId)1 NamedViewDetail (uk.gov.gchq.gaffer.data.elementdefinition.view.NamedViewDetail)1 ViewElementDefinition (uk.gov.gchq.gaffer.data.elementdefinition.view.ViewElementDefinition)1 RoadAndRoadUseWithTimesAndCardinalitiesElementGenerator (uk.gov.gchq.gaffer.doc.user.generator.RoadAndRoadUseWithTimesAndCardinalitiesElementGenerator)1