use of uk.gov.gchq.koryphe.impl.binaryoperator.StringConcat in project Gaffer by gchq.
the class TableUtilsTest method shouldFailTableValidationWhenTableDoesntHaveCoprocessor.
@Test
public void shouldFailTableValidationWhenTableDoesntHaveCoprocessor() throws Exception {
// Given
final SingleUseMiniHBaseStore store = new SingleUseMiniHBaseStore();
final Schema schema = new Schema.Builder().type(TestTypes.ID_STRING, new TypeDefinition.Builder().aggregateFunction(new StringConcat()).clazz(String.class).build()).type(TestTypes.DIRECTED_TRUE, Boolean.class).edge(TestGroups.EDGE, new SchemaEdgeDefinition.Builder().source(TestTypes.ID_STRING).destination(TestTypes.ID_STRING).directed(TestTypes.DIRECTED_TRUE).build()).build();
final HBaseProperties props = HBaseProperties.loadStoreProperties(StreamUtil.storeProps(TableUtilsTest.class));
store.initialise(GRAPH_ID, schema, props);
// Remove coprocessor
final TableName tableName = store.getTableName();
try (final Admin admin = store.getConnection().getAdmin()) {
final HTableDescriptor descriptor = admin.getTableDescriptor(tableName);
descriptor.removeCoprocessor(GafferCoprocessor.class.getName());
admin.modifyTable(tableName, descriptor);
} catch (final StoreException | IOException e) {
throw new RuntimeException(e);
}
// When / Then
assertThatExceptionOfType(StoreException.class).isThrownBy(() -> TableUtils.ensureTableExists(store)).extracting("message").isNotNull();
}
Aggregations