MyriadOperations { public Integer getFlexibleInstances(String taskPrefix) { return this.schedulerState.getActiveTaskIds(taskPrefix).size() + this.schedulerState.getStagingTaskIds(taskPrefix).size() + this.schedulerState.getPendingTaskIds(taskPrefix).size(); } @Inject  MyriadOperations(MyriadConfiguration cfg, SchedulerState schedulerState,
      NodeScaleDownPolicy nodeScaleDownPolicy, MyriadDriverManager driverManager,
      MyriadWebServer myriadWebServer, RMContext rmContext); void flexUpCluster(ServiceResourceProfile serviceResourceProfile, int instances, Constraint constraint); void flexDownCluster(ServiceResourceProfile serviceResourceProfile, Constraint constraint, int numInstancesToScaleDown); void flexUpAService(int instances, String serviceName); void flexDownAService(int numInstancesToScaleDown, String serviceName); Integer getFlexibleInstances(String taskPrefix); void shutdownFramework();  }
@Test public void testGetFlexibleInstances() throws Exception { MyriadOperations ops = initialize(); ops.flexUpAService(1, "jobhistory"); assertEquals(1, ops.getFlexibleInstances("jobhistory").intValue()); }