Skip to content

Commit b65591d

Browse files
committed
Remove local variable definition
Signed-off-by: xiepuhuan <[email protected]>
1 parent ad90b35 commit b65591d

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

instrumentation/mongo/mongo-3.1/testing/src/main/java/io/opentelemetry/instrumentation/mongo/v3_1/AbstractMongo31ClientTest.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -213,14 +213,11 @@ void testClientFailure() {
213213
MongoClientOptions options = MongoClientOptions.builder().serverSelectionTimeout(10).build();
214214
MongoClient client = new MongoClient(new ServerAddress(host, PortUtils.UNUSABLE_PORT), options);
215215

216-
String dbName = "test_db";
217-
String collectionName = createCollectionName();
218-
219216
assertThatExceptionOfType(MongoTimeoutException.class)
220217
.isThrownBy(
221218
() -> {
222-
MongoDatabase db = client.getDatabase(dbName);
223-
db.createCollection(collectionName);
219+
MongoDatabase db = client.getDatabase("test_db");
220+
db.createCollection(createCollectionName());
224221
});
225222
// Unfortunately not caught by our instrumentation.
226223
testing().waitAndAssertTraces();

0 commit comments

Comments
 (0)