Codebase for the blog post #HOWTO: Intercept method calls using CDI interceptors
Steps to run this project:
- Clone this Git repository
- Navigate to the folder
intercept-methods-with-cdi-interceptors
- Start your Docker daemon
- Execute
buildAndRun.bat
(Windows) orbuildAndRun.sh
(chmod +X ./buildAndRun.sh
required, Linux & Mac) - Wait until the container is up and running
- Access http://localhost:8080/resources/payments/mike in your browser and you should get HTTP 400
- Access http://localhost:8080/resources/payments/mike with HTTP header
X-Secure-Payment
(either use Postman or curl) and you should get HTTP 200 - Access http://localhost:8080/resources/payments/duke with HTTP header
X-Secure-Payment
(either use Postman or cURL) and you should get HTTP 200 and you should see the manipulated amount in the logs
curl -XGET http://localhost:8080/resources/payments/mike
curl -XGET --header "X-Secure-Payment: true" http://localhost:8080/resources/payments/mike
curl -XGET --header "X-Secure-Payment: true" http://localhost:8080/resources/payments/duke