See IDE instructions for details on how to use IntelliJ IDEA or Visual Studio Code.
We plan to provide a table that gives an overview here, with links to API doc as well as a tutorial that explains how they work (future work).
You can send a test request to the application or use the Spring Boot Admin application.
Run the application with mvn spring-boot:run
and then check the state with curl --header 'Authorization: Bearer b318ad736c6c844b' http://localhost:8110/customers?limit=1
(after the application has started). The curl command should return a customer:
{
"filter" : "",
"limit" : 1,
"offset" : 0,
"size" : 50,
"customers" : [ {
"customerId" : "bunlo9vk5f",
"firstname" : "Ado",
"lastname" : "Kinnett",
...
Curl command: curl http://localhost:8100/customers?limit=1
Expected result:
{
"filter" : "",
"limit" : 1,
"offset" : 0,
"size" : 50,
"customers" : [ {
"customerId" : "bunlo9vk5f",
"firstname" : "Ado",
"lastname" : "Kinnett",
"birthday" : "1975-06-13T22:00:00.000+0000",
"streetAddress" : "2 Autumn Leaf Lane",
"postalCode" : "6500",
"city" : "Bellinzona",
"email" : "akinnetta@example.com",
"phoneNumber" : "055 222 4111",
"moveHistory" : [ ]
} ]
}
Curl command: curl --header 'Authorization: Bearer b318ad736c6c844b' http://localhost:8080/cities/8640
Expected result:
{
"cities" : [ "Hurden", "Rapperswil SG" ]
}
Curl command: curl --header 'Authorization: Bearer b318ad736c6c844b' http://localhost:8090/policies
Expected result:
{
"limit" : 10,
"offset" : 0,
"size" : 1,
"policies" : [ {
"policyId" : "fvo5pkqerr",
"customer" : "rgpp0wkpec",
"creationDate" : "2020-09-04T08:53:03.431+0000",
"policyPeriod" : {
"startDate" : "2018-02-04T23:00:00.000+0000",
"endDate" : "2018-02-09T23:00:00.000+0000"
},
...
All Spring Boot backends also offer an /actuator/health
endpoint that returns whether the service is UP or not:
curl http://localhost:8110/actuator/health
{
"status" : "UP"
}
Don't worry if you're getting an exception about a refused connection on startup:
2018-11-16 13:31:08.492 WARN 1592 --- [gistrationTask1] d.c.b.a.c.r.ApplicationRegistrator : Failed to register application as Application(name=Customer Self-Service Backend, managementUrl=http://localhost:8080/actuator, healthUrl=http://localhost:8080/actuator/health, serviceUrl=http://localhost:8080/, metadata={startup=2018-11-16T13:31:02.779+01:00}) at spring-boot-admin ([http://localhost:9000/instances]): I/O error on POST request for "http://localhost:9000/instances": Connection refused: connect; nested exception is java.net.ConnectException: Connection refused: connect. Further attempts are logged on DEBUG level
This just means that the application was unable to connect to the Spring Boot Admin application. If you haven't started the Spring Boot Admin, the warning can be safely ignored.
The DTO (data transfer object) classes require a lot of repetitive code (e.g., getters, setters, code to map between entities and DTOs, etc). We could use a code generator like Lombok to get rid of this boilerplate. However, we decided against using a tool like this, because they usually require additional IDE plug-ins which complicates the initial setup process.