use of org.apache.samza.application.descriptors.ApplicationDescriptorImpl in project samza by apache.
the class TestTaskFactoryUtil method testGetTaskFactoryWithInvalidAddDescriptorImpl.
// test getTaskFactory with invalid ApplicationDescriptorImpl
@Test(expected = IllegalArgumentException.class)
public void testGetTaskFactoryWithInvalidAddDescriptorImpl() {
ApplicationDescriptorImpl mockInvalidApp = mock(ApplicationDescriptorImpl.class);
TaskFactoryUtil.getTaskFactory(mockInvalidApp);
}
use of org.apache.samza.application.descriptors.ApplicationDescriptorImpl in project samza by apache.
the class TestJobPlanner method testRunIdisConfiguredForAllTypesOfApps.
@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");
}
Aggregations