I am just starting a projects that combines Spring Boot and Apache Camel (what seems a very nice combination).
In regards of testing with JUnit 5 Google brings up this page. It suggests to use @CamelSpringTest if you want to have both the annotations from Spring and Camel (what i want).
At the and of the page there are suggestion for JUnit 4 Test migration that suggests:
Usage of @RunWith(CamelSpringRunner.class) should be replaced with @CamelSpringTest ... Usage of @RunWith(CamelSpringBootRunner.class) should be replaced with @CamelSpringBootTest
My question is for new project/ tests: What is the difference of both in regards of usage.
There is of course difference in code but i don't have a clue for what reason:
CamelSpringTest:
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.TYPE })
@ExtendWith(SpringExtension.class)
@BootstrapWith(CamelTestContextBootstrapper.class)
@TestExecutionListeners(
value = {
CamelSpringTestContextLoaderTestExecutionListener.class,
StopWatchTestExecutionListener.class
},
mergeMode = TestExecutionListeners.MergeMode.MERGE_WITH_DEFAULTS)
public @interface CamelSpringTest {
}
CamelSpringBootTest
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.TYPE })
@ExtendWith(SpringExtension.class)
@TestExecutionListeners(
value = {
CamelSpringTestContextLoaderTestExecutionListener.class,
CamelSpringBootExecutionListener.class,
StopWatchTestExecutionListener.class
},
mergeMode = TestExecutionListeners.MergeMode.MERGE_WITH_DEFAULTS)
public @interface CamelSpringBootTest {
}