|
25 | 25 | import com.mongodb.client.model.Aggregates; |
26 | 26 | import com.mongodb.client.model.ChangeStreamPreAndPostImagesOptions; |
27 | 27 | import com.mongodb.client.model.CreateCollectionOptions; |
28 | | -import com.mongodb.client.model.TimeSeriesOptions; |
29 | 28 | import com.mongodb.client.model.changestream.ChangeStreamDocument; |
30 | 29 | import com.mongodb.client.model.changestream.FullDocumentBeforeChange; |
31 | | -import com.mongodb.client.model.changestream.NamespaceType; |
32 | 30 | import com.mongodb.client.model.changestream.SplitEvent; |
33 | 31 | import com.mongodb.internal.operation.AggregateResponseBatchCursor; |
34 | 32 | import org.bson.BsonArray; |
|
46 | 44 | import static com.mongodb.client.CrudTestHelper.repeat; |
47 | 45 | import static com.mongodb.client.model.Updates.set; |
48 | 46 | import static java.util.Arrays.asList; |
49 | | -import static java.util.Collections.singletonList; |
50 | 47 | import static org.junit.jupiter.api.Assertions.assertEquals; |
51 | 48 | import static org.junit.jupiter.api.Assertions.assertNotEquals; |
52 | 49 | import static org.junit.jupiter.api.Assertions.assertNotNull; |
53 | 50 | import static org.junit.jupiter.api.Assertions.assertNull; |
54 | 51 | import static org.junit.jupiter.api.Assertions.assertTrue; |
55 | 52 | import static org.junit.jupiter.api.Assertions.fail; |
56 | | -import static org.junit.jupiter.api.Assumptions.assumeFalse; |
57 | 53 | import static org.junit.jupiter.api.Assumptions.assumeTrue; |
58 | 54 |
|
59 | 55 |
|
@@ -359,51 +355,6 @@ public void test19SplitChangeStreamEvents() { |
359 | 355 | } |
360 | 356 | } |
361 | 357 |
|
362 | | - /** |
363 | | - * Not a prose spec test. However, it is additional test case for better coverage. |
364 | | - */ |
365 | | - @Test |
366 | | - public void testNameSpaceTypePresentChangeStreamEvents() { |
367 | | - assumeTrue(serverVersionAtLeast(8, 1)); |
368 | | - // TODO-JAVA-6181 temp disabling as failing on latest, while specs are updated |
369 | | - assumeFalse(serverVersionAtLeast(9, 0)); |
370 | | - collection.drop(); |
371 | | - |
372 | | - ChangeStreamIterable<Document> changeStream = database |
373 | | - .watch() |
374 | | - .fullDocumentBeforeChange(FullDocumentBeforeChange.REQUIRED) |
375 | | - .showExpandedEvents(true); |
376 | | - |
377 | | - try (MongoChangeStreamCursor<ChangeStreamDocument<Document>> cursor = changeStream.cursor()) { |
378 | | - |
379 | | - TimeSeriesOptions timeSeriesOptions = new TimeSeriesOptions("timestampFieldName"); |
380 | | - database.createCollection( |
381 | | - "timeSeriesCollection", |
382 | | - new CreateCollectionOptions().timeSeriesOptions(timeSeriesOptions) |
383 | | - ); |
384 | | - database.createCollection( |
385 | | - getClass().getName(), |
386 | | - new CreateCollectionOptions().changeStreamPreAndPostImagesOptions( |
387 | | - new ChangeStreamPreAndPostImagesOptions(true))); |
388 | | - database.createView( |
389 | | - "view", |
390 | | - "timeSeriesCollection", |
391 | | - singletonList(Document.parse("{ $match: { field: 1 } }")) |
392 | | - ); |
393 | | - |
394 | | - ChangeStreamDocument<Document> e1 = Assertions.assertNotNull(cursor.tryNext()); |
395 | | - ChangeStreamDocument<Document> e2 = Assertions.assertNotNull(cursor.tryNext()); |
396 | | - ChangeStreamDocument<Document> e3 = Assertions.assertNotNull(cursor.tryNext()); |
397 | | - |
398 | | - assertEquals(NamespaceType.TIMESERIES, e1.getNamespaceType()); |
399 | | - assertEquals(NamespaceType.TIMESERIES.getValue(), e1.getNamespaceTypeString()); |
400 | | - assertEquals(NamespaceType.COLLECTION, e2.getNamespaceType()); |
401 | | - assertEquals(NamespaceType.COLLECTION.getValue(), e2.getNamespaceTypeString()); |
402 | | - assertEquals(NamespaceType.VIEW, e3.getNamespaceType()); |
403 | | - assertEquals(NamespaceType.VIEW.getValue(), e3.getNamespaceTypeString()); |
404 | | - } |
405 | | - } |
406 | | - |
407 | 358 | /** |
408 | 359 | * Not a prose spec test. However, it is additional test case for better coverage. |
409 | 360 | */ |
|
0 commit comments