citrusframework / citrusframework/citrus

Citrus Agent Maven Plugin RunTest Mojo test goal breaks when receiving a test fault json structure

Open Beginner friendly
#1,727 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
485
Forks
155
Avg merge
4d 22h
Merged PRs (30d)
6

Description

**Citrus Version**

5.0.1

**Expected behavior**

When running tests using the citrus agent maven plugin and receiving a json response for a test fault the execution should report this (displaying a minus in the output) and continue waiting for the overall test execution to finish.

**Actual behavior**

Execution of the plugin breaks, error message is as follows:

```
Caused by: com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize value of type `java.lang.String` from Object value (token `JsonToken.START_OBJECT`)
at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 178, column: 13] (through reference chain: java.lang.Object[][22]->org.citrusframework.agent.plugin.model.RemoteResult["cause"])
```

**Explanation and suggested fix**

RemoteResult class of Citrus Agent Maven Plugin has field `cause` of type `java.lang.String` where the TestResult class of Citrus Agent has field `cause`declared with type `java.lang.Throwable`.

Declaring field `cause` in RemoteResult class also as Throwable fixes this issue.

I will provide a PR for this.

Contributor guide

Open the contributing guide

Research direction

Start by locating the RemoteResult class in the Citrus Agent Maven Plugin and compare its cause field with the Throwable cause in the Citrus Agent TestResult class. Reproduce the RunTest Mojo with a test-fault JSON response, then verify that deserialization succeeds, the fault is reported with a minus in the output, and execution continues waiting for the overall test result.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
testing, tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
82/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.