On my spring boot application I want to override just one of my @Configuration classes with a test configuration (in particular my @EnableAuthorizationSer
You should use spring boot profiles:
@Profile("test").@Profile("production").spring.profiles.active=production.@Profile("test").So when your application starts it will use "production" class and when test stars it will use "test" class.
If you use inner/nested @Configuration class it will be be used instead of a your application’s primary configuration.