0

I am writing tests for camel in spring boot project, i want to exclude all the routes except the one that i want to test.

So below i want to test the "ftp-poller", i have split the routes into seperate files, but it still loads all the routes, i dont understand is it possible to only load one route or is it becuase they are linked its not possible

@Component
public class FTPRoute extends RouteBuilder {
    XmlJsonDataFormat xmlJsonFormat = new XmlJsonDataFormat();

    @Override
    public void configure() throws Exception {

        from("{{endpoint.ftp.server}}")
                .id("ftp-poller")
                .log("Found file ${file:name}.")
                .to("{{endpoint.ftp2.server}}");


        from("{{endpoint.ftp2.server}}")
                .id("ftp-poller")
                .log("Found file ${file:name}.")
                .to("{{endpoint.local.validation}}");


    }
}


@RunWith(CamelSpringBootRunner.class)
@SpringBootTest(classes = {intTest.class},
        properties = { "camel.springboot.java-routes-include-pattern=**/FTPRoute*"})
public class FTPRouteTest {

    @Autowired
    protected ProducerTemplate producerTemplate;

    @EndpointInject(uri = "{{endpoint.requestbin}}")
    protected MockEndpoint requestbinEndpoint;

    @EndpointInject(uri = "{{endpoint.local.error}}")
    protected MockEndpoint localErrorEndpoint;

    @Before
    public void cleanDir() throws Exception {
        deleteDirectory("hb");
    }


}
pvpkiran
  • 25,582
  • 8
  • 87
  • 134
user1555190
  • 2,803
  • 8
  • 47
  • 80
  • what is initTest.class? can't you add that code. Check this out.. https://dzone.com/articles/spring-boot-and-apache-camel – pvpkiran Jul 23 '18 at 14:56
  • its just a spring boot start up class. Jsut a simple class with a main method. nothing special – user1555190 Jul 26 '18 at 09:00
  • @pvpkiran i looked at that link, i am currently doing what is states, however i want to just start one route for my test, i currently have 12 interconnected routes, and id rather have them all starting. is it possible? – user1555190 Jul 26 '18 at 09:03

0 Answers0