@Test public void testExecute_logEvent_nullEventDate() throws Exception { setupForExpectedAssertionFailure("Event/date"); Event event = JeeMigrationExampleFixture.create_Event(); event.setDate(null); isExpectedValidationError = true; runTestExecute_logEvent(event); }
public static boolean validate(Event event) { if (event == null) return false; Validator validator = Validator.getValidator(); validator.notNull(event.getDate(), "\"Date\" must be specified"); validator.notEmpty(event.getMessage(), "\"Message\" must be specified"); boolean isValid = validator.isValid(); return isValid; }
public static Event clone(Event event) { if (event == null) return null; Event clone = create(); clone.setId(ObjectUtil.clone(event.getId())); clone.setDate(ObjectUtil.clone(event.getDate())); clone.setMessage(ObjectUtil.clone(event.getMessage())); return clone; }
public static String toString(Event event) { if (isEmpty(event)) return "Event: [uninitialized] " + event.toString(); String text = event.toString(); return text; }
public static boolean isEmpty(Event event) { if (event == null) return true; boolean status = false; status |= StringUtils.isEmpty(event.getMessage()); return status; }