Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

fix(server): remove write numbers as strings in reports #1257

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,6 @@ public ObjectMapper reportObjectMapper() {
.setSerializationInclusion(JsonInclude.Include.NON_NULL)
.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS)
.enable(JsonWriteFeature.WRITE_NUMBERS_AS_STRINGS.mappedFeature())
.registerModule(jdomElementModule)
.findAndRegisterModules();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import com.chutneytesting.tools.ui.MyMixInForIgnoreType;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.json.JsonWriteFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.databind.SerializerProvider;
Expand Down Expand Up @@ -210,7 +209,6 @@ public ObjectMapper dtoReportObjectMapper() {
.setSerializationInclusion(JsonInclude.Include.NON_NULL)
.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS)
.enable(JsonWriteFeature.WRITE_NUMBERS_AS_STRINGS.mappedFeature())
.registerModule(jdomElementModule)
.findAndRegisterModules();
}
Expand Down
8 changes: 4 additions & 4 deletions server/src/test/resources/blackbox/actions/sql.feature
Original file line number Diff line number Diff line change
Expand Up @@ -81,22 +81,22 @@ Feature: SQL Task test
And the report contains record results
Do compare
With actual ${#json(#report, "$.report.steps[-1:].stepOutputs.recordResult").toString()}
With expected [[{"affectedRows":"-1","headers":["ID","NAME","EMAIL"],"rows":[["1","laitue","[email protected]"],["2","carotte","[email protected]"]],"columns":[{"name":"ID","index":"0"},{"name":"NAME","index":"1"},{"name":"EMAIL","index":"2"}],"records":[{"cells":[{"column":{"name":"ID","index":"0"},"value":"1"},{"column":{"name":"NAME","index":"1"},"value":"laitue"},{"column":{"name":"EMAIL","index":"2"},"value":"[email protected]"}]},{"cells":[{"column":{"name":"ID","index":"0"},"value":"2"},{"column":{"name":"NAME","index":"1"},"value":"carotte"},{"column":{"name":"EMAIL","index":"2"},"value":"[email protected]"}]}]}]]
With expected [[{"affectedRows":-1,"headers":["ID","NAME","EMAIL"],"rows":[[1,"laitue","[email protected]"],[2,"carotte","[email protected]"]],"columns":[{"name":"ID","index":0},{"name":"NAME","index":1},{"name":"EMAIL","index":2}],"records":[{"cells":[{"column":{"name":"ID","index":0},"value":1},{"column":{"name":"NAME","index":1},"value":"laitue"},{"column":{"name":"EMAIL","index":2},"value":"[email protected]"}]},{"cells":[{"column":{"name":"ID","index":0},"value":2},{"column":{"name":"NAME","index":1},"value":"carotte"},{"column":{"name":"EMAIL","index":2},"value":"[email protected]"}]}]}]]
With mode equals
And the report contains firstRow output
Do compare
With actual ${#json(#report, "$.report.steps[-1:].stepOutputs.firstRow").toString()}
With expected [{"cells":[{"column":{"name":"ID","index":"0"},"value":"1"},{"column":{"name":"NAME","index":"1"},"value":"laitue"},{"column":{"name":"EMAIL","index":"2"},"value":"[email protected]"}]}]
With expected [{"cells":[{"column":{"name":"ID","index":0},"value":1},{"column":{"name":"NAME","index":1},"value":"laitue"},{"column":{"name":"EMAIL","index":2},"value":"[email protected]"}]}]
With mode equals
And the report contains rows output
Do compare
With actual ${#json(#report, "$.report.steps[-1:].stepOutputs.rows").toString()}
With expected [{"rows":[{"cells":[{"column":{"name":"ID","index":"0"},"value":"1"},{"column":{"name":"NAME","index":"1"},"value":"laitue"},{"column":{"name":"EMAIL","index":"2"},"value":"[email protected]"}]},{"cells":[{"column":{"name":"ID","index":"0"},"value":"2"},{"column":{"name":"NAME","index":"1"},"value":"carotte"},{"column":{"name":"EMAIL","index":"2"},"value":"[email protected]"}]}]}]
With expected [{"rows":[{"cells":[{"column":{"name":"ID","index":0},"value":1},{"column":{"name":"NAME","index":1},"value":"laitue"},{"column":{"name":"EMAIL","index":2},"value":"[email protected]"}]},{"cells":[{"column":{"name":"ID","index":0},"value":2},{"column":{"name":"NAME","index":1},"value":"carotte"},{"column":{"name":"EMAIL","index":2},"value":"[email protected]"}]}]}]
With mode equals
And the report contains affectedRows output
Do compare
With actual ${#json(#report, "$.report.steps[-1:].stepOutputs.affectedRows").toString()}
With expected ["-1"]
With expected [-1]
With mode equals

Scenario: Sql query wrong table
Expand Down
Loading