Messaging
- Validation matcher highlighting
- Code completion of XsdSchema and XsdSchemaRepository Spring beans
- Code completion of SimpleJsonSchema and JsonSchemaRepository Spring beans
- MessageType code completion
- Message header code completion
- Content type code completion
- Message header to be replaced with Citrus constant
- Invalid SOAP attachment encoding type
NOTE: action specific language injections can be found in the language injections document.
Validation matcher highlighting
Citrus provides various validation matchers to validate or ignore parts of messages during validation. In order to make these expressions stand out more inside Java String literals, a simple highlighting is implemented.
NOTES:
- matcher arguments are not yet annotated in any way,
- complex language support may be introduced later, that may bring a potential style change too.
Coloring
The opening and closing parts, @matchername(
and )@
take the color scheme of Classes > Static method, while the parameters takes the color scheme of Identifiers > Parameter in Settings
> Editor
> Color Scheme
> Language Defaults
.
The coloring may be different in different IDEs depending on the color scheme settings.

Code completion of XsdSchema and XsdSchemaRepository Spring beans
To make the discovery of XsdSchema
and XsdSchemaRepository
-type beans easier in test code, the following methods’ arguments are extended with code completion:
XmlValidationContextBuilder#schema()
: for exampleXmlMessageValidationContext.Builder.xml().schema("")
XmlValidationContextBuilder#schemaRepository()
: for exampleXmlMessageValidationContext.Builder.xml().schemaRepository("")
The type text on the right hand side of each completion item shows the Spring configuration class the bean is defined in. Also, while the completion list is displayed, one can also navigate to the bean definition via Ctrl+B and similar shortcuts.

Code completion of SimpleJsonSchema and JsonSchemaRepository Spring beans
To make the discovery of SimpleJsonSchema
and JsonSchemaRepository
-type beans easier in test code, the following methods’ arguments are extended with code completion:
JsonMessageValidationContext.Builder#schema()
: for exampleJsonMessageValidationContext.Builder.json().schema("")
JsonMessageValidationContext.Builder#schemaRepository()
: for exampleJsonMessageValidationContext.Builder.json().schemaRepository("")
The type text on the right hand side of each completion item shows the Spring configuration class the bean is defined in. Also, while the completion list is displayed, one can also navigate to the bean definition via Ctrl+B and similar shortcuts.

MessageType code completion
To simplify the insertion of MessageType
values when configuring type(String)
in send()
and receive()
call chains, this code completion provides the possible values.

Message header code completion
JMS, Kafka and other messaging types have message headers specific to them. With this code completion, it is easier to discover them.
The corresponding header names are suggested when their Citrus packages are used in the project. The header names are collected from the following utility classes from the aforementioned citrus packages:
- JMS:
JmsMessageHeaders
- Kafka:
KafkaMessageHeaders
- HTTP:
HttpMessageHeaders
- SOAP:
SoapMessageHeaders
- WS-Addressing:
WsAddressingMessageHeaders
- Apache Camel:
CamelMessageHeaders
This is currently supported in *Header()
methods of the Message
class, as well as in header()
calls in send(Endpoint)
and receive(Endpoint)
call chains. In case the concrete Endpoint
type used in the call chain can be evaluated, only the message headers for that endpoint type are suggested.
The type text on the right side of each item shows the aforementioned utility classes’ names.

Content type code completion
HTTP media types are used at various places, for one, in the citrus-http package. At those places, a list of media types is suggested:
HttpClientBuilder.contentType()
in for examplenew HttpClientBuilder().contentType("...").build();
call chainsHttpMessageBuilderSupport.contentType()/.accept()
in for exampleHttpActionBuilder.http().client("client").send().post().message()...
call chains.ReceiveSoapMessageAction.SoapMessageBuilderSupport.attachment()
in for exampleSoapActionBuilder.soap().server("server").receive().message().attachment("", "...", "")
SoapAttachment.setContentType()

Message header to be replaced with Citrus constant
JMS, Kafka and other library-specific message headers are also stored in dedicated Citrus utility classes, so this inspection reports header name literals, and provides a quick fix to replace them with their corresponding constant references.
The following Citrus utilities are supported now:
- JMS:
JmsMessageHeaders
- Kafka:
KafkaMessageHeaders
- HTTP:
HttpMessageHeaders
- SOAP:
SoapMessageHeaders
- WS-Addressing:
WsAddressingMessageHeaders
- Apache Camel:
CamelMessageHeaders

Invalid SOAP attachment encoding type
The SoapAttachment
type can be configured with an encoding type for which only base64Binary
and hexBinary
are valid values.
This inspection reports invalid values in the setEncodingType()
method of this class.
