use of com.netflix.titus.runtime.store.v3.memory.InMemoryLoadBalancerStore in project titus-control-plane by Netflix.
the class DefaultLoadBalancerJobValidatorTest method setUp.
@Before
public void setUp() throws Exception {
jobOperations = mock(V3JobOperations.class);
loadBalancerStore = new InMemoryLoadBalancerStore();
loadBalancerValidationConfiguration = mock(LoadBalancerValidationConfiguration.class);
loadBalancerValidator = new DefaultLoadBalancerJobValidator(jobOperations, loadBalancerStore, loadBalancerValidationConfiguration);
}
use of com.netflix.titus.runtime.store.v3.memory.InMemoryLoadBalancerStore in project titus-control-plane by Netflix.
the class DefaultLoadBalancerReconcilerTest method setUp.
@Before
public void setUp() throws Exception {
loadBalancerId = UUID.randomUUID().toString();
jobId = UUID.randomUUID().toString();
delayMs = 60_000L;
/* 1 min */
store = new InMemoryLoadBalancerStore();
connector = mock(LoadBalancerConnector.class);
when(connector.getLoadBalancer(loadBalancerId)).thenReturn(Single.just(new LoadBalancer(loadBalancerId, LoadBalancer.State.ACTIVE, Collections.emptySet())));
v3JobOperations = mock(V3JobOperations.class);
testScheduler = Schedulers.test();
reconciliationCount = new AtomicLong(0);
reconciler = new DefaultLoadBalancerReconciler(mockConfigWithDelay(delayMs), store, connector, new LoadBalancerJobOperations(v3JobOperations), () -> reconciliationCount.incrementAndGet(), new NoopRegistry(), testScheduler);
subscriber = reconciler.events().test();
}
use of com.netflix.titus.runtime.store.v3.memory.InMemoryLoadBalancerStore in project titus-control-plane by Netflix.
the class DefaultLoadBalancerServiceTest method setUp.
@Before
public void setUp() throws Exception {
runtime = TitusRuntimes.internal();
client = mock(LoadBalancerConnector.class);
loadBalancerStore = new InMemoryLoadBalancerStore();
reconciler = mock(LoadBalancerReconciler.class);
reconcilerEvents = PublishSubject.create();
when(reconciler.events()).thenReturn(reconcilerEvents.toSerialized());
v3JobOperations = mock(V3JobOperations.class);
loadBalancerJobOperations = new LoadBalancerJobOperations(v3JobOperations);
LoadBalancerValidationConfiguration validationConfiguration = LoadBalancerTests.mockValidationConfig(30);
validator = new DefaultLoadBalancerJobValidator(v3JobOperations, loadBalancerStore, validationConfiguration);
testScheduler = Schedulers.test();
}
use of com.netflix.titus.runtime.store.v3.memory.InMemoryLoadBalancerStore 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);
}
Aggregations