WiremockExample

Simple project to demonstrate wiremock utilization.

This project contains 2 microservices.

Service 1 - Schools

Service 2 - Teacher


Note:

  • The endpoint "/teachers/{id}/schools" of teacher-service depens on school-services to retrieve schools information. Therefore, if the school-service is not available, we can use the wiremock to simulate school-service responses.

  • How to run?

School-service:

  • Access the "school-service" folder, and run the comand below to start a docker container with MySQL.

$docker-compose up

  • Inside your IDE, run the SchoolServiceApplication, the microservice will be available on port 4000, you can change the port number by application.properties

Teacher-service:

  • There are two ways to run this service.

If you don't need the Wiremock. Access the "teacher-service" folder, and run the comand below to start a docker container with MySQL.

$docker-compose up

  • Inside your IDE, run the SchoolServiceApplication, the microservice will be available on port 4000, you can change the port number by application.properties

If you need the Wiremock simulation. Access the "teacher-service" folder, and run the comand below to start a docker container with MySQL.

$docker-compose -f docker-compose-wiremock.yml up

The wiremock will be available on port 9090.