use of uk.gov.gchq.gaffer.store.StoreProperties in project Gaffer by gchq.
the class AbstractGraphLibraryTest method shouldThrowExceptionWhenNewStorePropertiesAreAddedWithSamePropertiesIdAndDifferentProperties.
@Test
public void shouldThrowExceptionWhenNewStorePropertiesAreAddedWithSamePropertiesIdAndDifferentProperties() {
// Given
final StoreProperties tempStoreProperties = storeProperties.clone();
tempStoreProperties.set("randomKey", "randomValue");
// When
graphLibrary.addProperties(TEST_PROPERTIES_ID, storeProperties);
// Then
assertThatExceptionOfType(OverwritingException.class).isThrownBy(() -> graphLibrary.addProperties(TEST_PROPERTIES_ID, tempStoreProperties)).withMessageContaining("already exists with a different store properties");
}
use of uk.gov.gchq.gaffer.store.StoreProperties in project Gaffer by gchq.
the class AbstractGraphLibraryTest method shouldUpdateStoreProperties.
@Test
public void shouldUpdateStoreProperties() {
// Given
graphLibrary.addOrUpdateProperties(TEST_PROPERTIES_ID, storeProperties);
StoreProperties tempStoreProperties = storeProperties.clone();
tempStoreProperties.set("testKey", "testValue");
// Then
assertEquals(storeProperties.getProperties(), graphLibrary.getProperties(TEST_PROPERTIES_ID).getProperties());
// When
graphLibrary.addOrUpdateProperties(TEST_PROPERTIES_ID, tempStoreProperties);
// Then
assertEquals(tempStoreProperties.getProperties(), graphLibrary.getProperties(TEST_PROPERTIES_ID).getProperties());
}
use of uk.gov.gchq.gaffer.store.StoreProperties 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();
}
use of uk.gov.gchq.gaffer.store.StoreProperties 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());
}
use of uk.gov.gchq.gaffer.store.StoreProperties in project Gaffer by gchq.
the class AddStorePropertiesToLibraryHandlerTest method shouldNotSupportAddToGraphLibraryII.
@Test
public void shouldNotSupportAddToGraphLibraryII() throws Exception {
store.setGraphLibrary(new NoGraphLibrary());
store.initialise(TEST_STORE_ID, new Schema(), new StoreProperties());
assertFalse(store.isSupported(AddSchemaToLibrary.class));
}
Aggregations