Search in sources :

Example 1 with LoadBalancerJobValidator

use of com.netflix.titus.api.loadbalancer.model.sanitizer.LoadBalancerJobValidator in project titus-control-plane by Netflix.

the class LoadBalancerTests method getMockLoadBalancerService.

public static LoadBalancerService getMockLoadBalancerService() {
    final TitusRuntime runtime = TitusRuntimes.internal();
    final LoadBalancerConfiguration loadBalancerConfig = mockConfiguration(5_000);
    final LoadBalancerConnector connector = mock(LoadBalancerConnector.class);
    final V3JobOperations v3JobOperations = mock(V3JobOperations.class);
    when(v3JobOperations.observeJobs()).thenReturn(PublishSubject.create());
    final LoadBalancerJobOperations loadBalancerJobOperations = new LoadBalancerJobOperations(v3JobOperations);
    final LoadBalancerReconciler reconciler = mock(LoadBalancerReconciler.class);
    when(reconciler.events()).thenReturn(PublishSubject.create());
    final LoadBalancerStore loadBalancerStore = new InMemoryLoadBalancerStore();
    final LoadBalancerJobValidator validator = new NoOpLoadBalancerJobValidator();
    final TestScheduler testScheduler = Schedulers.test();
    return new DefaultLoadBalancerService(runtime, loadBalancerConfig, connector, loadBalancerStore, loadBalancerJobOperations, reconciler, validator, testScheduler);
}
Also used : NoOpLoadBalancerJobValidator(com.netflix.titus.api.loadbalancer.model.sanitizer.NoOpLoadBalancerJobValidator) LoadBalancerJobValidator(com.netflix.titus.api.loadbalancer.model.sanitizer.LoadBalancerJobValidator) LoadBalancerConnector(com.netflix.titus.api.connector.cloud.LoadBalancerConnector) V3JobOperations(com.netflix.titus.api.jobmanager.service.V3JobOperations) InMemoryLoadBalancerStore(com.netflix.titus.runtime.store.v3.memory.InMemoryLoadBalancerStore) NoOpLoadBalancerJobValidator(com.netflix.titus.api.loadbalancer.model.sanitizer.NoOpLoadBalancerJobValidator) TitusRuntime(com.netflix.titus.common.runtime.TitusRuntime) TestScheduler(rx.schedulers.TestScheduler) LoadBalancerStore(com.netflix.titus.api.loadbalancer.store.LoadBalancerStore) InMemoryLoadBalancerStore(com.netflix.titus.runtime.store.v3.memory.InMemoryLoadBalancerStore)

Aggregations

LoadBalancerConnector (com.netflix.titus.api.connector.cloud.LoadBalancerConnector)1 V3JobOperations (com.netflix.titus.api.jobmanager.service.V3JobOperations)1 LoadBalancerJobValidator (com.netflix.titus.api.loadbalancer.model.sanitizer.LoadBalancerJobValidator)1 NoOpLoadBalancerJobValidator (com.netflix.titus.api.loadbalancer.model.sanitizer.NoOpLoadBalancerJobValidator)1 LoadBalancerStore (com.netflix.titus.api.loadbalancer.store.LoadBalancerStore)1 TitusRuntime (com.netflix.titus.common.runtime.TitusRuntime)1 InMemoryLoadBalancerStore (com.netflix.titus.runtime.store.v3.memory.InMemoryLoadBalancerStore)1 TestScheduler (rx.schedulers.TestScheduler)1