This is a project template with all libraries required in order to create a REST based aplication
There are some configurat you need to add to local environment before runnin g the application
- Add
artifactory_user&artifactory_passwordas environment variable environmet variable - Run SQL scripts to load
database, you can get a copy from administrator
- Required sofware
- Postgresql
From a terminal:
$ ./gradlew bootRun -- args='-- spring.profiles.active=dev'
You need to install docker in your local machine
$ ./gradlew clean build
$ docker build -t myapp/spring-example .
$ docker run -d -p 8080:8082 myapp/spring-example --spring.profiles.active=dev --DS_DB_URL=jdbc:postgresql://host.docker.internal:5432/example --server.port=8082
In docker run we are mapping from 8082 to 8080 port so after running docker run you should be able to access to:
http://localhost:8080/example-demo/app/greeting
and thre mock response will be shown
{
"greeting": "Hi, from secured endpoint"
}
There are two kind of tests you may want to run
$ ./gradlew clean test jacocoTestReport jacocoTestCoverageVerification
In order to run this tests you need to run the spring application before,and then type in a terminal
$ ./gradlew integrationTest