Skip to content

Commit 288c8f1

Browse files
committed
Test: Improve MongoClient copy existing test
1 parent 67aab08 commit 288c8f1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/integrationTest/java/com/mongodb/kafka/connect/MongoSourceConnectorIntegrationTest.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ void testSourceLoadsDataFromMongoClientWithCopyExisting() {
110110
assumeTrue(isGreaterThanThreeDotSix());
111111
Properties sourceProperties = new Properties();
112112
sourceProperties.put(MongoSourceConfig.COPY_EXISTING_CONFIG, "true");
113-
addSourceConnector(sourceProperties);
114113

115114
MongoDatabase db1 = getDatabaseWithPostfix();
116115
MongoDatabase db2 = getDatabaseWithPostfix();
@@ -121,8 +120,12 @@ void testSourceLoadsDataFromMongoClientWithCopyExisting() {
121120
MongoCollection<Document> coll4 = db1.getCollection("db1Coll2");
122121

123122
insertMany(rangeClosed(1, 50), coll1, coll2);
123+
addSourceConnector(sourceProperties);
124+
assertAll(
125+
() -> assertProduced(createInserts(1, 50), coll1),
126+
() -> assertProduced(createInserts(1, 50), coll1));
127+
124128
db1.drop();
125-
sleep();
126129
insertMany(rangeClosed(51, 60), coll2, coll4);
127130
insertMany(rangeClosed(1, 70), coll3);
128131

0 commit comments

Comments
 (0)