Skip to content

Commit d422065

Browse files
committed
Use simpler abort syntax
1 parent 38ee182 commit d422065

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

instrumentation/mongo/mongo-4.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/mongo/v4_0/Mongo4ReactiveClientTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import static java.util.Collections.singletonList;
99
import static java.util.concurrent.TimeUnit.SECONDS;
10+
import static org.junit.jupiter.api.Assumptions.abort;
1011

1112
import com.mongodb.MongoClientSettings;
1213
import com.mongodb.ServerAddress;
@@ -31,7 +32,6 @@
3132
import org.junit.jupiter.api.AfterAll;
3233
import org.junit.jupiter.api.BeforeAll;
3334
import org.junit.jupiter.api.extension.RegisterExtension;
34-
import org.opentest4j.TestAbortedException;
3535
import org.reactivestreams.Subscriber;
3636
import org.reactivestreams.Subscription;
3737

@@ -82,7 +82,7 @@ public void createCollectionNoDescription(String dbName, String collectionName)
8282

8383
@Override
8484
public void createCollectionWithAlreadyBuiltClientOptions(String dbName, String collectionName) {
85-
throw new TestAbortedException("not tested on 4.0");
85+
abort("not tested on 4.0");
8686
}
8787

8888
@Override
@@ -232,12 +232,12 @@ public long delete(MongoCollection<Document> collection)
232232

233233
@Override
234234
public MongoCollection<Document> setupGetMore(String dbName, String collectionName) {
235-
throw new TestAbortedException("not tested on reactive");
235+
return abort("not tested on reactive");
236236
}
237237

238238
@Override
239239
public void getMore(MongoCollection<Document> collection) {
240-
throw new TestAbortedException("not tested on reactive");
240+
abort("not tested on reactive");
241241
}
242242

243243
@Override

instrumentation/mongo/mongo-4.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/mongo/v4_0/MongoClientTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import static java.util.Arrays.asList;
99
import static java.util.Collections.singletonList;
10+
import static org.junit.jupiter.api.Assumptions.abort;
1011

1112
import com.mongodb.MongoClientSettings;
1213
import com.mongodb.ServerAddress;
@@ -26,7 +27,6 @@
2627
import org.junit.jupiter.api.AfterAll;
2728
import org.junit.jupiter.api.BeforeAll;
2829
import org.junit.jupiter.api.extension.RegisterExtension;
29-
import org.opentest4j.TestAbortedException;
3030

3131
class MongoClientTest extends AbstractMongoClientTest<MongoCollection<Document>> {
3232

@@ -66,7 +66,7 @@ public void createCollectionNoDescription(String dbName, String collectionName)
6666

6767
@Override
6868
public void createCollectionWithAlreadyBuiltClientOptions(String dbName, String collectionName) {
69-
throw new TestAbortedException("not tested on 4.0");
69+
abort("not tested on 4.0");
7070
}
7171

7272
@Override

instrumentation/mongo/mongo-async-3.3/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/mongoasync/v3_3/MongoAsyncClientTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
package io.opentelemetry.javaagent.instrumentation.mongoasync.v3_3;
77

88
import static java.util.concurrent.TimeUnit.SECONDS;
9+
import static org.junit.jupiter.api.Assumptions.abort;
910

1011
import com.mongodb.ConnectionString;
1112
import com.mongodb.async.SingleResultCallback;
@@ -29,7 +30,6 @@
2930
import org.junit.jupiter.api.AfterAll;
3031
import org.junit.jupiter.api.BeforeAll;
3132
import org.junit.jupiter.api.extension.RegisterExtension;
32-
import org.opentest4j.TestAbortedException;
3333

3434
class MongoAsyncClientTest extends AbstractMongoClientTest<MongoCollection<Document>> {
3535

@@ -210,12 +210,12 @@ public long delete(MongoCollection<Document> collection) {
210210

211211
@Override
212212
public MongoCollection<Document> setupGetMore(String dbName, String collectionName) {
213-
throw new TestAbortedException("not tested on async");
213+
return abort("not tested on async");
214214
}
215215

216216
@Override
217217
public void getMore(MongoCollection<Document> collection) {
218-
throw new TestAbortedException("not tested on async");
218+
abort("not tested on async");
219219
}
220220

221221
@Override

0 commit comments

Comments
 (0)