citrusframework / citrus

Framework for automated integration tests with focus on messaging integration
https://citrusframework.org
Apache License 2.0
445 stars 135 forks source link

Binary message not the same as documentation? #1147

Open lancechant opened 2 months ago

lancechant commented 2 months ago

Citrus Version 4.1.1

Question Is the documentation wrong with sending byte messages or any other type other than string?

What I've tried so far Tried to send a message with the type of BINARY and expected the message to not be text but a byte type, but instead the message was delivered as TEXT

Additional information According to the documentation it should be as simple as doing the following:

send("someEndpoint")
    .message()
    .type(MessageType.BINARY)
    .body("Hello World")

But after spending a few days I found out for sending you have to actually do this (Well it at least gave me the results I need):

send("someEndpoint")
    .message()
    .type(MessageType.BINARY)
    .body("Hello World")
    .process(toBinary().encoding(StandardCharsets.UTF_8))

I found this here: citrus-samples

The documentation where it shows it's just as easy as setting the type: reference-documentation samples-binary