use of org.opennms.netmgt.dao.VmwareDatacollectionConfigDao in project opennms by OpenNMS.
the class VmwareCollectorComplianceTest method getRequiredBeans.
@Override
public Map<String, Object> getRequiredBeans() {
OnmsNode node = mock(OnmsNode.class, RETURNS_DEEP_STUBS);
NodeDao nodeDao = mock(NodeDao.class);
when(nodeDao.get(anyInt())).thenReturn(node);
when(node.getAssetRecord().getVmwareManagementServer()).thenReturn("mdx");
when(node.getAssetRecord().getVmwareManagedEntityType()).thenReturn("tsx");
when(node.getForeignId()).thenReturn("rsx");
VmwareCollection collection = new VmwareCollection();
VmwareDatacollectionConfigDao vmwareDatacollectionConfigDao = mock(VmwareDatacollectionConfigDao.class);
when(vmwareDatacollectionConfigDao.getVmwareCollection(COLLECTION)).thenReturn(collection);
when(vmwareDatacollectionConfigDao.getRrdRepository(COLLECTION)).thenReturn(new RrdRepository());
VmwareServer vmwareServer = new VmwareServer();
vmwareServer.setHostname(InetAddrUtils.getLocalHostAddress().getCanonicalHostName());
Map<String, VmwareServer> serverMap = new ImmutableMap.Builder<String, VmwareServer>().put("mdx", vmwareServer).build();
VmwareConfigDao vmwareConfigDao = mock(VmwareConfigDao.class);
when(vmwareConfigDao.getServerMap()).thenReturn(serverMap);
return new ImmutableMap.Builder<String, Object>().put("nodeDao", nodeDao).put("vmwareDatacollectionConfigDao", vmwareDatacollectionConfigDao).put("vmwareConfigDao", vmwareConfigDao).build();
}
Aggregations