Search in sources :

Example 91 with Introspector

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

the class Spring530RouterFunTest method simplePath.

@Test
public void simplePath() {
    webClient.get().uri("/").exchange().block().bodyToMono(String.class).block();
    final Introspector introspector = InstrumentationTestRunner.getIntrospector();
    assertEquals(1, introspector.getFinishedTransactionCount(3000));
    assertTrue(introspector.getTransactionNames().contains("OtherTransaction/Spring/ (GET)"));
}
Also used : Introspector(com.newrelic.agent.introspec.Introspector) Test(org.junit.Test)

Example 92 with Introspector

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

the class Spring530RouterFunTest method postRegex.

@Test
public void postRegex() {
    final String responseBody = webClient.post().uri("/path/ToNowhere!!!!").contentType(MediaType.APPLICATION_JSON).bodyValue("{\"this\": \"isJSON\"}").retrieve().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 93 with Introspector

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

the class Spring530RouterFunTest method queryParam.

@Test
public void queryParam() {
    final String responseBody = webClient.get().uri("/wat/wat/wat?bar=java").retrieve().bodyToMono(String.class).block();
    assertEquals("query parameter request", responseBody);
    final Introspector introspector = InstrumentationTestRunner.getIntrospector();
    assertEquals(1, introspector.getFinishedTransactionCount(3000));
    assertTrue(introspector.getTransactionNames().contains("OtherTransaction/Spring/QueryParameter/bar (GET)"));
}
Also used : Introspector(com.newrelic.agent.introspec.Introspector) Test(org.junit.Test)

Example 94 with Introspector

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

the class SpringRouterFunTest method headers.

@Test
public void headers() {
    final String responseBody = webClient.get().uri("/some/other/path").header("SpecialHeader", "productive").exchange().block().bodyToMono(String.class).block();
    assertEquals("Headers request", responseBody);
    final Introspector introspector = InstrumentationTestRunner.getIntrospector();
    assertEquals(1, introspector.getFinishedTransactionCount(3000));
    assertTrue(introspector.getTransactionNames().toString(), introspector.getTransactionNames().contains("OtherTransaction/Spring/Unknown Route (GET)"));
}
Also used : Introspector(com.newrelic.agent.introspec.Introspector) Test(org.junit.Test)

Example 95 with Introspector

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

the class SpringRouterFunTest method helloWorldPath.

@Test
public void helloWorldPath() {
    webClient.get().uri("/helloWorld").exchange().block().bodyToMono(String.class).block();
    final Introspector introspector = InstrumentationTestRunner.getIntrospector();
    assertEquals(1, introspector.getFinishedTransactionCount(3000));
    assertTrue(introspector.getTransactionNames().contains("OtherTransaction/Spring/helloWorld (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