I finally got my JUnit-Tests working and the properties are correctly
injected now. I did it with a lot of annotations:
@RunWith(CamelSpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = MyServiceTests.class)
@ActiveProfiles("test")
@EnableAutoConfiguration
@ComponentScan
@MockEndpointsAndSkip(value = "spring-ws:*")
public class MyServiceTests extends TestCase {
...
}
Also I added the following dependency:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j</artifactId>
<version>1.2.7.RELEASE</version>
</dependency>
Furthermore the property-file must be in the classpath and must named
application-test.properties. With this configuration I needn't the static
inner class TestConfig anymore. The solution is described here:
http://tech.willhaben.at/2015/10/testing-apache-camel-applications-with.html
Nevertheless I would like to log a JIRA ticket and I'm looking forward to a
camel-test-spring module, for a more lean solution.
Thanks for your effort, Claus.
--
View this message in context:
http://camel.465427.n5.nabble.com/How-to-get-properties-working-in-camelTest-and-spring-tp5774102p5774298.html
Sent from the Camel - Users mailing list archive at Nabble.com.