@Test void applyMergeOperation_withContradictoryStringRestrictions_shouldPreventAnyValues(){ Optional<TypedRestrictions> expected = Optional.empty(); when(stringMerger.merge((StringRestrictions)leftString, (StringRestrictions)rightString, false)) .thenReturn(Optional.empty()); Optional<TypedRestrictions> result = operation.applyMergeOperation(leftString, rightString, false); Assert.assertEquals(expected, result); verify(linearMerger, times(0)).merge(any(), any(), anyBoolean()); verify(stringMerger, times(1)).merge(any(), any(), anyBoolean()); }
public Optional<TypedRestrictions> applyMergeOperation(TypedRestrictions left, TypedRestrictions right, boolean useFinestGranularityAvailable) { return getMerger(left).merge(left, right, useFinestGranularityAvailable); }
RestrictionsMergeOperation { public Optional<TypedRestrictions> applyMergeOperation(TypedRestrictions left, TypedRestrictions right, boolean useFinestGranularityAvailable) { return getMerger(left).merge(left, right, useFinestGranularityAvailable); } }
RestrictionsMergeOperation { public Optional<TypedRestrictions> applyMergeOperation(TypedRestrictions left, TypedRestrictions right, boolean useFinestGranularityAvailable) { return getMerger(left).merge(left, right, useFinestGranularityAvailable); } RestrictionsMergeOperation(LinearRestrictionsMerger linearMerger, StringRestrictionsMerger stringMerger, BooleanRestrictionsMerger booleanMerger); }
RestrictionsMergeOperation { public Optional<TypedRestrictions> applyMergeOperation(TypedRestrictions left, TypedRestrictions right, boolean useFinestGranularityAvailable) { return getMerger(left).merge(left, right, useFinestGranularityAvailable); } RestrictionsMergeOperation(LinearRestrictionsMerger linearMerger, StringRestrictionsMerger stringMerger, BooleanRestrictionsMerger booleanMerger); Optional<TypedRestrictions> applyMergeOperation(TypedRestrictions left, TypedRestrictions right, boolean useFinestGranularityAvailable); }
RestrictionsMergeOperation { public Optional<TypedRestrictions> applyMergeOperation(TypedRestrictions left, TypedRestrictions right, boolean useFinestGranularityAvailable) { return getMerger(left).merge(left, right, useFinestGranularityAvailable); } RestrictionsMergeOperation(LinearRestrictionsMerger linearMerger, StringRestrictionsMerger stringMerger, BooleanRestrictionsMerger booleanMerger); Optional<TypedRestrictions> applyMergeOperation(TypedRestrictions left, TypedRestrictions right, boolean useFinestGranularityAvailable);  }