1
我有一个文件传输路由。在这之间,我必须插入审计表并记录一些最基本的信息。路线工作正常,但我无法做骆驼单元测试。骆驼单元测试用例问题
public class EobRequestTest extends CamelBlueprintTestSupport {
@Test
public void testRoute() throws Exception {
MockEndpoint mock = getMockEndpoint("file:{{outBound.ftp.url}}");
mock.expectedMessageCount(1);
template.sendBody("file:{{intBound.ftp.url}}", getInputFile());
mock.assertIsSatisfied();
}
@Override
public String isMockEndpoints(){
return "*";
}
private File getInputFile() throws Exception {
return FileUtils.getFile("src", "test", "resources","test.xml");
}
}
现在,当我运行上述测试用例时,我将提到的文件“test.xml”转移到原始输出文件夹中。所有的数据库操作也被执行。 我试图用isMockEndpointsAndSkip而不是isMockEndpoints如下。
@Override
public String isMockEndpointsAndSkip(){
return "*";
}
但现在它是扔测试失败
java.lang.AssertionError:模拟://文件:d:/输出收到的消息计数。预计:< 1>但是:< 0>
我在这里错过了什么吗?请帮忙。
没有工作。仍然得到测试失败 – praveenps