MessageSenderFactory { public MessageSender getMessageSender(TransportProfile transportProfile) throws OxalisTransmissionException { return injector.getInstance(Key.get(MessageSender.class, Names.named(getSender(transportProfile)))); } @Inject  MessageSenderFactory(Injector injector, Config config); List<TransportProfile> getPrioritizedTransportProfiles(); String getSender(TransportProfile transportProfile); MessageSender getMessageSender(TransportProfile transportProfile);  }
@Test public void validTransportProfile() throws OxalisTransmissionException { Assert.assertNotNull(messageSenderFactory.getMessageSender(AsdConstants.TRANSPORT_PROFILE)); }
@Test(expectedExceptions = OxalisTransmissionException.class) public void invalidTransportProfile() throws OxalisTransmissionException { messageSenderFactory.getMessageSender(TransportProfile.START); }