use of com.netflix.conductor.core.config.SystemPropertiesConfiguration in project conductor by Netflix.
the class TestKafkaPublishTask method missingValue_Fail.
@Test
public void missingValue_Fail() {
Task task = new Task();
KafkaPublishTask.Input input = new KafkaPublishTask.Input();
input.setBootStrapServers("localhost:9092");
input.setTopic("testTopic");
task.getInputData().put(KafkaPublishTask.REQUEST_PARAMETER_NAME, input);
KafkaPublishTask kPublishTask = new KafkaPublishTask(new SystemPropertiesConfiguration(), new KafkaProducerManager(new SystemPropertiesConfiguration()), objectMapper);
kPublishTask.start(Mockito.mock(Workflow.class), task, Mockito.mock(WorkflowExecutor.class));
Assert.assertEquals(Task.Status.FAILED, task.getStatus());
}
use of com.netflix.conductor.core.config.SystemPropertiesConfiguration in project conductor by Netflix.
the class TestKafkaPublishTask method kafkaPublishUnknownException_Fail.
@Test
public void kafkaPublishUnknownException_Fail() throws ExecutionException, InterruptedException {
Task task = getTask();
KafkaProducerManager producerManager = Mockito.mock(KafkaProducerManager.class);
KafkaPublishTask kPublishTask = new KafkaPublishTask(new SystemPropertiesConfiguration(), producerManager, objectMapper);
Producer producer = Mockito.mock(Producer.class);
Mockito.when(producerManager.getProducer(Mockito.any())).thenReturn(producer);
Mockito.when(producer.send(Mockito.any())).thenThrow(new RuntimeException("Unknown exception"));
kPublishTask.start(Mockito.mock(Workflow.class), task, Mockito.mock(WorkflowExecutor.class));
Assert.assertEquals(Task.Status.FAILED, task.getStatus());
Assert.assertEquals("Failed to invoke kafka task due to: Unknown exception", task.getReasonForIncompletion());
}
use of com.netflix.conductor.core.config.SystemPropertiesConfiguration in project conductor by Netflix.
the class TestKafkaPublishTask method missingRequest_Fail.
@Test
public void missingRequest_Fail() {
KafkaPublishTask kPublishTask = new KafkaPublishTask(new SystemPropertiesConfiguration(), new KafkaProducerManager(new SystemPropertiesConfiguration()), objectMapper);
Task task = new Task();
kPublishTask.start(Mockito.mock(Workflow.class), task, Mockito.mock(WorkflowExecutor.class));
Assert.assertEquals(Task.Status.FAILED, task.getStatus());
}
use of com.netflix.conductor.core.config.SystemPropertiesConfiguration in project conductor by Netflix.
the class ServletContextListener method getInjector.
@Override
protected Injector getInjector() {
loadProperties();
SystemPropertiesConfiguration config = new SystemPropertiesConfiguration();
serverInjector = Guice.createInjector(new ModulesProvider(config).get());
return serverInjector;
}
use of com.netflix.conductor.core.config.SystemPropertiesConfiguration in project conductor by Netflix.
the class TestSystemTaskExecutor method testGetExecutionConfigForIsolatedSystemTask.
@Test
public void testGetExecutionConfigForIsolatedSystemTask() {
System.setProperty("workflow.isolated.system.task.worker.thread.count", "7");
Configuration configuration = new SystemPropertiesConfiguration();
systemTaskExecutor = new SystemTaskExecutor(queueDAO, workflowExecutor, configuration, executionService);
assertEquals(systemTaskExecutor.getExecutionConfig("test-iso").getSemaphoreUtil().availableSlots(), 7);
}
Aggregations