diff --git a/hapi-fhir-jpaserver-model/src/test/java/ca/uhn/fhir/jpa/model/interceptor/executor/InterceptorServiceTest.java b/hapi-fhir-jpaserver-model/src/test/java/ca/uhn/fhir/jpa/model/interceptor/executor/InterceptorServiceTest.java index d7878b0582d..57140d72be7 100644 --- a/hapi-fhir-jpaserver-model/src/test/java/ca/uhn/fhir/jpa/model/interceptor/executor/InterceptorServiceTest.java +++ b/hapi-fhir-jpaserver-model/src/test/java/ca/uhn/fhir/jpa/model/interceptor/executor/InterceptorServiceTest.java @@ -201,8 +201,10 @@ public class InterceptorServiceTest { @ComponentScan(basePackages = "ca.uhn.fhir.jpa.model") static class InterceptorRegistryTestCtxConfig { - @Autowired - private IInterceptorRegistry myInterceptorRegistry; + @Bean + public InterceptorService interceptorService() { + return new InterceptorService("test"); + } /** * Note: Orders are deliberately reversed to make sure we get the orders right @@ -211,7 +213,7 @@ public class InterceptorServiceTest { @Bean public MyTestInterceptorTwo interceptor1() { MyTestInterceptorTwo retVal = new MyTestInterceptorTwo(); - myInterceptorRegistry.registerInterceptor(retVal); + interceptorService().registerInterceptor(retVal); return retVal; } @@ -222,7 +224,7 @@ public class InterceptorServiceTest { @Bean public MyTestInterceptorOne interceptor2() { MyTestInterceptorOne retVal = new MyTestInterceptorOne(); - myInterceptorRegistry.registerInterceptor(retVal); + interceptorService().registerInterceptor(retVal); return retVal; }