protected HttpClient(ILogger logger, IHttpClientConfiguration configuration, IInterruptibleThreadSuspender threadSuspender) { this.logger = logger; this.threadSuspender = threadSuspender; HttpClientConfiguration = configuration; monitorUrl = BuildMonitorUrl(configuration.BaseUrl, configuration.ApplicationId, ServerId); newSessionUrl = BuildNewSessionUrl(configuration.BaseUrl, configuration.ApplicationId, ServerId); }
public void SetUp() { mockTimingProvider = Substitute.For <ITimingProvider>(); mockSession = Substitute.For <ISessionInternals>(); mockThreadSuspender = Substitute.For <IInterruptibleThreadSuspender>(); mockThreadSuspender.Sleep(Arg.Any <int>()).Returns(true); mockSessionProxy = Substitute.For <ISessionProxy>(); }
public HttpClientWebClient(ILogger logger, IHttpClientConfiguration configuration, IInterruptibleThreadSuspender threadSuspender) : base(logger, configuration, threadSuspender) { if (!_remoteCertificateValidationCallbackInitialized) { ServicePointManager.ServerCertificateValidationCallback += configuration.SslTrustManager?.ServerCertificateValidationCallback; _remoteCertificateValidationCallbackInitialized = true; } }
/// <summary> /// Constructor /// /// Current state is initialized to <see cref="Dynatrace.OpenKit.Core.Communication.BeaconSendingInitState"/>. /// </summary> internal BeaconSendingContext( ILogger logger, IHttpClientConfiguration httpClientConfiguration, IHttpClientProvider httpClientProvider, ITimingProvider timingProvider, IInterruptibleThreadSuspender threadSuspender ) : this(logger, httpClientConfiguration, httpClientProvider, timingProvider, threadSuspender, new BeaconSendingInitState()) { }
internal BeaconSender( ILogger logger, IHttpClientConfiguration httpClientConfiguration, IHttpClientProvider clientProvider, ITimingProvider timingProvider, IInterruptibleThreadSuspender threadSuspender) { this.logger = logger; context = new BeaconSendingContext(logger, httpClientConfiguration, clientProvider, timingProvider, threadSuspender); }
internal BeaconSendingContext( ILogger logger, IHttpClientConfiguration httpClientConfiguration, IHttpClientProvider httpClientProvider, ITimingProvider timingProvider, IInterruptibleThreadSuspender threadSuspender, AbstractBeaconSendingState initialState ) { this.logger = logger; this.httpClientConfiguration = httpClientConfiguration; serverConfiguration = ServerConfiguration.Default; HttpClientProvider = httpClientProvider; this.timingProvider = timingProvider; this.threadSuspender = threadSuspender; lastResponseAttributes = ResponseAttributes.WithUndefinedDefaults().Build(); CurrentState = initialState; }
public void Setup() { mockLogger = Substitute.For <ILogger>(); mockLogger.IsInfoEnabled.Returns(true); mockLogger.IsDebugEnabled.Returns(true); mockHttpClientConfig = Substitute.For <IHttpClientConfiguration>(); var statusResponse = Substitute.For <IStatusResponse>(); statusResponse.ResponseCode.Returns(StatusResponse.HttpOk); statusResponse.IsErroneousResponse.Returns(false); var httpClient = Substitute.For <IHttpClient>(); httpClient.SendBeaconRequest(Arg.Any <string>(), Arg.Any <byte[]>(), Arg.Any <IAdditionalQueryParameters>()) .Returns(statusResponse); mockHttpClientProvider = Substitute.For <IHttpClientProvider>(); mockHttpClientProvider.CreateClient(Arg.Any <IHttpClientConfiguration>()).Returns(httpClient); mockTimingProvider = Substitute.For <ITimingProvider>(); mockThreadSuspender = Substitute.For <IInterruptibleThreadSuspender>(); }
internal TestBeaconSendingContextBuilder With(IInterruptibleThreadSuspender suspender) { threadSuspender = suspender; return(this); }
public DefaultHttpClientProvider(ILogger logger, IInterruptibleThreadSuspender threadSuspender) { this.logger = logger; this.threadSuspender = threadSuspender; }
public HttpClientHttpClient(ILogger logger, IHttpClientConfiguration configuration, IInterruptibleThreadSuspender threadSuspender) : base(logger, configuration, threadSuspender) { this.configuration = configuration; }
public void SetUp() { mockLogger = Substitute.For <ILogger>(); mockThreadSuspender = Substitute.For <IInterruptibleThreadSuspender>(); }
public StubHttpClient(ILogger logger, IHttpClientConfiguration configuration, IInterruptibleThreadSuspender threadSuspender) : base(logger, configuration, threadSuspender) { }
public SessionWatchdogContext(ITimingProvider timingProvider, IInterruptibleThreadSuspender threadSuspender) { this.timingProvider = timingProvider; this.threadSuspender = threadSuspender; }