Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Tip

If you want to test that all routes will be successfully initialized in Camel then use the following test. This test mainly checks that all routes have unique ID and URI.

 

Code Block
/**
 * Test that verifies if all Camel routes are correctly initialized - if there are unique route IDs and unique URIs.
 *
 * @author <a href="mailto:petr.juza@openwise.com">Petr Juza</a>
 */
public class RoutesInitTest extends AbstractModulesDbTest {
    @BeforeClass
    public static void setInitAllRoutes() {
        setInitAllRoutes(true);
    }
    @Test
    public void testInit() {
        // nothing to do - if all routes are successfully initialized then test is OK
        System.out.println("All routes were successfully initialized");
    }
}

...


Annotations order is important

We use quite often annotations type of @ConditionalXXX or @AutoConfigureAfter/Before. Annotations @ConditionalOnBean/MissingBean/Class/MissingClass works quite fine but @AutoConfigureAfter/Before don't work at all.

...