Skip to content

Commit 29d4207

Browse files
committed
fix mock expectations accounting for new code
1 parent 9517c13 commit 29d4207

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/src/test/groovy/server/RouteHandlerWrapperTest.groovy

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@ class RouteHandlerWrapperTest extends InstrumentationSpecification {
2121
1 * context.get("dd.${Tags.HTTP_ROUTE}") >> null
2222
1 * context.put("dd.${Tags.HTTP_ROUTE}", "/items/:id")
2323
1 * parentSpan.setTag(Tags.HTTP_ROUTE, "/items/:id")
24+
1 * parentSpan.setResourceName("GET /items/:id", _)
2425
1 * handlerSpan.getSpanName() >> "vertx.route-handler"
2526
1 * handlerSpan.getResourceNamePriority() >> Byte.MIN_VALUE
2627
1 * handlerSpan.setTag(Tags.HTTP_ROUTE, "/items/:id")
28+
1 * handlerSpan.setResourceName("GET /items/:id", _)
2729
0 * _
2830
}
2931

@@ -40,6 +42,7 @@ class RouteHandlerWrapperTest extends InstrumentationSpecification {
4042
1 * context.get("dd.${Tags.HTTP_ROUTE}") >> null
4143
1 * context.put("dd.${Tags.HTTP_ROUTE}", "/items/:id")
4244
1 * parentSpan.setTag(Tags.HTTP_ROUTE, "/items/:id")
45+
1 * parentSpan.setResourceName("GET /items/:id", _)
4346
1 * handlerSpan.getSpanName() >> "some.other.span"
4447
0 * handlerSpan.setTag(_, _)
4548
0 * _
@@ -57,7 +60,6 @@ class RouteHandlerWrapperTest extends InstrumentationSpecification {
5760
then:
5861
1 * context.get("dd.${Tags.HTTP_ROUTE}") >> null
5962
1 * parentSpan.getTag(Tags.HTTP_ROUTE) >> "/existing"
60-
1 * handlerSpan.getTag(Tags.HTTP_ROUTE) >> "/existing"
6163
0 * context.put(_, _)
6264
0 * parentSpan.setTag(_, _)
6365
0 * handlerSpan.setTag(_, _)

dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/test/groovy/server/RouteHandlerWrapperTest.groovy

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@ class RouteHandlerWrapperTest extends InstrumentationSpecification {
2121
1 * context.get("dd.${Tags.HTTP_ROUTE}") >> null
2222
1 * context.put("dd.${Tags.HTTP_ROUTE}", "/items/:id")
2323
1 * parentSpan.setTag(Tags.HTTP_ROUTE, "/items/:id")
24+
1 * parentSpan.setResourceName("GET /items/:id", _)
2425
1 * handlerSpan.getSpanName() >> "vertx.route-handler"
2526
1 * handlerSpan.getResourceNamePriority() >> Byte.MIN_VALUE
2627
1 * handlerSpan.setTag(Tags.HTTP_ROUTE, "/items/:id")
28+
1 * handlerSpan.setResourceName("GET /items/:id", _)
2729
0 * _
2830
}
2931

@@ -40,6 +42,7 @@ class RouteHandlerWrapperTest extends InstrumentationSpecification {
4042
1 * context.get("dd.${Tags.HTTP_ROUTE}") >> null
4143
1 * context.put("dd.${Tags.HTTP_ROUTE}", "/items/:id")
4244
1 * parentSpan.setTag(Tags.HTTP_ROUTE, "/items/:id")
45+
1 * parentSpan.setResourceName("GET /items/:id", _)
4346
1 * handlerSpan.getSpanName() >> "some.other.span"
4447
0 * handlerSpan.setTag(_, _)
4548
0 * _
@@ -57,7 +60,6 @@ class RouteHandlerWrapperTest extends InstrumentationSpecification {
5760
then:
5861
1 * context.get("dd.${Tags.HTTP_ROUTE}") >> null
5962
1 * parentSpan.getTag(Tags.HTTP_ROUTE) >> "/existing"
60-
1 * handlerSpan.getTag(Tags.HTTP_ROUTE) >> "/existing"
6163
0 * context.put(_, _)
6264
0 * parentSpan.setTag(_, _)
6365
0 * handlerSpan.setTag(_, _)

0 commit comments

Comments
 (0)