Search code examples
citrus-frameworkcitrus-engine

Custom Error Messages in CITRUS Test Results


I want to use my custom error messages in my citrus test results. Example: Original Error Message: java.io.FileNotFoundException: D:\expectedOutput\Smaple.xml (The system cannot find the file specified).

Custom Message: Hey The File was not found in your directory Please check. (Need to print like this in my test results failure message).

Please check the image hereenter image description here


Solution

  • You can not change this message in particular as this is coming from the thrown Java exception. You could implement your own TestReporter and/or TestListener though to translate the error into something matching your needs.

    Something like: https://citrusframework.org/samples/reporting/