Search in sources :

Example 1 with TcaDataCollectionConfigDao

use of org.opennms.netmgt.collectd.tca.dao.TcaDataCollectionConfigDao in project opennms by OpenNMS.

the class TcaCollectorComplianceIT method getRequiredBeans.

@Override
public Map<String, Object> getRequiredBeans() {
    TcaDataCollectionConfig config = mock(TcaDataCollectionConfig.class);
    RrdRepository rrdRepository = new RrdRepository();
    rrdRepository.setRrdBaseDir(new File("target"));
    when(config.buildRrdRepository(COLLECTION)).thenReturn(rrdRepository);
    TcaDataCollectionConfigDao tcaDataCollectionConfigDao = mock(TcaDataCollectionConfigDao.class);
    when(tcaDataCollectionConfigDao.getConfig()).thenReturn(config);
    ResourceStorageDao resourceStorageDao = mock(ResourceStorageDao.class);
    ResourceTypesDao resourceTypesDao = mock(ResourceTypesDao.class);
    ResourceType resourceType = TcaCollectorIT.getJuniperTcaEntryResourceType();
    when(resourceTypesDao.getResourceTypeByName(TcaCollectionHandler.RESOURCE_TYPE_NAME)).thenReturn(resourceType);
    return new ImmutableMap.Builder<String, Object>().put("tcaDataCollectionConfigDao", tcaDataCollectionConfigDao).put("resourceStorageDao", resourceStorageDao).put("resourceTypesDao", resourceTypesDao).put("locationAwareSnmpClient", m_client).build();
}
Also used : ResourceStorageDao(org.opennms.netmgt.dao.api.ResourceStorageDao) TcaDataCollectionConfigDao(org.opennms.netmgt.collectd.tca.dao.TcaDataCollectionConfigDao) ResourceTypesDao(org.opennms.netmgt.config.api.ResourceTypesDao) ResourceType(org.opennms.netmgt.config.datacollection.ResourceType) RrdRepository(org.opennms.netmgt.rrd.RrdRepository) File(java.io.File) TcaDataCollectionConfig(org.opennms.netmgt.collectd.tca.config.TcaDataCollectionConfig) ImmutableMap(com.google.common.collect.ImmutableMap)

Aggregations

ImmutableMap (com.google.common.collect.ImmutableMap)1 File (java.io.File)1 TcaDataCollectionConfig (org.opennms.netmgt.collectd.tca.config.TcaDataCollectionConfig)1 TcaDataCollectionConfigDao (org.opennms.netmgt.collectd.tca.dao.TcaDataCollectionConfigDao)1 ResourceTypesDao (org.opennms.netmgt.config.api.ResourceTypesDao)1 ResourceType (org.opennms.netmgt.config.datacollection.ResourceType)1 ResourceStorageDao (org.opennms.netmgt.dao.api.ResourceStorageDao)1 RrdRepository (org.opennms.netmgt.rrd.RrdRepository)1