File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
dd-java-agent-ittests/src/test/java/com/datadoghq/agent/integration Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change 66import org .junit .Test ;
77
88public class ApacheHTTPClientTest {
9+ static {
10+ try {
11+ // Since the HttpClientBuilder initializer doesn't work, invoke manually.
12+ Class .forName ("com.datadoghq.agent.InstrumentationRulesManager" )
13+ .getMethod ("registerClassLoad" , Object .class )
14+ .invoke (null , Thread .currentThread ().getContextClassLoader ());
15+ } catch (Exception e ) {
16+ System .err .println ("clinit error: " + e .getMessage ());
17+ }
18+ }
919
1020 @ Test
1121 public void test () throws Exception {
12- // Since the HttpClientBuilder initializer doesn't work, invoke manually.
13- Class .forName ("com.datadoghq.agent.InstrumentationRulesManager" )
14- .getMethod ("registerClassLoad" )
15- .invoke (null );
16-
1722 final HttpClientBuilder builder = HttpClientBuilder .create ();
1823 assertThat (builder .getClass ().getSimpleName ()).isEqualTo ("TracingHttpClientBuilder" );
1924 }
You can’t perform that action at this time.
0 commit comments