Testing security
You can clone the code and build it using the following command:
Run it from project home $ gradlew clean build
This code is tested with Java 15.
Important
Make sure to generate the keys again, as keys generated by the JDK keytool are only valid for 90 days.
Then, you can run the application from your project home, as shown in the following code snippet:
$ java -jar build/libs/Chapter06-0.0.1-SNAPSHOT.jar
Now, you must be looking forward to testing. Let's test our first use case.
Let's hit the GET /api/vi/addresses
API without the Authorization
header, as shown in the following code snippet:
$ curl -v 'http://localhost:8080/api/v1/addresses' -H 'Content-Type: application/json' -H 'Accept: application/json' < HTTP/1.1 401 < Vary: Origin < Vary: Access-Control-Request-Method < Vary: Access-Control-Request-Headers < WWW-Authenticate: Bearer < X-Content-Type-Options: nosniff < X-XSS...