JobPlanner { ExecutionPlan getExecutionPlan() { return getExecutionPlan(null); } JobPlanner(ApplicationDescriptorImpl<? extends ApplicationDescriptor> descriptor); abstract List<JobConfig> prepareJobs(); static MapConfig generateSingleJobConfig(Map<String, String> userConfigs);  }
@Test public void testRunIdisConfiguredForAllTypesOfApps() { Map<String, String> testConfig = new HashMap<>(); testConfig.put("app.id", "should-exist-id"); testConfig.put("app.name", "should-exist-name"); ApplicationDescriptorImpl applicationDescriptor = Mockito.mock(ApplicationDescriptorImpl.class); Mockito.when(applicationDescriptor.getConfig()).thenReturn(new MapConfig(testConfig)); Mockito.when(applicationDescriptor.getAppClass()).thenReturn(LegacyTaskApplication.class); JobPlanner jobPlanner = new JobPlanner(applicationDescriptor) { @Override public List<JobConfig> prepareJobs() { return null; } }; ExecutionPlan plan = jobPlanner.getExecutionPlan("custom-run-id"); Assert.assertNotNull(plan.getApplicationConfig().getRunId(), "custom-run-id"); }