Search in sources :

Example 1 with Builder

use of uk.gov.gchq.gaffer.federatedstore.operation.AddGraph.Builder in project Gaffer by gchq.

the class AddGraphTest method shouldShallowCloneOperationWithNulls.

@Test
public void shouldShallowCloneOperationWithNulls() {
    final AddGraph a = new Builder().graphId(null).parentPropertiesId(null).parentSchemaIds(null).schema(null).graphAuths(null).storeProperties(null).readAccessPredicate(READ_ACCESS_PREDICATE).writeAccessPredicate(WRITE_ACCESS_PREDICATE).build();
    final AddGraph b = a.shallowClone();
    assertEquals(a.getGraphId(), b.getGraphId());
    assertEquals(a.getStoreProperties(), b.getStoreProperties());
    assertEquals(a.getSchema(), b.getSchema());
    assertEquals(a.getGraphAuths(), b.getGraphAuths());
    assertEquals(a.getReadAccessPredicate(), b.getReadAccessPredicate());
    assertEquals(a.getWriteAccessPredicate(), b.getWriteAccessPredicate());
}
Also used : Builder(uk.gov.gchq.gaffer.federatedstore.operation.AddGraph.Builder) OperationTest(uk.gov.gchq.gaffer.operation.OperationTest) Test(org.junit.jupiter.api.Test)

Example 2 with Builder

use of uk.gov.gchq.gaffer.federatedstore.operation.AddGraph.Builder in project Gaffer by gchq.

the class AddGraphTest method shouldShallowCloneOperation.

@Test
@Override
public void shouldShallowCloneOperation() {
    final AddGraph a = new Builder().graphId("graphId").parentPropertiesId("testPropID").parentSchemaIds(Lists.newArrayList("testSchemaID")).schema(new Schema.Builder().build()).graphAuths("testAuth").storeProperties(new StoreProperties()).readAccessPredicate(READ_ACCESS_PREDICATE).writeAccessPredicate(WRITE_ACCESS_PREDICATE).build();
    final AddGraph b = a.shallowClone();
    assertEquals(a.getGraphId(), b.getGraphId());
    assertEquals(a.getStoreProperties(), b.getStoreProperties());
    assertEquals(a.getSchema(), b.getSchema());
    assertEquals(a.getGraphAuths(), b.getGraphAuths());
    assertEquals(a.getReadAccessPredicate(), b.getReadAccessPredicate());
    assertEquals(a.getWriteAccessPredicate(), b.getWriteAccessPredicate());
}
Also used : Builder(uk.gov.gchq.gaffer.federatedstore.operation.AddGraph.Builder) Schema(uk.gov.gchq.gaffer.store.schema.Schema) StoreProperties(uk.gov.gchq.gaffer.store.StoreProperties) OperationTest(uk.gov.gchq.gaffer.operation.OperationTest) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)2 Builder (uk.gov.gchq.gaffer.federatedstore.operation.AddGraph.Builder)2 OperationTest (uk.gov.gchq.gaffer.operation.OperationTest)2 StoreProperties (uk.gov.gchq.gaffer.store.StoreProperties)1 Schema (uk.gov.gchq.gaffer.store.schema.Schema)1