Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/spring-boot/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring boot 在测试Apache Camel+;弹簧靴_Spring Boot_Apache Camel_Spring Camel - Fatal编程技术网

Spring boot 在测试Apache Camel+;弹簧靴

Spring boot 在测试Apache Camel+;弹簧靴,spring-boot,apache-camel,spring-camel,Spring Boot,Apache Camel,Spring Camel,我有一个简单的Apache CamelRouteBuilder类,大致如下所示: from("an FTP server") // log stuff .to("direct:split"); from("direct:split") // split CSV and aggregate the messages into separate files .to("direct:save"); from("direct:save"

我有一个简单的Apache Camel
RouteBuilder
类,大致如下所示:

from("an FTP server")
        // log stuff
        .to("direct:split");

from("direct:split")
        // split CSV and aggregate the messages into separate files
        .to("direct:save");

from("direct:save")
        // save the files to a different FTP server
        .end();
在我将要编写的测试中,我只想使用
direct:split
端点进行测试——我将加载CSV并在本地保存新的CSV,然后编写测试以将输出与预期的输出进行比较。我会在测试中重写
RouteBuilder
吗?或者我会以某种方式拉入
direct:split
端点,然后只指定不同的起始和结束位置吗?

您可以创建一些“子”路由,例如:

  from("direct:split")
        // make two subroutes
        .to("direct:splitSubRouteOne")
        .to("direct:splitSubRouteTwo");

    from("direct:splitSubRouteOne")
        // split CSV and aggregate the messages into separate files
        // etc 
     ;    

   from("direct:splitSubRouteTwo")
        .to("direct:save");
然后,您可以通过发送到“direct:splitsubruteone”来测试您想要的部分(大概),该命令将测试该部分,但不会测试第二部分