Skip to content

Commit cb60aac

Browse files
Remove temporary test method.
Original pull request: #4720
1 parent 6377d46 commit cb60aac

File tree

1 file changed

+3
-38
lines changed

1 file changed

+3
-38
lines changed

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

+3-38
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,14 @@
1515
*/
1616
package org.springframework.data.mongodb.core.aggregation;
1717

18-
import static org.mockito.Mockito.*;
19-
import static org.springframework.data.domain.Sort.Direction.*;
20-
import static org.springframework.data.mongodb.core.aggregation.Aggregation.*;
18+
import static org.mockito.Mockito.eq;
19+
import static org.mockito.Mockito.mock;
20+
import static org.mockito.Mockito.verify;
2121

2222
import java.util.List;
2323

2424
import org.junit.jupiter.api.Test;
2525

26-
import org.springframework.data.annotation.Id;
27-
import org.springframework.data.mongodb.core.convert.MappingMongoConverter;
28-
import org.springframework.data.mongodb.core.convert.NoOpDbRefResolver;
29-
import org.springframework.data.mongodb.core.convert.QueryMapper;
30-
import org.springframework.data.mongodb.test.util.MongoTestMappingContext;
31-
3226
/**
3327
* @author Christoph Strobl
3428
*/
@@ -46,33 +40,4 @@ void nonFieldsExposingAggregationOperationContinuesWithSameContextForNextStage()
4640
verify(stage1).toPipelineStages(eq(rootContext));
4741
verify(stage2).toPipelineStages(eq(rootContext));
4842
}
49-
50-
record TestRecord(@Id String field1, String field2, LayerOne layerOne) {
51-
record LayerOne(List<LayerTwo> layerTwo) {
52-
}
53-
54-
record LayerTwo(LayerThree layerThree) {
55-
}
56-
57-
record LayerThree(int fieldA, int fieldB)
58-
{}
59-
}
60-
61-
@Test
62-
void xxx() {
63-
64-
MongoTestMappingContext ctx = new MongoTestMappingContext(cfg -> {
65-
cfg.initialEntitySet(TestRecord.class);
66-
});
67-
68-
MappingMongoConverter mongoConverter = new MappingMongoConverter(NoOpDbRefResolver.INSTANCE, ctx);
69-
70-
Aggregation agg = Aggregation.newAggregation(
71-
Aggregation.unwind("layerOne.layerTwo"),
72-
project().and("layerOne.layerTwo.layerThree").as("layerOne.layerThree"),
73-
sort(DESC, "layerOne.layerThree.fieldA")
74-
);
75-
76-
AggregationOperationRenderer.toDocument(agg.getPipeline().getOperations(), new RelaxedTypeBasedAggregationOperationContext(TestRecord.class, ctx, new QueryMapper(mongoConverter)));
77-
}
7843
}

0 commit comments

Comments
 (0)