Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ public boolean isNotOptional() {
return !isOptional();
}

public boolean isNotNotted() {
return !isNotted();
}

@Override
public NottableString getLeft() {
return key;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,12 @@ static boolean containsSubset(MockServerLogger mockServerLogger, MatchDifference
}

if (result) {
long subsetNonOptionalSize = subset.stream().filter(ImmutableEntry::isNotOptional).count();
long subsetRequiredSize = subset.stream()
.filter(ImmutableEntry::isNotOptional)
.filter(ImmutableEntry::isNotNotted)
.count();
// this prevents multiple items in the subset from being matched by a single item in the superset
result = matchingIndexes.size() >= subsetNonOptionalSize;
result = matchingIndexes.size() >= subsetRequiredSize;
}
return result;
}
Expand Down