use of com.netflix.conductor.common.metadata.events.EventHandler in project conductor by Netflix.
the class EventHandlerTest method testWorkflowTaskName.
@Test
public void testWorkflowTaskName() {
// name is null
EventHandler taskDef = new EventHandler();
ValidatorFactory factory = Validation.buildDefaultValidatorFactory();
Validator validator = factory.getValidator();
Set<ConstraintViolation<Object>> result = validator.validate(taskDef);
assertEquals(3, result.size());
List<String> validationErrors = new ArrayList<>();
result.forEach(e -> validationErrors.add(e.getMessage()));
assertTrue(validationErrors.contains("Missing event handler name"));
assertTrue(validationErrors.contains("Missing event location"));
assertTrue(validationErrors.contains("No actions specified. Please specify at-least one action"));
}
Aggregations