Skip to content
This repository was archived by the owner on Jun 6, 2025. It is now read-only.

Fixed AreIn constructor #300

Merged
merged 1 commit into from
Oct 28, 2022
Merged
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 @@ -52,6 +52,10 @@ public AreIn() {
// Required for serialisation
}

public AreIn(final Collection<?> allowedValues) {
this.allowedValues = allowedValues;
}

public AreIn(final Collection<?> allowedValues, final boolean nullOrEmptyAllowedValuesAccepted) {
this.allowedValues = allowedValues;
this.nullOrEmptyAllowedValuesAccepted = nullOrEmptyAllowedValuesAccepted;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,15 @@ public void shouldRejectWhenNotAllValuesPresentInSet() {
assertThat(filter).rejects(set);
}

@Test
public void shouldAllowSingleCollection() {
// Given
final AreIn filter = new AreIn(list);

// When / Then
assertThat(filter).accepts(list);
}

@Test
public void shouldJsonSerialiseAndDeserialise() throws IOException {
// Given
Expand Down