use of com.newrelic.agent.introspec.Introspector in project newrelic-java-agent by newrelic.
the class SprayHttpRoutesTest method testLongNumberFutureRoute.
@Test
public void testLongNumberFutureRoute() {
given().baseUri("http://localhost:" + server.getPort()).when().get("/longfuture/1337").then().body(containsString("LongNumberFuture: 1337"));
Introspector introspector = InstrumentationTestRunner.getIntrospector();
Assert.assertEquals(1, introspector.getFinishedTransactionCount(DEFAULT_TIMEOUT_MILLIS));
Assert.assertTrue(introspector.getTransactionNames().contains(getTransactionPrefix() + "/longfuture/LongNumber"));
}
use of com.newrelic.agent.introspec.Introspector in project newrelic-java-agent by newrelic.
the class SprayHttpRoutesTest method testSimpleRouteFutureCAT.
@Test
public void testSimpleRouteFutureCAT() throws UnsupportedEncodingException {
String idHeader = Obfuscator.obfuscateNameUsingKey("1xyz234#1xyz3333", "cafebabedeadbeef8675309babecafe1beefdead");
ValidatableResponse response = given().header(HeadersUtil.NEWRELIC_ID_HEADER, idHeader).baseUri("http://localhost:" + server.getPort()).when().get("/simple/route/future?query=value").then().body(containsString("Simple Route Future"));
Headers responseHeaders = response.extract().headers();
Assert.assertTrue(responseHeaders.hasHeaderWithName(HeadersUtil.NEWRELIC_APP_DATA_HEADER));
Introspector introspector = InstrumentationTestRunner.getIntrospector();
Assert.assertEquals(1, introspector.getFinishedTransactionCount(DEFAULT_TIMEOUT_MILLIS));
Assert.assertTrue(introspector.getTransactionNames().toString(), introspector.getTransactionNames().contains(getTransactionPrefix() + "/simple/route/future"));
}
use of com.newrelic.agent.introspec.Introspector in project newrelic-java-agent by newrelic.
the class SprayHttpRoutesTest method testAlternateRestRoute.
@Test
public void testAlternateRestRoute() {
given().baseUri("http://localhost:" + server.getPort()).when().get("/rest/this/is/the/rest").then().body(containsString("Rest: /this/is/the/rest"));
Introspector introspector = InstrumentationTestRunner.getIntrospector();
Assert.assertEquals(1, introspector.getFinishedTransactionCount(DEFAULT_TIMEOUT_MILLIS));
Assert.assertTrue(introspector.getTransactionNames().toString(), introspector.getTransactionNames().contains(getTransactionPrefix() + "/rest~Rest"));
}
use of com.newrelic.agent.introspec.Introspector in project newrelic-java-agent by newrelic.
the class SprayHttpRoutesTest method testSegmentsFutureRoute.
@Test
public void testSegmentsFutureRoute() {
given().baseUri("http://localhost:" + server.getPort()).when().get("/futuresegments/here/are/segments").then().body(containsString("FutureSegments: here,are,segments"));
Introspector introspector = InstrumentationTestRunner.getIntrospector();
Assert.assertEquals(1, introspector.getFinishedTransactionCount(DEFAULT_TIMEOUT_MILLIS));
Assert.assertTrue(introspector.getTransactionNames().toString(), introspector.getTransactionNames().contains(getTransactionPrefix() + "/futuresegments/(Segment/).repeat()"));
}
use of com.newrelic.agent.introspec.Introspector in project newrelic-java-agent by newrelic.
the class SprayHttpRoutesTest method testAlternativeComplexRepeatRoute.
@Test
public void testAlternativeComplexRepeatRoute() {
given().baseUri("http://localhost:" + server.getPort()).when().get("/repeat/52/53/54/complex").then().body(containsString("Repeat: 52,53,54"));
Introspector introspector = InstrumentationTestRunner.getIntrospector();
Assert.assertEquals(1, introspector.getFinishedTransactionCount(DEFAULT_TIMEOUT_MILLIS));
Assert.assertTrue(introspector.getTransactionNames().toString(), introspector.getTransactionNames().contains(getTransactionPrefix() + "/repeat/(IntNumber/).repeat()/complex"));
}
Aggregations