May 28, 2022
Thanks @Vikash !
For testing i believe the spring-security-test package should help. Found some resources that could help you -
1. Maven library - https://mvnrepository.com/artifact/org.springframework.security/spring-security-test/5.7.1
2. Test examples - https://docs.spring.io/spring-security/site/docs/5.2.x/reference/html/test.html
You'll have to explore the library further to test the response header scenario specifically.
Regards,
Boudhayan Dev