Skip to content

Commit

Permalink
Changed Collections.singletonList to ArrayList to avoid UnsupportedOp…
Browse files Browse the repository at this point in the history
…erationException

Signed-off-by: Nathalie Jonathan <nathhjo@amazon.com>
  • Loading branch information
nathaliellenaa committed Jan 29, 2025
1 parent 7dc5548 commit d90e6e9
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import static org.opensearch.ml.utils.TestHelper.getMetricsCorrelationRestRequest;

import java.io.IOException;
import java.util.Collections;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -385,7 +385,9 @@ public void testAnomalyLocalizationExecutionResponse() throws Exception {
bucket1.setOverallAggValue(65.0);

Result result = new Result();
result.setBuckets(Collections.singletonList(bucket1));
List<Bucket> buckets = new ArrayList<>();
buckets.add(bucket1);
result.setBuckets(buckets);

AnomalyLocalizationOutput output = new AnomalyLocalizationOutput();
Map<String, Result> results = new HashMap<>();
Expand Down

0 comments on commit d90e6e9

Please sign in to comment.