public TransactionNameTests(WebApplicationFactory <Startup> factory) { _factory = factory; _agent = new ApmAgent(new TestAgentComponents(payloadSender: _payloadSender, // _agent needs to share CurrentExecutionSegmentsContainer with Agent.Instance // because the sample application used by the tests (SampleAspNetCoreApp) uses Agent.Instance.Tracer.CurrentTransaction/CurrentSpan currentExecutionSegmentsContainer: Agent.Instance.TracerInternal.CurrentExecutionSegmentsContainer)); ApmMiddlewareExtension.UpdateServiceInformation(_agent.Service); }
public AspNetCoreMiddlewareTests(WebApplicationFactory <Startup> factory) { _factory = factory; //The agent is instantiated with ApmMiddlewareExtension.GetService, so we can also test the calculation of the service instance. //(e.g. ASP.NET Core version) _agent = new ApmAgent(new TestAgentComponents(reader: new TestAgentConfigurationReader(new TestLogger()))); ApmMiddlewareExtension.UpdateServiceInformation(_agent.Service); _capturedPayload = _agent.PayloadSender as MockPayloadSender; _client = Helper.GetClient(_agent, _factory); }
public AspNetCoreMiddlewareTests(WebApplicationFactory <Startup> factory, ITestOutputHelper xUnitOutputHelper) { _logger = new XunitOutputLogger(xUnitOutputHelper).Scoped(nameof(AspNetCoreMiddlewareTests)); _factory = factory; // We need to ensure Agent.Instance is created because we need _agent to use Agent.Instance CurrentExecutionSegmentsContainer AgentSingletonUtils.EnsureInstanceCreated(); _agent = new ApmAgent(new TestAgentComponents(logger: _logger, configurationReader: new TestAgentConfigurationReader(_logger), // _agent needs to share CurrentExecutionSegmentsContainer with Agent.Instance // because the sample application used by the tests (SampleAspNetCoreApp) uses Agent.Instance.Tracer.CurrentTransaction/CurrentSpan currentExecutionSegmentsContainer: Agent.Instance.TracerInternal.CurrentExecutionSegmentsContainer)); ApmMiddlewareExtension.UpdateServiceInformation(_agent.Service); _capturedPayload = _agent.PayloadSender as MockPayloadSender; _client = Helper.GetClient(_agent, _factory); }
public AspNetCoreMiddlewareTests(WebApplicationFactory <Startup> factory, ITestOutputHelper xUnitOutputHelper) : base(xUnitOutputHelper) { _logger = LoggerBase.Scoped(ThisClassName); _factory = factory; _agent = new ApmAgent(new TestAgentComponents( _logger, new MockConfigSnapshot(_logger, captureBody: ConfigConsts.SupportedValues.CaptureBodyAll), // _agent needs to share CurrentExecutionSegmentsContainer with Agent.Instance // because the sample application used by the tests (SampleAspNetCoreApp) uses Agent.Instance.Tracer.CurrentTransaction/CurrentSpan currentExecutionSegmentsContainer: Agent.Instance.TracerInternal.CurrentExecutionSegmentsContainer) ); ApmMiddlewareExtension.UpdateServiceInformation(_agent.Service); _capturedPayload = _agent.PayloadSender as MockPayloadSender; _client = Helper.GetClient(_agent, _factory); }
public TransactionNameTests(WebApplicationFactory <Startup> factory) { _factory = factory; _agent = new ApmAgent(new TestAgentComponents(payloadSender: _payloadSender)); ApmMiddlewareExtension.UpdateServiceInformation(_agent.Service); }