With the release of WoW Classic Hardcore servers, five adventurers will team up to reach level 60 safely. They will be broadcasting their adventure on a joint stream, and each one of them will be posting daily records in this blog. Enjoy the adventure!
This is a Spring Boot 3.1 Microservice that builds with Maven and runs on JDK 17.
- H2 Database - In memory database.
- Lombok - Helps reducing boilerplate code.
- MapStruct - Helps with mapping operations.
- Mockito - To isolate unit testing.
- PITest - To perform mutation testing.
This Microservice runs an embedded Apache Tomcat server on port 8080. Make sure the aforementioned port is available before starting this Microservice.
There are two ways of starting this Microservice, both via Maven.
Generate a .jar artifact using following Maven command within project folder:
mvn clean install
This will generate a .jar artifact on target folder. Now run the artifact using the following Java command:
java -jar [JAR_FILE_PATH]
Or simply run the Microservice by running Spring Boot Maven script using the following Maven command within project folder:
mvn spring-boot:run
After successfully starting the Microservice, you should be able to access its resources. You can do it by performing HTTP requests using a tool like Postman / Insomnia, or a command like CURL. Below there are some examples of the resources you can use:
Find all Authors:
Find an Author:
Create an Author:
{
"name": "Test",
"email": "[email protected]"
}
Update an Author:
{
"name": "Test Changed",
"email": "[email protected]"
}
Delete an Author:
Find all Posts:
Find a Post:
Create a Post:
{
"title": "First Post",
"content": "Content of first post.",
"postedOn": "2023-08-20T15:01:02.000000000Z",
"authorId": 1
}
Update a Post:
{
"title": "Title changed",
"content": "Content changed"
}
Delete a Post:
PITest is included in project, and can be run through following Maven goal:
mvn test-compile org.pitest:pitest-maven:mutationCoverage
Alternatively, there is a profile that can be used as follows:
mvn clean install -P mutation-all
This will output an html report to target/pit-reports/.
You can access H2 console by accessing the following URL through your browser:
Find the correct JDBC URL in logs.