Search in sources :

Example 1 with VmwareDatacollectionConfigDao

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();
}
Also used : NodeDao(org.opennms.netmgt.dao.api.NodeDao) VmwareConfigDao(org.opennms.netmgt.dao.VmwareConfigDao) OnmsNode(org.opennms.netmgt.model.OnmsNode) VmwareServer(org.opennms.netmgt.config.vmware.VmwareServer) VmwareCollection(org.opennms.netmgt.config.vmware.vijava.VmwareCollection) VmwareDatacollectionConfigDao(org.opennms.netmgt.dao.VmwareDatacollectionConfigDao) RrdRepository(org.opennms.netmgt.rrd.RrdRepository)

Aggregations

VmwareServer (org.opennms.netmgt.config.vmware.VmwareServer)1 VmwareCollection (org.opennms.netmgt.config.vmware.vijava.VmwareCollection)1 VmwareConfigDao (org.opennms.netmgt.dao.VmwareConfigDao)1 VmwareDatacollectionConfigDao (org.opennms.netmgt.dao.VmwareDatacollectionConfigDao)1 NodeDao (org.opennms.netmgt.dao.api.NodeDao)1 OnmsNode (org.opennms.netmgt.model.OnmsNode)1 RrdRepository (org.opennms.netmgt.rrd.RrdRepository)1