Fix input snapshotting error when using test clusters cliSetup (#52340)
This commit is contained in:
parent
0d7165a40b
commit
c61124a7b9
|
@ -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");
|
||||
}
|
||||
|
|
|
@ -1188,7 +1188,7 @@ public class ElasticsearchNode implements TestClusterConfiguration {
|
|||
|
||||
@Nested
|
||||
public List<?> getCliSetup() {
|
||||
return cliSetup.getNormalizedCollection();
|
||||
return cliSetup.getFlatNormalizedCollection();
|
||||
}
|
||||
|
||||
@Nested
|
||||
|
|
Loading…
Reference in New Issue