use of com.twitter.heron.scheduler.mesos.framework.MesosFramework in project heron by twitter.
the class MesosSchedulerTest method before.
@Before
public void before() throws Exception {
Config config = Mockito.mock(Config.class);
Mockito.when(config.getStringValue(Key.TOPOLOGY_NAME)).thenReturn(TOPOLOGY_NAME);
Mockito.when(config.getStringValue(Key.ROLE)).thenReturn(ROLE);
Mockito.when(config.getStringValue(Key.CORE_PACKAGE_URI)).thenReturn(CORE_PACKAGE_URI);
Config runtime = Mockito.mock(Config.class);
Mockito.when(runtime.getLongValue(Key.NUM_CONTAINERS)).thenReturn(NUM_CONTAINER);
Properties properties = new Properties();
properties.put(Key.TOPOLOGY_PACKAGE_URI.value(), TOPOLOGY_PACKAGE_URI);
Mockito.when(runtime.get(Key.SCHEDULER_PROPERTIES)).thenReturn(properties);
mesosFramework = Mockito.mock(MesosFramework.class);
SchedulerDriver driver = Mockito.mock(SchedulerDriver.class);
baseContainer = Mockito.mock(BaseContainer.class);
scheduler = Mockito.spy(MesosScheduler.class);
Mockito.doReturn(mesosFramework).when(scheduler).getMesosFramework();
Mockito.doReturn(driver).when(scheduler).getSchedulerDriver(Mockito.anyString(), Mockito.eq(mesosFramework));
Mockito.doNothing().when(scheduler).startSchedulerDriver();
scheduler.initialize(config, runtime);
}
Aggregations