Search in sources :

Example 1 with MockSmtpAgentConfigProvider

use of org.nhindirect.stagent.provider.MockSmtpAgentConfigProvider in project nhin-d by DirectProject.

the class SmtpAgentFactory_buildAgentInjectorTest method testBuildAgentInjector_customConfigModule_assertInjector.

public void testBuildAgentInjector_customConfigModule_assertInjector() throws Exception {
    Injector injector = SmtpAgentFactory.buildAgentInjector(new URL("http://doesntmatter"), new MockSmtpAgentConfigProvider(Arrays.asList("testdomain.com")), null);
    assertNotNull(injector);
    // try to get an instance of the configuration object
    NHINDAgent agent = injector.getInstance(NHINDAgent.class);
    assertNotNull(agent);
    assertTrue(agent instanceof MockNHINDAgent);
}
Also used : MockNHINDAgent(org.nhindirect.stagent.MockNHINDAgent) MockSmtpAgentConfigProvider(org.nhindirect.stagent.provider.MockSmtpAgentConfigProvider) Injector(com.google.inject.Injector) NHINDAgent(org.nhindirect.stagent.NHINDAgent) MockNHINDAgent(org.nhindirect.stagent.MockNHINDAgent) URL(java.net.URL)

Aggregations

Injector (com.google.inject.Injector)1 URL (java.net.URL)1 MockNHINDAgent (org.nhindirect.stagent.MockNHINDAgent)1 NHINDAgent (org.nhindirect.stagent.NHINDAgent)1 MockSmtpAgentConfigProvider (org.nhindirect.stagent.provider.MockSmtpAgentConfigProvider)1