use of dev.morphia.aggregation.experimental.stages.Sample in project morphia by mongodb.
the class CodecStructureTest method testSample.
@Test
public void testSample() {
DocumentWriter writer = new DocumentWriter(getMapper());
getDs().getCodecRegistry().get(Sample.class).encode(writer, Sample.sample(15L), EncoderContext.builder().build());
Document actual = writer.getDocument();
assertEquals(((Document) actual.get("$sample")).getLong("size").longValue(), 15L);
}
Aggregations