Search in sources :

Example 96 with Introspector

use of com.newrelic.agent.introspec.Introspector in project newrelic-java-agent by newrelic.

the class SpringRouterFunTest method pathAccept.

@Test
public void pathAccept() {
    final String response = webClient.get().uri("/path-to-greatness").accept(MediaType.TEXT_PLAIN).exchange().block().bodyToMono(String.class).block();
    assertEquals("Path to greatness", response);
    final Introspector introspector = InstrumentationTestRunner.getIntrospector();
    assertEquals(1, introspector.getFinishedTransactionCount(3000));
    assertTrue(msg(introspector), introspector.getTransactionNames().contains("OtherTransaction/Spring/path-to-greatness (GET)"));
}
Also used : Introspector(com.newrelic.agent.introspec.Introspector) Test(org.junit.Test)

Example 97 with Introspector

use of com.newrelic.agent.introspec.Introspector in project newrelic-java-agent by newrelic.

the class SpringRouterFunTest method contentType.

@Test
public void contentType() {
    final int statusCode = webClient.post().uri("/uploadPDF").contentType(MediaType.APPLICATION_PDF).exchange().block().statusCode().value();
    assertEquals(200, statusCode);
    final Introspector introspector = InstrumentationTestRunner.getIntrospector();
    assertEquals(1, introspector.getFinishedTransactionCount(3000));
    assertTrue(msg(introspector), introspector.getTransactionNames().contains("OtherTransaction/Spring/uploadPDF (POST)"));
}
Also used : Introspector(com.newrelic.agent.introspec.Introspector) Test(org.junit.Test)

Example 98 with Introspector

use of com.newrelic.agent.introspec.Introspector in project newrelic-java-agent by newrelic.

the class SpringRouterFunTest method postRegex.

@Test
public void postRegex() {
    final String responseBody = webClient.post().uri("/path/ToNowhere!!!!").contentType(MediaType.APPLICATION_JSON).syncBody("{\"this\": \"isJSON\"}").exchange().block().bodyToMono(String.class).block();
    assertEquals("Got[where] = " + "ToNowhere!!!!", responseBody);
    final Introspector introspector = InstrumentationTestRunner.getIntrospector();
    assertEquals(1, introspector.getFinishedTransactionCount(3000));
    assertTrue(msg(introspector), introspector.getTransactionNames().contains("OtherTransaction/Spring/path/{where} (POST)"));
}
Also used : Introspector(com.newrelic.agent.introspec.Introspector) Test(org.junit.Test)

Example 99 with Introspector

use of com.newrelic.agent.introspec.Introspector in project newrelic-java-agent by newrelic.

the class Spring510RouterFunTest method resources.

@Test
public void resources() {
    final String response = webClient.get().uri("files/numbers.txt").exchange().block().bodyToMono(String.class).block();
    assertEquals("1\n2\n3\n4\n5\n6\n7\n8\n9\n10", response);
    final Introspector introspector = InstrumentationTestRunner.getIntrospector();
    assertEquals(1, introspector.getFinishedTransactionCount(3000));
    assertTrue(msg(introspector), introspector.getTransactionNames().contains("OtherTransaction/Spring/files/{*} (GET)"));
}
Also used : Introspector(com.newrelic.agent.introspec.Introspector) Test(org.junit.Test)

Example 100 with Introspector

use of com.newrelic.agent.introspec.Introspector in project newrelic-java-agent by newrelic.

the class Spring510RouterFunTest method nested.

@Test
public void nested() {
    assertEquals(200, webClient.get().uri("/language/en-us/nested").exchange().block().statusCode().value());
    final Introspector introspector = InstrumentationTestRunner.getIntrospector();
    assertEquals(1, introspector.getFinishedTransactionCount(3000));
    assertTrue(msg(introspector), introspector.getTransactionNames().contains("OtherTransaction/Spring/language/{language}/nested (GET)"));
}
Also used : Introspector(com.newrelic.agent.introspec.Introspector) Test(org.junit.Test)

Aggregations

Introspector (com.newrelic.agent.introspec.Introspector)452 Test (org.junit.Test)432 TransactionEvent (com.newrelic.agent.introspec.TransactionEvent)150 Java16IncompatibleTest (com.newrelic.test.marker.Java16IncompatibleTest)88 Java17IncompatibleTest (com.newrelic.test.marker.Java17IncompatibleTest)88 Java11IncompatibleTest (com.newrelic.test.marker.Java11IncompatibleTest)86 Java12IncompatibleTest (com.newrelic.test.marker.Java12IncompatibleTest)86 Java13IncompatibleTest (com.newrelic.test.marker.Java13IncompatibleTest)86 Java14IncompatibleTest (com.newrelic.test.marker.Java14IncompatibleTest)86 Java15IncompatibleTest (com.newrelic.test.marker.Java15IncompatibleTest)86 DatastoreHelper (com.newrelic.agent.introspec.DatastoreHelper)69 ExternalRequest (com.newrelic.agent.introspec.ExternalRequest)51 TracedMetricData (com.newrelic.agent.introspec.TracedMetricData)51 URI (java.net.URI)41 Java7IncompatibleTest (com.newrelic.test.marker.Java7IncompatibleTest)32 TransactionTrace (com.newrelic.agent.introspec.TransactionTrace)25 TraceSegment (com.newrelic.agent.introspec.TraceSegment)19 Matchers.containsString (org.hamcrest.Matchers.containsString)16 Java10IncompatibleTest (com.newrelic.test.marker.Java10IncompatibleTest)13 Java9IncompatibleTest (com.newrelic.test.marker.Java9IncompatibleTest)13