use of com.newrelic.agent.model.SpanEvent in project newrelic-java-agent by newrelic.
the class SpanEventFactoryTest method uriShouldBeSet.
@Test
public void uriShouldBeSet() {
SpanEvent target = spanEventFactory.setUri(URI.create("https://newrelic.com")).build();
assertEquals("https://newrelic.com", target.getAgentAttributes().get("http.url"));
}
use of com.newrelic.agent.model.SpanEvent in project newrelic-java-agent by newrelic.
the class SpanEventFactoryTest method addressShouldBeSet.
@Test
public void addressShouldBeSet() {
SpanEvent target = spanEventFactory.setAddress("localhost", "3306").build();
assertEquals("localhost:3306", target.getIntrinsics().get("peer.address"));
}
use of com.newrelic.agent.model.SpanEvent in project newrelic-java-agent by newrelic.
the class SpanEventFactoryTest method shouldSetStatusText.
@Test
public void shouldSetStatusText() {
SpanEvent spanEvent = spanEventFactory.setHttpStatusText("I'm a teapot.").build();
assertEquals("I'm a teapot.", spanEvent.getAgentAttributes().get("http.statusText"));
}
use of com.newrelic.agent.model.SpanEvent in project newrelic-java-agent by newrelic.
the class SpanEventFactoryTest method doesNotSetHttpAgentAttributesWhenFiltering.
@Test
public void doesNotSetHttpAgentAttributesWhenFiltering() {
HttpParameters mockParameters = mock(HttpParameters.class);
when(mockParameters.getLibrary()).thenReturn("library");
when(mockParameters.getProcedure()).thenReturn("procedure");
SpanEventFactory target = new SpanEventFactory("blerb", new PassNothingAttributeFilter(), DEFAULT_SYSTEM_TIMESTAMP_SUPPLIER);
SpanEvent spanEvent = target.setExternalParameterAttributes(mockParameters).build();
assertEquals("library", spanEvent.getIntrinsics().get("component"));
assertNull(spanEvent.getAgentAttributes().get("http.method"));
}
use of com.newrelic.agent.model.SpanEvent in project newrelic-java-agent by newrelic.
the class SpanEventFactoryTest method shouldSetStatusCode.
@Test
public void shouldSetStatusCode() {
SpanEvent spanEvent = spanEventFactory.setHttpStatusCode(418).build();
assertEquals(418, spanEvent.getAgentAttributes().get("http.statusCode"));
}
Aggregations