- Liberty "dev mode"
- MicroShed Boost
- MicroShed Testing
# One time setup
./setup.sh
mvn install -DboostRuntime=ol -Dboost_db_serverName=localhost -Dboost_db_portNumber=5432 -Dboost_db_password=test -Dboost_db_databaseName=test -Dboost_db_user=test
- Start dev mode with:
mvn liberty:dev -DboostRuntime=ol -Dboost_db_serverName=localhost -Dboost_db_portNumber=5432 -Dboost_db_password=test -Dboost_db_databaseName=test -Dboost_db_user=test
-
In a browser, go to
http://localhost:9080/openapi/ui
to view the OpenAPI UI which is now available. -
In the Java file
src/main/java/org/eclipse/microprofile/system/test/app/PersonService.java
, add the following annotations above thegetAllPeople()
method:
@APIResponse(
responseCode = "200",
description = "All of people that have been added.",
content = @Content(
mediaType = "application/json",
schema = @Schema(
type = SchemaType.OBJECT,
implementation = Person.class)))
@Operation(
summary = "Get all people.",
description = "Returns all of the people that have been added.")
-
Save the file. Notice the console shows compilation errors because imports were not added.
-
Add the following imports:
import org.eclipse.microprofile.openapi.annotations.Operation;
import org.eclipse.microprofile.openapi.annotations.enums.SchemaType;
import org.eclipse.microprofile.openapi.annotations.media.Content;
import org.eclipse.microprofile.openapi.annotations.media.Schema;
import org.eclipse.microprofile.openapi.annotations.responses.APIResponse;
-
Save the file. Notice the console shows compilation was successful and the application gets updated.
-
In a browser, go to
http://localhost:9080/openapi/ui
, expandGET
/people
, and notice the summary, description, and200
response code which has been added.
-
Above the method
getAllPeople()
, delete the@GET
annotation. -
Save the file. Notice the console shows compilation was successful.
-
In the console, press Enter to run tests. Notice a test has an error.
-
Above the method
getAllPeople()
, restore the@GET
annotation. -
Save the file. Notice the console shows compilation was successful.
-
In the console, press Enter to run tests. Notice the tests pass.
-
Inside the method
getAllPeople()
, set a breakpoint. -
In your IDE, attach a debugger to port
7777
. -
In your browser, go to http://localhost:9080/myservice/people.
-
Notice your IDE pauses at the breakpoint that you set, allowing you to debug.
-
Disconnect the debugger.
- Boost is used to configure the application to use a DB.
- The integration tests are written using MicroShed Testing with PostgreSQL in container as a shared dependency.