use of com.newrelic.agent.introspec.Introspector in project newrelic-java-agent by newrelic.
the class SprayHttpRoutesTest method testSegmentsRoute.
@Test
public void testSegmentsRoute() {
given().baseUri("http://localhost:" + server.getPort()).when().get("/segments/here/are/segments").then().body(containsString("Segments: here,are,segments"));
Introspector introspector = InstrumentationTestRunner.getIntrospector();
Assert.assertEquals(1, introspector.getFinishedTransactionCount(DEFAULT_TIMEOUT_MILLIS));
Assert.assertTrue(introspector.getTransactionNames().contains(getTransactionPrefix() + "/segments/(Segment/).repeat()"));
}
use of com.newrelic.agent.introspec.Introspector in project newrelic-java-agent by newrelic.
the class SprayHttpRoutesTest method testPathEndRoute.
@Test
public void testPathEndRoute() {
given().baseUri("http://localhost:" + server.getPort()).when().get("/pathend").then().body(containsString("PathEnd"));
Introspector introspector = InstrumentationTestRunner.getIntrospector();
Assert.assertEquals(1, introspector.getFinishedTransactionCount(DEFAULT_TIMEOUT_MILLIS));
Assert.assertTrue(introspector.getTransactionNames().toString(), introspector.getTransactionNames().contains(getTransactionPrefix() + "/pathend"));
}
use of com.newrelic.agent.introspec.Introspector in project newrelic-java-agent by newrelic.
the class SprayHttpRoutesTest method testSecondaryAlternateRestRoute.
@Test
public void testSecondaryAlternateRestRoute() {
given().baseUri("http://localhost:" + server.getPort()).when().get("/rest").then().body(containsString("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 testUnmatchedSegmentFutureRoute.
@Test
public void testUnmatchedSegmentFutureRoute() {
given().baseUri("http://localhost:" + server.getPort()).when().get("/segment/future").then().body(containsString("The requested resource could not be found."));
Introspector introspector = InstrumentationTestRunner.getIntrospector();
Assert.assertEquals(1, introspector.getFinishedTransactionCount(DEFAULT_TIMEOUT_MILLIS));
Assert.assertTrue(introspector.getTransactionNames().toString(), introspector.getTransactionNames().contains(getTransactionPrefix() + "/Unknown Route"));
}
use of com.newrelic.agent.introspec.Introspector in project newrelic-java-agent by newrelic.
the class SprayHttpRoutesTest method testDoubleNumberFutureRoute.
@Test
public void testDoubleNumberFutureRoute() {
String doubleRegex = "[+-]?\\d*\\.?\\d*";
given().baseUri("http://localhost:" + server.getPort()).when().get("/double/future/123.456").then().body(containsString("DoubleNumberFuture: 123.456"));
Introspector introspector = InstrumentationTestRunner.getIntrospector();
Assert.assertEquals(1, introspector.getFinishedTransactionCount(DEFAULT_TIMEOUT_MILLIS));
Assert.assertTrue(introspector.getTransactionNames().contains(getTransactionPrefix() + "/double/future/" + doubleRegex));
}
Aggregations