Skip to content

Commit 6a9f18d

Browse files
committed
review
1 parent 6ca07be commit 6a9f18d

File tree

1 file changed

+5
-4
lines changed
  • instrumentation/jdbc/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/jdbc/test

1 file changed

+5
-4
lines changed
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
import org.junit.jupiter.api.extension.RegisterExtension;
3030

3131
@SuppressWarnings("deprecation") // using deprecated semconv
32-
class DataSourceInstrumentationTest {
32+
class DruicDataSourceTest {
3333

3434
@RegisterExtension
3535
static final InstrumentationExtension testing = AgentInstrumentationExtension.create();
@@ -55,14 +55,15 @@ void tearDown() {
5555
}
5656

5757
@Test
58-
void testDruidDataSourceGetConnection() throws SQLException {
58+
void testGetConnection() throws SQLException {
59+
// In DruidDataSource we instrument both DruidPooledConnection getConnection() and the bridge
60+
// method Connection getConnection(). Here we call Connection getConnection() that delegates
61+
// to DruidPooledConnection getConnection(), and verify that only one span is created.
5962
testing.runWithSpan(
6063
"parent",
6164
() -> {
6265
try (Connection connection = dataSource.getConnection()) {
6366
return null;
64-
} catch (SQLException e) {
65-
throw new RuntimeException(e);
6667
}
6768
});
6869

0 commit comments

Comments
 (0)