- In the root dir is the archive dir with contains files like EmailMessage.1648259499154.json. Each file represents a single email that was sent. The number in the name is a timestamp. There are some of these files in the zip.
- application.properties has gmail email config info for one if my old gmail accts.
- Request headers and request body are validated via @RequestHeader and @RequestBody markup (in the controller) such as @Email, @NotEmpty, and @Pattern.
- ConstraintViolationExceptions that come from the validation in #3 above are transformed from 500 internal server errors to 400 Bad Request errors via @ExceptionHandler in the controller.
- The urls are, 1) http://localhost:8080/send-email which is a POST and takes 4 headers From, To, Subject, and DateSent. All are required, DateSent format is mm/dd/yyyy. Validation errors are json format. 2) is http://localhost:8080/email-history which has no header or parms and returns an array of json objects like this: [{"to":"[email protected]","from":"[email protected]","subject":" ","message":"This is the email message","date":"03/28/2022", . . . ]} which are derived from the EmailMessage.1648259499154.json files.
- I implemented a log4jh2 logger.
I couldn't complete JUnit 5 tests or mockups. I got stuck here. There is one trivial email service test but that's it. I tried a lot of things to get controller testing done but couldn't get a clean build or had many different runtime exceptions. Probably should have stuck with JUnit 4.
I used IntelliJ