我正在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");
}
}