Saturday, May 14, 2016

Added hiphello to Github, SMTP testing

Hiphello.  Adding a quick note to say that I uploaded my Hello World version of JHipster, hiphello to Github.  Points of interest of the /jdl directory off the route that contains my jhipster-uml jdl model to kick start the app's entity model.  I also have an example of loading 1 row into each of my entities in the /src/main/resources/config/liquibase directory.

Docker.  By the way, a nice way to test this without having to stand up postgres (my db for the app) is to use docker.  If you have docker installed you simply type in the following commands:

./gradlew bootRepackage -Pprod buildDocker

docker-compose -f src/main/docker/app.yml up

Mail.  Another handy tool to test the mail capabilities is FakeSMTP. I ignored mail in my learning app until I needed to change a password.  I realized a quick way to to get this done was to have the change password email send out to drive the user (me) back in with the change password token.  FakeSMPT has a nice GUI to show incoming mail and display it or just watch an incoming mail directory that you specify.  Displaying the email for the GUI invokes your OS handler for files with a ".eml" extension.  In my case it kicked off MS Office's Outlook application which I haven't used for years and was hooked to my gmail account.  It then tried to pull ALL of my gmail mail.  Not good, be forewarned, know what .eml handling will do.  On another note, their is a docker file for FakeSMTP which by default fires up the server mode.  I wouldn't mind seeing FakeSMTP included in the jhipster generator and if I have an opportunity to figure out how to incorporate at a level that makes sense for the jhipster community, I may do the fork/pull request thing.

FakeSMTP Alternatives. @Fotozik on twitter alerted me to Maildev, a javascript/npm package that does essentially the same thing as FakeSMTP but uses a web page to show output emails.  Works nice with HTML email that JHipster kicks out. The Maildev code is at Github.  Installation:
npm install -g maildev
For unit testing the subethasmtp project has a subproject call Wiser.  Wiser allows you to start and test incoming smtp email in a unit test.

1 comment:

Christ_OFF said...

Thanks for the tips about FakeSMTP and Wiser