@Bean @Primary public MyService myTestService() { return ... // create service applicable in test environment }