use of com.newrelic.agent.MockServiceManager in project newrelic-java-agent by newrelic.
the class AgentAttributeSenderTest method setup.
@Before
public void setup() {
try {
manager = new MockServiceManager();
ServiceFactory.setServiceManager(manager);
} catch (Exception e) {
e.printStackTrace();
}
}
use of com.newrelic.agent.MockServiceManager in project newrelic-java-agent by newrelic.
the class AttributeValidatorTest method beforeClass.
@BeforeClass
public static void beforeClass() {
MockServiceManager sm = new MockServiceManager();
ServiceFactory.setServiceManager(sm);
}
use of com.newrelic.agent.MockServiceManager in project newrelic-java-agent by newrelic.
the class RequestUriConfigTests method createServiceManager.
private void createServiceManager(Map<String, Object> configMap) throws Exception {
ConfigService configService = ConfigServiceFactory.createConfigServiceUsingSettings(configMap);
MockServiceManager serviceManager = new MockServiceManager(configService);
ServiceFactory.setServiceManager(serviceManager);
serviceManager.setHarvestService(new MockHarvestService());
serviceManager.setSqlTraceService(new SqlTraceServiceImpl());
serviceManager.setAttributesService(new AttributesService());
serviceManager.setNormalizationService(new NormalizationServiceImpl());
MockRPMServiceManager rpmServiceManager = new MockRPMServiceManager();
serviceManager.setRPMServiceManager(rpmServiceManager);
MockRPMService rpmService = new MockRPMService();
rpmService.setApplicationName(serviceManager.getConfigService().getDefaultAgentConfig().getApplicationName());
rpmService.setEverConnected(true);
rpmService.setIsConnected(true);
rpmService.setErrorService(new ErrorServiceImpl(serviceManager.getConfigService().getDefaultAgentConfig().getApplicationName()));
rpmServiceManager.setRPMService(rpmService);
serviceManager.start();
}
use of com.newrelic.agent.MockServiceManager in project newrelic-java-agent by newrelic.
the class BrowserConfigTest method setupManager.
public void setupManager(boolean captureParams, boolean setSslForHttpToTrue) {
MockServiceManager manager = new MockServiceManager();
ServiceFactory.setServiceManager(manager);
Map<String, Object> params = new HashMap<>();
if (captureParams || setSslForHttpToTrue) {
Map<String, Object> bProps = new HashMap<>();
params.put("browser_monitoring", bProps);
if (captureParams) {
Map<String, Object> baProps = new HashMap<>();
bProps.put("attributes", baProps);
baProps.put("enabled", Boolean.TRUE);
}
if (setSslForHttpToTrue) {
bProps.put("ssl_for_http", Boolean.TRUE);
}
}
params.put("license_key", LICENSE_KEY);
ImmutableMap<String, Object> distributedTracingSettings = ImmutableMap.<String, Object>builder().put(DistributedTracingConfig.ENABLED, Boolean.FALSE).build();
params.put(AgentConfigImpl.DISTRIBUTED_TRACING, distributedTracingSettings);
manager.setConfigService(ConfigServiceFactory.createConfigServiceUsingSettings(params));
manager.setTransactionService(new TransactionService());
manager.setTransactionTraceService(new TransactionTraceService());
MockRPMServiceManager rpmServiceMgr = new MockRPMServiceManager();
MockRPMService rpmService = new MockRPMService();
rpmService.setApplicationName(APP_NAME);
rpmService.setEverConnected(true);
rpmService.setErrorService(new ErrorServiceImpl(APP_NAME));
rpmServiceMgr.setRPMService(rpmService);
manager.setRPMServiceManager(rpmServiceMgr);
AttributesService attService = new AttributesService();
manager.setAttributesService(attService);
ServiceFactory.setServiceManager(manager);
Transaction.clearTransaction();
}
use of com.newrelic.agent.MockServiceManager in project newrelic-java-agent by newrelic.
the class BrowserTransactionStateTest method setup.
@Before
public void setup() {
MockServiceManager serviceManager = new MockServiceManager();
serviceManager.setConfigService(new MockConfigService(AgentConfigFactory.createAgentConfig(Collections.<String, Object>emptyMap(), Collections.<String, Object>emptyMap(), null)));
ServiceFactory.setServiceManager(serviceManager);
MockitoAnnotations.initMocks(this);
}
Aggregations