1 package com.griddynamics.jagger.user.test.configurations;
3 import com.griddynamics.jagger.user.test.configurations.auxiliary.Id;
5 import java.util.ArrayList;
6 import java.util.Collections;
8 import java.util.Objects;
29 private final String id;
30 private final List<JParallelTestsGroup> testGroups;
31 private final List<Double> percentileValues;
34 this.
id = builder.id.
value();
35 this.testGroups = builder.testGroups;
36 this.percentileValues = builder.percentileValues;
47 return new Builder(
id, testGroups);
59 List<JParallelTestsGroup> jParallelTestsGroupList =
new ArrayList<>();
60 jParallelTestsGroupList.add(testGroup);
61 Collections.addAll(jParallelTestsGroupList, testGroups);
63 return new Builder(
id, jParallelTestsGroupList);
68 private final List<JParallelTestsGroup> testGroups;
69 private List<Double> percentileValues;
70 public Builder(
Id id, List<JParallelTestsGroup> testGroups) {
72 this.testGroups = testGroups;
80 Objects.requireNonNull(percentileValues);
81 percentileValues.stream().filter(percentile -> percentile <= 0.0 || percentile >= 100.0)
83 .ifPresent(badPercentile -> {
84 throw new IllegalArgumentException(
"Percentile value must be > 0 and < 100. Provided value is " + badPercentile);
87 this.percentileValues = percentileValues;
111 return percentileValues;