use of com.newrelic.agent.transaction.PriorityTransactionName in project newrelic-java-agent by newrelic.
the class BrowserConfigTest method testFooterCaptureAgnetAndUserAttsOneAndSsl.
@Test
public void testFooterCaptureAgnetAndUserAttsOneAndSsl() throws Exception {
setupManager(true, true);
Transaction tx = Transaction.getTransaction();
BasicRequestRootTracer tracer = createDispatcherTracer();
tx.getTransactionActivity().tracerStarted(tracer);
TransactionNamePriority expectedPriority = TransactionNamePriority.FILTER_NAME;
PriorityTransactionName ptn = PriorityTransactionName.create("name", null, expectedPriority);
tx.setPriorityTransactionName(ptn);
tx.getUserAttributes().put("product", "daProduct");
tx.getAgentAttributes().put("jvmbb.thread", "123abc");
// this one will get ignored
tx.getAgentAttributes().put("jvm.thread", "123abc");
Map<String, Object> beaconSettings = createBeaconSettings(true);
BrowserConfig beaconConfig = BrowserConfig.createBrowserConfig("appName", beaconSettings);
BrowserTransactionState bts = BrowserTransactionStateImpl.create(tx);
Assert.assertEquals(HEADER, beaconConfig.getBrowserTimingHeader());
String value = beaconConfig.getBrowserTimingFooter(bts);
List<String> matched = new ArrayList<>(15);
checkFooter(value, matched);
ArrayList<String> expectedFooterProperties = new ArrayList<>();
expectedFooterProperties.addAll(Arrays.asList(EXPECTED_FOOTER_PROPERTIES));
expectedFooterProperties.add("\"sslForHttp\":true");
String[] USER_ATTRIBUTES = { "\"product\":\"daProduct\"" };
List<String> expectedUserAttributes = Arrays.asList(USER_ATTRIBUTES);
String[] AGENT_ATTRIBUTES = { "\"jvmbb.thread\":\"123abc\"" };
List<String> expectedAgentAttributes = Arrays.asList(AGENT_ATTRIBUTES);
checkStringsAndUserParams(value, expectedFooterProperties, expectedUserAttributes, expectedAgentAttributes, matched);
}
Aggregations