Skip to content

Commit

Permalink
Merge branch 'develop' into gh-3108-improve-testing-for-gafferpopvert…
Browse files Browse the repository at this point in the history
…exproperty
  • Loading branch information
t92549 authored Nov 27, 2023
2 parents 56b7f69 + a0dcee3 commit b56f27f
Showing 1 changed file with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import uk.gov.gchq.gaffer.serialisation.implementation.MultiSerialiser;
import uk.gov.gchq.gaffer.serialisation.implementation.StringSerialiser;
import uk.gov.gchq.gaffer.serialisation.implementation.ordered.OrderedIntegerSerialiser;
import uk.gov.gchq.gaffer.serialisation.implementation.raw.CompactRawIntegerSerialiser;
import uk.gov.gchq.gaffer.store.Context;
import uk.gov.gchq.gaffer.store.TestTypes;
import uk.gov.gchq.gaffer.store.operation.GetSchema;
Expand Down Expand Up @@ -318,6 +319,30 @@ public void shouldRetainGroupGroupByWhenConflictingSchemasMerge() throws Operati
.isNotEqualTo(graphBSchema.toString());
}

@Test
public void shouldErrorAtTypeDefinitionSerialiserWhenConflictingDuringSchemasMerge() throws OperationException {
// Given
addGraphWith(GRAPH_ID_A, GRAPH_A_SCHEMA);
final Schema graphBSchema = new Schema.Builder()
.merge(GRAPH_A_SCHEMA)
.type(INTEGER, new TypeDefinition.Builder()
.clazz(Integer.class)
.serialiser(new CompactRawIntegerSerialiser())
.aggregateFunction(new Sum())
.validateFunctions(new IsLessThan(10))
.build())
.build();
addGraphWith(GRAPH_ID_B, graphBSchema);

// When
assertThatException()
.isThrownBy(() -> federatedStore.execute(new GetSchema.Builder().build(), testContext))
.withStackTraceContaining("Error with the schema type named:integer")
.withStackTraceContaining("Unable to merge schemas because of conflict with the type serialiser")
.withStackTraceContaining("options are: uk.gov.gchq.gaffer.serialisation.implementation.raw.CompactRawIntegerSerialiser")
.withStackTraceContaining("and uk.gov.gchq.gaffer.serialisation.implementation.ordered.OrderedIntegerSerialiser");
}

@Test
public void shouldErrorAtTypeDefinitionAggregationFunctionWhenConflictingDuringSchemasMerge() throws OperationException {
// Given
Expand Down

0 comments on commit b56f27f

Please sign in to comment.