use of com.newrelic.agent.introspec.Introspector in project newrelic-java-agent by newrelic.
the class SprayHttpRoutesTest method testAlternativePipeRoute.
@Test
public void testAlternativePipeRoute() {
given().baseUri("http://localhost:" + server.getPort()).when().get("/pipe/hCAFE").then().body(containsString("Pipe: 51966"));
Introspector introspector = InstrumentationTestRunner.getIntrospector();
Assert.assertEquals(1, introspector.getFinishedTransactionCount(DEFAULT_TIMEOUT_MILLIS));
Assert.assertTrue(introspector.getTransactionNames().toString(), introspector.getTransactionNames().contains(getTransactionPrefix() + "/pipe/h~HexIntNumber"));
}
use of com.newrelic.agent.introspec.Introspector in project newrelic-java-agent by newrelic.
the class SprayHttpRoutesTest method testRestRoute.
@Test
public void testRestRoute() {
given().baseUri("http://localhost:" + server.getPort()).when().get("/resting").then().body(containsString("Rest: ing"));
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 testSimpleRouteCAT.
@Test
public void testSimpleRouteCAT() 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?query=value").then().body(containsString("Simple Route"));
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"));
}
use of com.newrelic.agent.introspec.Introspector in project newrelic-java-agent by newrelic.
the class SprayHttpRoutesTest method testNonPathEndFutureRoute.
@Test
public void testNonPathEndFutureRoute() {
given().baseUri("http://localhost:" + server.getPort()).when().get("/pathendfuture/extra").then().body(containsString("PathEndFuture: extra"));
Introspector introspector = InstrumentationTestRunner.getIntrospector();
Assert.assertEquals(1, introspector.getFinishedTransactionCount(DEFAULT_TIMEOUT_MILLIS));
Assert.assertTrue(introspector.getTransactionNames().contains(getTransactionPrefix() + "/pathendfuture/Segment"));
}
use of com.newrelic.agent.introspec.Introspector in project newrelic-java-agent by newrelic.
the class SprayHttpRoutesTest method testSegmentRoute.
@Test
public void testSegmentRoute() {
given().baseUri("http://localhost:" + server.getPort()).when().get("/segment/foobar").then().body(containsString("Segment: bar"));
Introspector introspector = InstrumentationTestRunner.getIntrospector();
Assert.assertEquals(1, introspector.getFinishedTransactionCount(DEFAULT_TIMEOUT_MILLIS));
Assert.assertTrue(introspector.getTransactionNames().toString(), introspector.getTransactionNames().contains(getTransactionPrefix() + "/segment/foo~Segment"));
}
Aggregations