public void StreamUriHasCorrectEndpoint() { _config = _config.WithStreamUri(new Uri("http://stream.test.com")); TestStreamProcessor sp = CreateAndStartProcessor(); Assert.Equal(new Uri("http://stream.test.com/all"), sp.ActualStreamUri); }
public void TestAuth() { var conf = new Client.Configuration( new Dictionary <string, string>(), new Dictionary <string, string>(), new Dictionary <string, string>(), "https://dev.contraxsuite.com"); var proxy = new DefaultApi(conf); var usrData = new InlineObject70("Administrator", // user "*****@*****.**", // email "Administrator"); // password var resp = proxy.RestAuthLoginPOST(usrData) as JObject; var authResponse = resp.ToObject <Dictionary <string, object> >(); Assert.IsNotNull(resp); var apiKey = (string)authResponse["key"]; var apiToken = $"Token {apiKey}"; //proxy.Configuration.AccessToken = apiToken; proxy.Configuration.ApiKey["Authorization"] = apiToken; var projects = proxy.ProjectProjectsRecentGET(); Assert.IsNotNull(projects); }
public void StreamUriHasCorrectEndpoint() { _config = _config.WithStreamUri(new Uri("http://stream.test.com")); StreamProcessor sp = CreateAndStartProcessor(); Assert.Equal(new Uri("http://stream.test.com/all"), _eventSourceFactory.ReceivedProperties.StreamUri); }
private IRequestSender StartRequestSender(Client.Configuration configuration) { var self = SelfAs <IResponseChannelConsumer>(); var requestSender = ChildActorFor <IRequestSender>(() => new RequestSenderProbeActor(configuration, self, _testId)); return(requestSender); }
public void StreamUriHasCorrectEndpoint() { _config = Client.Configuration.Builder(_config).StreamUri(new Uri("http://stream.test.com")).Build(); StreamProcessor sp = CreateAndStartProcessor(); Assert.Equal(new Uri("http://stream.test.com/all"), _eventSourceFactory.ReceivedProperties.StreamUri); }
public ClientConsumerWorkerActor(Client.Configuration configuration) { _testId = configuration.HasTestInfo ? TestIdGenerator.IncrementAndGet().ToString() : EmptyTestId; _requestSender = StartRequestSender(configuration); _parser = null; }
public StreamProcessorTest() { _mockEventSource = new Mock <IEventSource>(); _mockEventSource.Setup(es => es.StartAsync()).Returns(Task.CompletedTask); _eventSource = _mockEventSource.Object; _mockRequestor = new Mock <IFeatureRequestor>(); _requestor = _mockRequestor.Object; _featureStore = new InMemoryFeatureStore(); _config = Client.Configuration.Default(SDK_KEY).WithFeatureStore(_featureStore); }
public RequestSenderProbeActor(Client.Configuration configuration, IResponseChannelConsumer consumer, string testId) { _channel = ClientConsumerCommons.ClientChannel(configuration, consumer, Logger); _cancellable = Stage.Scheduler.Schedule( SelfAs <IScheduled <object?> >(), null, TimeSpan.FromMilliseconds(1), TimeSpan.FromMilliseconds(configuration.ProbeInterval)); _buffer = new MemoryStream(configuration.WriteBufferSize); }
public void TestConnection() { var conf = new Client.Configuration( new Dictionary <string, string>(), new Dictionary <string, string>(), new Dictionary <string, string>(), "https://dev.contraxsuite.com"); var proxy = new DefaultApi(conf); var appVars = proxy.CommonAppVariablesGET(); Assert.IsNotNull(appVars); }
/// <summary> /// Initializes a new instance of the <see cref="ScriptApi"/> class /// using Configuration object /// </summary> /// <param name="configuration">An instance of Configuration</param> /// <returns></returns> public ScriptApi(Client.Configuration configuration = null) { if (configuration == null) // use the default one in Configuration { this.Configuration = Client.Configuration.Default; } else { this.Configuration = configuration; } ExceptionFactory = Client.Configuration.DefaultExceptionFactory; }
public State( Client.Configuration configuration, IClientRequestResponseChannel channel, ResponseParser?parser, ICancellable probe, MemoryStream buffer) { Configuration = configuration; Channel = channel; Parser = parser; Probe = probe; Buffer = buffer; }
public StreamProcessorTest() { _mockEventSource = new Mock <IEventSource>(); _mockEventSource.Setup(es => es.StartAsync()).Returns(Task.CompletedTask); _eventSource = _mockEventSource.Object; _eventSourceFactory = new TestEventSourceFactory(_eventSource); _mockRequestor = new Mock <IFeatureRequestor>(); _requestor = _mockRequestor.Object; _featureStore = TestUtils.InMemoryFeatureStore(); _config = Client.Configuration.Builder(SDK_KEY) .FeatureStoreFactory(TestUtils.SpecificFeatureStore(_featureStore)) .Build(); }
public ClientCorrelatingRequesterConsumerActor(Client.Configuration configuration) { _state = new State( configuration, ClientConsumerCommons.ClientChannel(configuration, SelfAs <IResponseChannelConsumer>(), Logger), null, Stage.Scheduler.Schedule( SelfAs <IScheduled <object?> >(), null, TimeSpan.FromMilliseconds(1), TimeSpan.FromMilliseconds(configuration.ProbeInterval)), new MemoryStream(configuration.WriteBufferSize)); _completables = new Dictionary <string, ICompletesEventually>(); _randomUuidGenerator = new RandomBasedGenerator(); }
public static IClientRequestResponseChannel ClientChannel( Client.Configuration configuration, IResponseChannelConsumer consumer, ILogger logger) { if (configuration.IsSecure) { return(new SecureClientRequestResponseChannel( configuration.AddressOfHost, consumer, configuration.ReadBufferPoolSize, configuration.ReadBufferSize, logger)); } return(new BasicClientRequestResponseChannel( configuration.AddressOfHost, consumer, configuration.ReadBufferPoolSize, configuration.ReadBufferSize, logger)); }
public TestStreamProcessor(Client.Configuration config, IFeatureRequestor featureRequestor, IFeatureStore featureStore, IEventSource eventSource) : base(config, featureRequestor, featureStore) { _eventSource = eventSource; }
/// <summary> /// Constructs my default state. /// </summary> /// <param name="configuration">The <see cref="Configuration"/></param> /// <param name="specification">The <see cref="RouterSpecification{T}"/></param> /// <exception cref="Exception">When the router cannot be initialized</exception> public RoundRobinClientRequestConsumerActor(Client.Configuration configuration, RouterSpecification <IClientConsumer> specification) : base(specification) { }
public LoadBalancingClientRequestConsumerActor( Client.Configuration configuration, RouterSpecification <IClientConsumer> specification) : base(specification) { }