Comply with updated agent spec on browser loader (Java)
Description
The BAM spec was approved and merged in https://source.datanerd.us/agents/agent-specs/pull/626 that introduced a requirement for the browser agent loader injection to be validated in the best way to improve coverage and confidence.
The new md page specifically calls out:
Agent Loader Validation Testing (Required) Tests must exist for each APM language agent to validate that the injected agent loader code as rendered in the HTML output of a test app matches what was returned from the collector's connect response, without any modification.
Note that the ruby example provided in that section uses a trivial static string. We highly suggest and prefer that the most recent agent loader is retrieved from the collector to do this automation. But if that is deemed very difficult and impractical for your case, we suggest fallback to using an elaborate and complex string filled with problematic characters and combinations specific to your agent's language.
(An example of such "nice" / malicious text used by .NET agent can be found: in this slack thread OR NR-57445.)
Acceptance Criteria
The Java Agent auto injection of the browser agent adheres to the updated spec
Design Consideration/Limitations
N/A
Dependencies
N/A
Additional context
In the past, there have been customer impacting failure that may have been due to the Java Agent not injecting the browser code in the correct spot in the page content.
https://issues.newrelic.com/browse/NR-159189
Decided to target this for the next quarter.
Backlogged...