User Management RESTApi application demo
cd into top directory of the project where the docker-compose.yml is located in and execute:
mvn clean install
docker-compose up
The api spec doc(OpenAPI) will be generated/updated into directory of ${project-root}/docs after successfully build. Another way to view api spec online once you started services by commaond: docker-compose up.
http://docker-app-host:8000/api/swagger-ui/index.html#/
http://docker-app-host:8000/v3/api-docs
http://docker-app-host:8001/api/swagger-ui/index.html#/
http://docker-app-host:8001/v3/api-docs
you can run test by executing:
mvn test
Source code:
Cucumber Feature Spec:
Please replace the docker-app-host with the actual ip address of your docker. See the example below:
192.168.9.10 docker-app-host
curl -v -X POST docker-app-host:8000/api/users -d "{\"id\": \"user1\",\"firstName\": \"FirstName\",\"lastName\": \"LastName\",\"email\": \"[email protected]\"}" -H "Content-Type:application/json"
curl -v docker-app-host:8000/api/users?page=0
curl -v docker-app-host:8000/api/users/user1
curl -v -X PUT docker-app-host:8000/api/users/user1 -d "{\"email\": \"[email protected]\"}" -H "Content-Type:application/json"
curl -v -X DELETE docker-app-host:8000/api/users?users=user1,user2
curl -v docker-app-host:8001/api/events?page=0