Skip to content

Commit

Permalink
Fix input snapshotting error when using test clusters cliSetup (#52340)
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-vieira committed Feb 13, 2020
1 parent ad01f07 commit 7a1ca67
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,23 @@ public List<T> subList(int fromIndex, int toIndex) {
}

@Override
public List<? extends Object> getNormalizedCollection() {
public List<? extends PropertyListEntry<T>> getNormalizedCollection() {
return delegate.stream()
.peek(this::validate)
.filter(entry -> entry.getNormalization() != PropertyNormalization.IGNORE_VALUE)
.collect(Collectors.toList());
}

/**
* Return a "flattened" collection. This should be used when the collection type is itself a complex type with properties
* annotated as Gradle inputs rather than a simple type like {@link String}.
*
* @return a flattened collection filtered according to normalization strategy
*/
public List<? extends T> getFlatNormalizedCollection() {
return getNormalizedCollection().stream().map(PropertyListEntry::getValue).collect(Collectors.toList());
}

private void validate(PropertyListEntry<T> entry) {
assertNotNull(entry.getValue(), "entry");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,7 @@ public List<?> getKeystoreFiles() {

@Nested
public List<?> getCliSetup() {
return cliSetup.getNormalizedCollection();
return cliSetup.getFlatNormalizedCollection();
}

@Nested
Expand Down

0 comments on commit 7a1ca67

Please sign in to comment.