Skip to content

Commit

Permalink
Gh-3114: Add test for FederatedStoreSchemaOverlapTest different seria…
Browse files Browse the repository at this point in the history
…liser (#3115)
  • Loading branch information
t92549 authored Nov 27, 2023
1 parent 1ef3621 commit a0dcee3
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 a0dcee3

Please sign in to comment.