use of com.newrelic.agent.introspec.TransactionEvent in project newrelic-java-agent by newrelic.
the class AkkaHttpRoutesTest method testRegexRoute.
@Test
public void testRegexRoute() {
given().baseUri("http://localhost:" + server.getPort()).when().get("/regex/5").then().body(containsString("Regex: 5"));
Introspector introspector = InstrumentationTestRunner.getIntrospector();
Assert.assertEquals(1, introspector.getFinishedTransactionCount(TIMEOUT));
Assert.assertTrue(introspector.getTransactionNames().toString(), introspector.getTransactionNames().contains(getTransactionPrefix() + "/regex/\\d+"));
Collection<TransactionEvent> transactionEvents = introspector.getTransactionEvents(introspector.getTransactionNames().toArray()[0].toString());
assertResponseCodeOnTxEvents(transactionEvents, 1, "200");
}
use of com.newrelic.agent.introspec.TransactionEvent in project newrelic-java-agent by newrelic.
the class AkkaHttpRoutesTest method testIntNumberRoute.
@Test
public void testIntNumberRoute() {
given().baseUri("http://localhost:" + server.getPort()).when().get("/int/10").then().body(containsString("IntNumber: 10"));
Introspector introspector = InstrumentationTestRunner.getIntrospector();
Assert.assertEquals(1, introspector.getFinishedTransactionCount(TIMEOUT));
Assert.assertTrue(introspector.getTransactionNames().toString(), introspector.getTransactionNames().contains(getTransactionPrefix() + "/int/IntNumber"));
Collection<TransactionEvent> transactionEvents = introspector.getTransactionEvents(introspector.getTransactionNames().toArray()[0].toString());
assertResponseCodeOnTxEvents(transactionEvents, 1, "200");
}
use of com.newrelic.agent.introspec.TransactionEvent in project newrelic-java-agent by newrelic.
the class AkkaHttpRoutesTest method testPathEndFutureRoute.
@Test
public void testPathEndFutureRoute() {
given().baseUri("http://localhost:" + server.getPort()).when().get("/pathendfuture").then().body(containsString("PathEndFuture"));
Introspector introspector = InstrumentationTestRunner.getIntrospector();
Assert.assertEquals(1, introspector.getFinishedTransactionCount(TIMEOUT));
Assert.assertTrue(introspector.getTransactionNames().toString(), introspector.getTransactionNames().contains(getTransactionPrefix() + "/pathendfuture"));
Collection<TransactionEvent> transactionEvents = introspector.getTransactionEvents(introspector.getTransactionNames().toArray()[0].toString());
assertResponseCodeOnTxEvents(transactionEvents, 1, "200");
}
use of com.newrelic.agent.introspec.TransactionEvent in project newrelic-java-agent by newrelic.
the class AkkaHttpRoutesTest method testRemainingFutureRoute.
@Test
public void testRemainingFutureRoute() {
given().baseUri("http://localhost:" + server.getPort()).when().get("/futureremaining").then().body(containsString("FutureRemain: ing"));
Introspector introspector = InstrumentationTestRunner.getIntrospector();
Assert.assertEquals(1, introspector.getFinishedTransactionCount(TIMEOUT));
Assert.assertTrue(introspector.getTransactionNames().toString(), introspector.getTransactionNames().contains(getTransactionPrefix() + "/futureremain~Remaining"));
Collection<TransactionEvent> transactionEvents = introspector.getTransactionEvents(introspector.getTransactionNames().toArray()[0].toString());
assertResponseCodeOnTxEvents(transactionEvents, 1, "200");
}
use of com.newrelic.agent.introspec.TransactionEvent in project newrelic-java-agent by newrelic.
the class AkkaHttpRoutesTest method testDoublePrefixNoParam.
@Test
public void testDoublePrefixNoParam() {
given().baseUri("http://localhost:" + server.getPort()).when().get("/v1/containers").then().body(containsString("Request is missing required query parameter 'parameter'"));
Introspector introspector = InstrumentationTestRunner.getIntrospector();
Assert.assertEquals(1, introspector.getFinishedTransactionCount(TIMEOUT));
Assert.assertTrue(introspector.getTransactionNames().toString(), introspector.getTransactionNames().contains(getTransactionPrefix() + "/Unknown Route"));
Collection<TransactionEvent> transactionEvents = introspector.getTransactionEvents(introspector.getTransactionNames().toArray()[0].toString());
assertResponseCodeOnTxEvents(transactionEvents, 1, "404");
}
Aggregations