How to use same beans in Test Configuration but with different attributes?

By : Glide

I have separate configuration classes that creates different beans per Spring Profile. I want my tests to simulate production code as much as possible so I want to use the same beans created under the Spring

By : Glide


Try something like this:

public class TestConfig {

    private SimpleRabbitListenerContainerFactory containerFactory;

    RetryOperationsInterceptor interceptor() {


        return interceptor;


This video can help you solving your question :)
By: admin