A sample application built with Dropwizard.io
Requirements to run this app:
- Java 11
- Maven 3.6.x
mvn test
MySQL database setup (with Docker):
docker-compose up -d
docker exec -it dropwizard-sample-app_db_1 mysql -u root -proot -e "create database db_notes_test;"
Run migrations:
mvn package
java -jar target/sample-app-1.0-SNAPSHOT.jar db migrate src/test/resources/configuration-integration-test.yml
Run integration-test:
mvn failsafe:integration-test
Create the package
mvn package
MySQL database setup (with Docker):
docker-compose up -d
docker exec -it dropwizard-sample-app_db_1 mysql -u root -proot -e "create database db_notes;"
Run migrations:
mvn package
java -jar target/sample-app-1.0-SNAPSHOT.jar db migrate configuration.yml
Run application:
java -jar target/sample-app-1.0-SNAPSHOT.jar server configuration.yml
curl -X POST http:https://localhost:8080/notes --data "Hello world"
curl -X POST http:https://localhost:8080/notes --data "This is a sample application"
curl http:https://127.0.0.1:8080/notes/
curl http:https://127.0.0.1:8080/notes/1
curl http:https://127.0.0.1:8080/notes/2
Requirements (Vagrant 1.8.1 or above):
Vagrant plugins:
- vagrant-berkshelf
- vagrant-cachier
- vagrant-omnibus
vagrant up
Requirements:
- Chef-dk 0.10.0
cd cookbooks/sample-app
Run unit tests
chef exec rspec
Run integration test
kitchen create
kitchen converge
kitchen verify
kitchen destroy
Abbrv.
kitchen test