Search in sources :

Example 1 with EvictionDataReplicator

use of com.netflix.titus.runtime.connector.eviction.EvictionDataReplicator in project titus-control-plane by Netflix.

the class RelocationConnectorStubs method getApplicationContext.

public ApplicationContext getApplicationContext() {
    StaticApplicationContext context = new StaticApplicationContext();
    context.getBeanFactory().registerSingleton("titusRuntime", titusRuntime);
    context.getBeanFactory().registerSingleton("nodeDataResolver", nodeDataResolver);
    context.getBeanFactory().registerSingleton("readOnlyJobOperations", jobOperations);
    context.getBeanFactory().registerSingleton("readOnlyEvictionOperations", evictionComponentStub.getEvictionOperations());
    context.getBeanFactory().registerSingleton("evictionServiceClient", evictionComponentStub.getEvictionServiceClient());
    context.getBeanFactory().registerSingleton("jobManagementClient", mock(JobManagementClient.class));
    JobDataReplicator jobDataReplicator = mock(JobDataReplicator.class);
    when(jobDataReplicator.getStalenessMs()).thenReturn(0L);
    context.getBeanFactory().registerSingleton("jobDataReplicator", jobDataReplicator);
    EvictionDataReplicator evictionDataReplicator = mock(EvictionDataReplicator.class);
    when(evictionDataReplicator.getStalenessMs()).thenReturn(0L);
    context.getBeanFactory().registerSingleton("evictionDataReplicator", evictionDataReplicator);
    context.refresh();
    return context;
}
Also used : JobDataReplicator(com.netflix.titus.runtime.connector.jobmanager.JobDataReplicator) EvictionDataReplicator(com.netflix.titus.runtime.connector.eviction.EvictionDataReplicator) StaticApplicationContext(org.springframework.context.support.StaticApplicationContext) JobManagementClient(com.netflix.titus.runtime.connector.jobmanager.JobManagementClient)

Aggregations

EvictionDataReplicator (com.netflix.titus.runtime.connector.eviction.EvictionDataReplicator)1 JobDataReplicator (com.netflix.titus.runtime.connector.jobmanager.JobDataReplicator)1 JobManagementClient (com.netflix.titus.runtime.connector.jobmanager.JobManagementClient)1 StaticApplicationContext (org.springframework.context.support.StaticApplicationContext)1