davsclaus commented on code in PR #29459:
URL: https://github.com/apache/camel/pull/29459#discussion_r4511856801
##########
core/camel-console/src/test/java/org/apache/camel/impl/console/SendDevConsoleTest.java:
##########
@@ -131,6 +133,27 @@ public void testSendConsoleToNonExistentEndpoint() {
assertEquals("error", jsonOut.getString("status"));
}
+ @Test
+ public void testSendConsoleFileBodyToAQueue() throws Exception {
+ // seda hands the message to another thread, which reads the body
after the send returns
+ context.addRoutes(new RouteBuilder() {
+ @Override
+ public void configure() {
+ from("seda:refunds").delay(200).to("mock:refunds");
+ }
+ });
+ Path file = Files.createTempFile("refund", ".json");
+ Files.writeString(file, "{\"refund\": 1}");
+ MockEndpoint mock = getMockEndpoint("mock:refunds");
+ mock.expectedBodiesReceived("{\"refund\": 1}");
+
+ JsonObject jsonOut = callJson(startedSendConsole(),
createOptions("seda:refunds", "file:" + file));
+
+ assertEquals("success", jsonOut.getString("status"), jsonOut.toJson());
+ mock.assertIsSatisfied();
+ Files.delete(file);
Review Comment:
Done: `@TempDir` and no explicit delete.
_Claude Code on behalf of Claus Ibsen_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]