From 4d0e2c31d13b4a132cced41c5cb34356b9226351 Mon Sep 17 00:00:00 2001 From: Julia <5765049+sxhinzvc@users.noreply.github.com> Date: Tue, 1 Aug 2023 09:06:50 -0400 Subject: [PATCH] Use a JDK 8-compatible method in unit test Original Pull Request: #4459 --- .../AggregationOperationRendererUnitTests.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/aggregation/AggregationOperationRendererUnitTests.java b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/aggregation/AggregationOperationRendererUnitTests.java index 54b018b12..e95b17af3 100644 --- a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/aggregation/AggregationOperationRendererUnitTests.java +++ b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/aggregation/AggregationOperationRendererUnitTests.java @@ -18,7 +18,7 @@ package org.springframework.data.mongodb.core.aggregation; import static org.assertj.core.api.Assertions.*; import static org.mockito.Mockito.*; -import java.util.List; +import java.util.Arrays; import org.assertj.core.api.InstanceOfAssertFactories; import org.junit.jupiter.api.Test; @@ -27,6 +27,7 @@ import org.springframework.data.mongodb.core.aggregation.FieldsExposingAggregati /** * @author Christoph Strobl + * @author Julia Lee */ public class AggregationOperationRendererUnitTests { @@ -37,7 +38,7 @@ public class AggregationOperationRendererUnitTests { AggregationOperation stage1 = mock(AggregationOperation.class); AggregationOperation stage2 = mock(AggregationOperation.class); - AggregationOperationRenderer.toDocument(List.of(stage1, stage2), rootContext); + AggregationOperationRenderer.toDocument(Arrays.asList(stage1, stage2), rootContext); verify(stage1).toPipelineStages(eq(rootContext)); verify(stage2).toPipelineStages(eq(rootContext)); @@ -54,7 +55,7 @@ public class AggregationOperationRendererUnitTests { when(stage1.getFields()).thenReturn(stage1fields); when(stage1fields.exposesNoFields()).thenReturn(true); - AggregationOperationRenderer.toDocument(List.of(stage1, stage2), rootContext); + AggregationOperationRenderer.toDocument(Arrays.asList(stage1, stage2), rootContext); verify(stage1).toPipelineStages(eq(rootContext)); verify(stage2).toPipelineStages(eq(AggregationOperationRenderer.DEFAULT_CONTEXT)); @@ -73,7 +74,7 @@ public class AggregationOperationRendererUnitTests { ArgumentCaptor captor = ArgumentCaptor.forClass(AggregationOperationContext.class); - AggregationOperationRenderer.toDocument(List.of(stage1, stage2), rootContext); + AggregationOperationRenderer.toDocument(Arrays.asList(stage1, stage2), rootContext); verify(stage1).toPipelineStages(eq(rootContext)); verify(stage2).toPipelineStages(captor.capture()); @@ -98,7 +99,7 @@ public class AggregationOperationRendererUnitTests { ArgumentCaptor captor = ArgumentCaptor.forClass(AggregationOperationContext.class); - AggregationOperationRenderer.toDocument(List.of(stage1, stage2, stage3), rootContext); + AggregationOperationRenderer.toDocument(Arrays.asList(stage1, stage2, stage3), rootContext); verify(stage1).toPipelineStages(captor.capture()); verify(stage2).toPipelineStages(captor.capture());