use of org.nhindirect.stagent.provider.MockNHINDAgentProvider in project nhin-d by DirectProject.
the class SmtpAgentFactory_CreateAgent_Test method testCreateDefaultAgent_XMLConfigurationProvider_AuditorModule.
public void testCreateDefaultAgent_XMLConfigurationProvider_AuditorModule() throws Exception {
Provider<SmtpAgentConfig> configProvider = new XMLSmtpAgentConfigProvider(TestUtils.getTestConfigFile("ValidConfig.xml"), new MockNHINDAgentProvider(Arrays.asList("mydomain")));
SmtpAgent agent = SmtpAgentFactory.createAgent(null, configProvider, new MockNHINDAgentProvider(Arrays.asList("mydomain")), Arrays.asList(FileAuditorModule.create("target/AuditFile.txt")));
assertNotNull(agent);
assertNotNull(agent.getAgent());
assertTrue(agent.getAgent() instanceof MockNHINDAgent);
DefaultSmtpAgent smtpAgent = (DefaultSmtpAgent) agent;
assertNotNull(smtpAgent.getAuditor());
assertTrue(smtpAgent.getAuditor() instanceof FileAuditor);
}
use of org.nhindirect.stagent.provider.MockNHINDAgentProvider in project nhin-d by DirectProject.
the class SmtpAgentFactory_CreateAgent_Test method testCreateDefaultAgent_XMLConfigurationProvider_MockAgent.
public void testCreateDefaultAgent_XMLConfigurationProvider_MockAgent() throws Exception {
Provider<SmtpAgentConfig> configProvider = new XMLSmtpAgentConfigProvider(TestUtils.getTestConfigFile("ValidConfig.xml"), new MockNHINDAgentProvider(Arrays.asList("mydomain")));
SmtpAgent agent = SmtpAgentFactory.createAgent(null, configProvider, new MockNHINDAgentProvider(Arrays.asList("mydomain")));
assertNotNull(agent);
assertNotNull(agent.getAgent());
assertTrue(agent.getAgent() instanceof MockNHINDAgent);
}
Aggregations