use of org.apache.samza.application.TaskApplication in project samza by apache.
the class TestTaskApplicationDescriptorImpl method testProcessorLifecycleListener.
@Test
public void testProcessorLifecycleListener() {
ProcessorLifecycleListenerFactory mockFactory = mock(ProcessorLifecycleListenerFactory.class);
TaskApplication testApp = appDesc -> {
appDesc.withProcessorLifecycleListenerFactory(mockFactory);
};
TaskApplicationDescriptorImpl appDesc = new TaskApplicationDescriptorImpl(testApp, config);
assertEquals(appDesc.getProcessorLifecycleListenerFactory(), mockFactory);
}
use of org.apache.samza.application.TaskApplication in project samza by apache.
the class TestTaskApplicationDescriptorImpl method testApplicationContainerContextFactory.
@Test
public void testApplicationContainerContextFactory() {
ApplicationContainerContextFactory factory = mock(ApplicationContainerContextFactory.class);
TaskApplication testApp = appDesc -> appDesc.withApplicationContainerContextFactory(factory);
TaskApplicationDescriptorImpl appSpec = new TaskApplicationDescriptorImpl(testApp, mock(Config.class));
assertEquals(appSpec.getApplicationContainerContextFactory(), Optional.of(factory));
}
use of org.apache.samza.application.TaskApplication in project samza by apache.
the class TestTaskApplicationDescriptorImpl method testAddInputStreams.
@Test
public void testAddInputStreams() {
TaskApplication testApp = appDesc -> {
mockInputs.forEach(appDesc::withInputStream);
};
TaskApplicationDescriptorImpl appDesc = new TaskApplicationDescriptorImpl(testApp, config);
assertEquals(mockInputs.toArray(), appDesc.getInputDescriptors().values().toArray());
}
use of org.apache.samza.application.TaskApplication in project samza by apache.
the class TestTaskApplicationDescriptorImpl method testConstructor.
@Test
public void testConstructor() {
TaskApplication mockApp = mock(TaskApplication.class);
TaskApplicationDescriptorImpl appDesc = new TaskApplicationDescriptorImpl(mockApp, config);
verify(mockApp).describe(appDesc);
assertEquals(config, appDesc.getConfig());
}
use of org.apache.samza.application.TaskApplication in project samza by apache.
the class TestTaskApplicationDescriptorImpl method testApplicationTaskContextFactory.
@Test
public void testApplicationTaskContextFactory() {
ApplicationTaskContextFactory factory = mock(ApplicationTaskContextFactory.class);
TaskApplication testApp = appDesc -> appDesc.withApplicationTaskContextFactory(factory);
TaskApplicationDescriptorImpl appSpec = new TaskApplicationDescriptorImpl(testApp, mock(Config.class));
assertEquals(appSpec.getApplicationTaskContextFactory(), Optional.of(factory));
}
Aggregations