0

我正在为 spring boot 项目中的骆驼编写测试,我想排除除我要测试的路线之外的所有路线。

所以在下面我想测试“ftp-poller”,我已经将路由拆分为单独的文件,但它仍然加载所有路由,我不明白是否可以只加载一个路由或者是因为它们链接它不是可能的

@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");
    }


}
4

0 回答 0