Menu
  • HOME
  • TAGS

Spring integration errorChannel no messages in JUnit

error-handling,junit4,spring-integration,spring-junit

The ErrorMessage with an Exception is thrown to the error-channel only if the downstream flow is within the separate Thread. Otherwise the Exception is rethrown to the call. It is thrown to the caller anyway, but shifted to the error-channel, if there is no original caller control from Spring Integration....

No bean named 'org.springframework.context.annotation.ConfigurationClassPostProcessor.importRegistry' is defined

spring,junit,dependency-injection,spring-test,spring-junit

When you annotate a test class or test method with @DirtiesContext, you are telling Spring to close the ApplicationContext after that test class or method. Thus, if you later attempt to retrieve a bean from a closed context you will get an exception like you're seeing. My guess is that...

Spring Junit with session object - not visible in Controller

java,spring,session,junit,spring-junit

I don't think Spring can automatically link a MockHttpSession (I also don't know where you're autowiring it from). You can add it manually. RequestBuilder requestBuilder = MockMvcRequestBuilders.post("/setSomeType") .param("someType", "ACCESS_ONLY") .accept(MediaType.parseMediaType("application/json;charset=UTF-8")) .session(session); Alternatively, you can use sessionAttr(String, Object) to add session attributes individually....

Why I am getting java.lang.NoSuchMethodError while running spring based camel junit test case

junit,apache-camel,spring-junit

You need to use Spring 4.0.x with Camel 2.14.x when using camel-test-spring as it does not support Spring 4.1. Support for Spring 4.1 is coming in Camel 2.15, where there is now 2 spring test modules camel-test-spring40 - for Spring 4.0.x camel-test-spring - for Spring 4.1 onwards This is also...

Autowire a Spring service in JUnit test

java,spring,junit,spring-junit

Add the following annotation to MyApplicationContext for the service to be scanned @ComponentScan("myservice.package.name")