@Test
@Transactional
public void checkInvalidFieldNameDescriptionFields() {
WorkReportType workReportType = createValidWorkReportType();
DescriptionField descriptionFieldHead = createValidDescriptionField();
descriptionFieldHead.setFieldName("");
workReportType.addDescriptionFieldToEndHead(descriptionFieldHead);
try {
workReportTypeDAO.save(workReportType);
fail("It should throw an exception");
} catch (ValidationException e) {
}
descriptionFieldHead.setFieldName(null);
try {
workReportTypeDAO.save(workReportType);
fail("It should throw an exception");
} catch (ValidationException e) {
}
descriptionFieldHead.setFieldName("XXX");
try {
workReportTypeDAO.save(workReportType);
} catch (ValidationException e) {
fail("It should throw an exception");
}