Search in sources :

Example 1 with Builder

use of uk.gov.gchq.gaffer.store.operation.add.AddStorePropertiesToLibrary.Builder in project Gaffer by gchq.

the class AddStorePropertiesToLibraryTest method setUp.

@BeforeAll
public static void setUp() throws Exception {
    storeProperties = new StoreProperties();
    op = new Builder().storeProperties(storeProperties).parentPropertiesId(VALUE_1).id(TEST_ID).build();
}
Also used : Builder(uk.gov.gchq.gaffer.store.operation.add.AddStorePropertiesToLibrary.Builder) StoreProperties(uk.gov.gchq.gaffer.store.StoreProperties) BeforeAll(org.junit.jupiter.api.BeforeAll)

Example 2 with Builder

use of uk.gov.gchq.gaffer.store.operation.add.AddStorePropertiesToLibrary.Builder in project Gaffer by gchq.

the class AddStorePropertiesToLibraryHandlerTest method shouldAddSchemaWithGraphLibrary.

@Test
public void shouldAddSchemaWithGraphLibrary() throws Exception {
    HashMapGraphLibrary library = new HashMapGraphLibrary();
    store.setGraphLibrary(library);
    store.initialise(TEST_STORE_ID, new Schema(), new StoreProperties());
    store.execute(new Builder().storeProperties(props).id(TEST_PROPS_ID).build(), new Context(StoreUser.blankUser()));
    StoreProperties actualProps = library.getProperties(TEST_PROPS_ID);
    assertEquals(props.getProperties(), actualProps.getProperties());
}
Also used : Context(uk.gov.gchq.gaffer.store.Context) HashMapGraphLibrary(uk.gov.gchq.gaffer.store.library.HashMapGraphLibrary) Schema(uk.gov.gchq.gaffer.store.schema.Schema) Builder(uk.gov.gchq.gaffer.store.operation.add.AddStorePropertiesToLibrary.Builder) StoreProperties(uk.gov.gchq.gaffer.store.StoreProperties) Test(org.junit.jupiter.api.Test)

Example 3 with Builder

use of uk.gov.gchq.gaffer.store.operation.add.AddStorePropertiesToLibrary.Builder in project Gaffer by gchq.

the class AddStorePropertiesToLibraryHandlerTest method shouldThrowWithNoGraphLibrary.

@Test
public void shouldThrowWithNoGraphLibrary() throws Exception {
    store.initialise(TEST_STORE_ID, new Schema(), new StoreProperties());
    assertThatExceptionOfType(Exception.class).isThrownBy(() -> store.execute(new Builder().storeProperties(props).id(TEST_PROPS_ID).build(), new Context(StoreUser.blankUser()))).withMessage(String.format("Operation class %s is not supported by the %s.", AddStorePropertiesToLibrary.class.getName(), TestAddToGraphLibraryImpl.class.getSimpleName()));
}
Also used : Context(uk.gov.gchq.gaffer.store.Context) Schema(uk.gov.gchq.gaffer.store.schema.Schema) Builder(uk.gov.gchq.gaffer.store.operation.add.AddStorePropertiesToLibrary.Builder) StoreProperties(uk.gov.gchq.gaffer.store.StoreProperties) Test(org.junit.jupiter.api.Test)

Aggregations

StoreProperties (uk.gov.gchq.gaffer.store.StoreProperties)3 Builder (uk.gov.gchq.gaffer.store.operation.add.AddStorePropertiesToLibrary.Builder)3 Test (org.junit.jupiter.api.Test)2 Context (uk.gov.gchq.gaffer.store.Context)2 Schema (uk.gov.gchq.gaffer.store.schema.Schema)2 BeforeAll (org.junit.jupiter.api.BeforeAll)1 HashMapGraphLibrary (uk.gov.gchq.gaffer.store.library.HashMapGraphLibrary)1