Search in sources :

Example 1 with VmwareCimDatacollectionConfigDao

use of org.opennms.netmgt.dao.VmwareCimDatacollectionConfigDao in project opennms by OpenNMS.

the class VmwareCimCollectorComplianceTest 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");
    VmwareCimCollection collection = new VmwareCimCollection();
    VmwareCimDatacollectionConfigDao vmwareCimDatacollectionConfigDao = mock(VmwareCimDatacollectionConfigDao.class);
    when(vmwareCimDatacollectionConfigDao.getVmwareCimCollection(COLLECTION)).thenReturn(collection);
    when(vmwareCimDatacollectionConfigDao.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("vmwareCimDatacollectionConfigDao", vmwareCimDatacollectionConfigDao).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) VmwareCimDatacollectionConfigDao(org.opennms.netmgt.dao.VmwareCimDatacollectionConfigDao) VmwareServer(org.opennms.netmgt.config.vmware.VmwareServer) VmwareCimCollection(org.opennms.netmgt.config.vmware.cim.VmwareCimCollection) RrdRepository(org.opennms.netmgt.rrd.RrdRepository)

Aggregations

VmwareServer (org.opennms.netmgt.config.vmware.VmwareServer)1 VmwareCimCollection (org.opennms.netmgt.config.vmware.cim.VmwareCimCollection)1 VmwareCimDatacollectionConfigDao (org.opennms.netmgt.dao.VmwareCimDatacollectionConfigDao)1 VmwareConfigDao (org.opennms.netmgt.dao.VmwareConfigDao)1 NodeDao (org.opennms.netmgt.dao.api.NodeDao)1 OnmsNode (org.opennms.netmgt.model.OnmsNode)1 RrdRepository (org.opennms.netmgt.rrd.RrdRepository)1