use of com.newrelic.agent.config.UtilizationDataConfig in project newrelic-java-agent by newrelic.
the class UtilizationServiceTest method before.
@Before
public void before() {
MockServiceManager mockServiceManager = new MockServiceManager();
config = mock(AgentConfig.class);
MockConfigService configService = new MockConfigService(null);
configService.setAgentConfig(config);
ServiceFactory.setServiceManager(mockServiceManager);
mockServiceManager.setConfigService(configService);
ThreadService mockThreadService = mock(ThreadService.class);
mockServiceManager.setThreadService(mockThreadService);
// Do not make AWS/Azure/GCP/PCF calls. Unit tests should work even without internet connection :)
when(config.getValue(UtilizationService.DETECT_DOCKER_KEY, true)).thenReturn(false);
when(config.getValue(UtilizationService.DETECT_AWS_KEY, true)).thenReturn(false);
when(config.getValue(UtilizationService.DETECT_AZURE_KEY, true)).thenReturn(false);
when(config.getValue(UtilizationService.DETECT_GOOGLE_CLOUD_PROVIDER_KEY, true)).thenReturn(false);
when(config.getValue(UtilizationService.DETECT_PIVOTAL_CLOUD_FOUNDRY_KEY, true)).thenReturn(false);
when(config.getValue(UtilizationService.DETECT_KUBERNETES_KEY, true)).thenReturn(false);
UtilizationDataConfig utilDataConfig = mock(UtilizationDataConfig.class);
when(config.getUtilizationDataConfig()).thenReturn(utilDataConfig);
}
Aggregations