SenderResolver { public static Sender resolve() { return resolve(Configuration.SenderConfiguration.fromEnv()); }  static Sender resolve(); static Sender resolve(Configuration.SenderConfiguration senderConfiguration);  }
@Test public void testNoopSenderFactory() throws Exception { System.setProperty(Configuration.JAEGER_SENDER_FACTORY, "noop"); Sender sender = getSenderForServiceFileContents("\n" + NoopSenderFactory.class.getName(), true); SenderResolver.resolve(); assertTrue("Expected to have sender as instance of NoopSender, but was " + sender.getClass(), sender instanceof NoopSender); System.clearProperty(Configuration.JAEGER_SENDER_FACTORY); }
@Test public void testFromServiceLoader() { CustomSender customSender = new CustomSender(); SenderFactoryToBeLoaded.sender = customSender; Sender sender = SenderResolver.resolve(); assertEquals(customSender, sender); }