diff options
| author | Felix Kehrer <felix.kehrer@gmail.com> | 2018-05-25 20:51:19 +0200 | 
|---|---|---|
| committer | Tharre <tharre3@gmail.com> | 2018-05-27 14:07:11 +0200 | 
| commit | e192b737e3520d93149c44e83b35650eb333b105 (patch) | |
| tree | 2b719e05d8e090f7c07effe539acd3d08554f478 | |
| parent | 562838e0d6ae597c06122efb5db2a68d2e633cf2 (diff) | |
| download | sepm-groupproject-e192b737e3520d93149c44e83b35650eb333b105.tar.gz sepm-groupproject-e192b737e3520d93149c44e83b35650eb333b105.tar.xz sepm-groupproject-e192b737e3520d93149c44e83b35650eb333b105.zip  | |
added logging of validation errors #27033
| -rw-r--r-- | src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/dto/EmployeeValidator.java | 7 | 
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/dto/EmployeeValidator.java b/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/dto/EmployeeValidator.java index d7fa9aa..994be3f 100644 --- a/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/dto/EmployeeValidator.java +++ b/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/dto/EmployeeValidator.java @@ -1,20 +1,27 @@  package at.ac.tuwien.sepm.assignment.groupphase.einsatzverwaltung.dto;  import at.ac.tuwien.sepm.assignment.groupphase.exception.InvalidEmployeeException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory;  public class EmployeeValidator { +    private static final Logger LOG = LoggerFactory.getLogger(EmployeeValidator.class); +      public static boolean validate(Employee employee) throws InvalidEmployeeException {          if (employee.name() == null || employee.name().trim().length() == 0) { +            LOG.info("Invalid Employee: Name was not set");              throw new InvalidEmployeeException("name not set");          }          if (employee.birthday() == null) { +            LOG.info("Invalid Employee: Birthday was not set");              throw new InvalidEmployeeException("birthday not set");          }          if (employee.educationLevel() == null) { +            LOG.info("Invalid Employee: EducationLevel was not set");              throw new InvalidEmployeeException("educationLevel not set");          }  | 
