Fix input snapshotting error when using test clusters cliSetup (#52340)

This commit is contained in:
Mark Vieira 2020-02-13 14:23:51 -08:00
parent 0d7165a40b
commit c61124a7b9
No known key found for this signature in database
GPG Key ID: CA947EF7E6D4B105
2 changed files with 12 additions and 2 deletions

View File

@ -170,13 +170,23 @@ public class LazyPropertyList<T> extends AbstractLazyPropertyCollection implemen
}
@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");
}

View File

@ -1188,7 +1188,7 @@ public class ElasticsearchNode implements TestClusterConfiguration {
@Nested
public List<?> getCliSetup() {
return cliSetup.getNormalizedCollection();
return cliSetup.getFlatNormalizedCollection();
}
@Nested