}
@Test
public void testForeignSource() throws Exception {
createRequisition();
OnmsForeignSource foreignSource = createForeignSource(m_defaultForeignSourceName);
<BUG>List<OnmsForeignSource> foreignSources = new ArrayList<OnmsForeignSource>(m_foreignSourceRepository.getAll());

assertEquals("number of foreign sources", 1, foreignSources.size());

assertEquals("getAll() foreign source name matches", m_defaultForeignSourceName, foreignSources.get(0).getName());

assertEquals("get() returns the foreign source", foreignSource, m_foreignSourceRepository.get(m_defaultForeignSourceName));
</BUG>
}

}
private OnmsRequisition createRequisition() throws Exception {
OnmsRequisition r = m_foreignSourceRepository.createRequisition(new ClassPathResource("/requisition-test.xml"));
m_foreignSourceRepository.save(r);
return r;
}
private OnmsForeignSource createForeignSource(String foreignSource) throws Exception {
OnmsForeignSource fs = new OnmsForeignSource(foreignSource);
fs.addDetector(new PluginConfig("HTTP", "org.opennms.netmgt.provision.detector.simple.HttpDetector"));
fs.addPolicy(new PluginConfig("all-ipinterfaces", "org.opennms.netmgt.provision.persist.policies.InclusiveInterfacePolicy"));
m_foreignSourceRepository.save(fs);
return fs;
}
