Skip to content

Commit 4d0e2c3

Browse files
committed
Use a JDK 8-compatible method in unit test
Original Pull Request: #4459
1 parent 90fe680 commit 4d0e2c3

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/aggregation/AggregationOperationRendererUnitTests.java

+6-5
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import static org.assertj.core.api.Assertions.*;
1919
import static org.mockito.Mockito.*;
2020

21-
import java.util.List;
21+
import java.util.Arrays;
2222

2323
import org.assertj.core.api.InstanceOfAssertFactories;
2424
import org.junit.jupiter.api.Test;
@@ -27,6 +27,7 @@
2727

2828
/**
2929
* @author Christoph Strobl
30+
* @author Julia Lee
3031
*/
3132
public class AggregationOperationRendererUnitTests {
3233

@@ -37,7 +38,7 @@ void nonFieldsExposingAggregationOperationContinuesWithSameContextForNextStage()
3738
AggregationOperation stage1 = mock(AggregationOperation.class);
3839
AggregationOperation stage2 = mock(AggregationOperation.class);
3940

40-
AggregationOperationRenderer.toDocument(List.of(stage1, stage2), rootContext);
41+
AggregationOperationRenderer.toDocument(Arrays.asList(stage1, stage2), rootContext);
4142

4243
verify(stage1).toPipelineStages(eq(rootContext));
4344
verify(stage2).toPipelineStages(eq(rootContext));
@@ -54,7 +55,7 @@ void fieldsExposingAggregationOperationNotExposingFieldsForcesUseOfDefaultContex
5455
when(stage1.getFields()).thenReturn(stage1fields);
5556
when(stage1fields.exposesNoFields()).thenReturn(true);
5657

57-
AggregationOperationRenderer.toDocument(List.of(stage1, stage2), rootContext);
58+
AggregationOperationRenderer.toDocument(Arrays.asList(stage1, stage2), rootContext);
5859

5960
verify(stage1).toPipelineStages(eq(rootContext));
6061
verify(stage2).toPipelineStages(eq(AggregationOperationRenderer.DEFAULT_CONTEXT));
@@ -73,7 +74,7 @@ void fieldsExposingAggregationOperationForcesNewContextForNextStage() {
7374

7475
ArgumentCaptor<AggregationOperationContext> captor = ArgumentCaptor.forClass(AggregationOperationContext.class);
7576

76-
AggregationOperationRenderer.toDocument(List.of(stage1, stage2), rootContext);
77+
AggregationOperationRenderer.toDocument(Arrays.asList(stage1, stage2), rootContext);
7778

7879
verify(stage1).toPipelineStages(eq(rootContext));
7980
verify(stage2).toPipelineStages(captor.capture());
@@ -98,7 +99,7 @@ void inheritingFieldsExposingAggregationOperationForcesNewContextForNextStageKee
9899

99100
ArgumentCaptor<AggregationOperationContext> captor = ArgumentCaptor.forClass(AggregationOperationContext.class);
100101

101-
AggregationOperationRenderer.toDocument(List.of(stage1, stage2, stage3), rootContext);
102+
AggregationOperationRenderer.toDocument(Arrays.asList(stage1, stage2, stage3), rootContext);
102103

103104
verify(stage1).toPipelineStages(captor.capture());
104105
verify(stage2).toPipelineStages(captor.capture());

0 commit comments

Comments
 (0)