Skip to content

[Fix-17389][Http-Task] Fix json parsing exception in request body#18085

Open
SbloodyS wants to merge 4 commits intoapache:devfrom
SbloodyS:fix_17389
Open

[Fix-17389][Http-Task] Fix json parsing exception in request body#18085
SbloodyS wants to merge 4 commits intoapache:devfrom
SbloodyS:fix_17389

Conversation

@SbloodyS
Copy link
Member

@SbloodyS SbloodyS commented Mar 19, 2026

Was this PR generated or assisted by AI?

Yes. Using gpt-5.3 to generate UT.

Purpose of the pull request

fix #17389
close #17888

Brief change log

Verify this pull request

This pull request is code cleanup without any test coverage.

(or)

This pull request is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(or)

Pull Request Notice

Pull Request Notice

If your pull request contains incompatible change, you should also add it to docs/docs/en/guide/upgrade/incompatible.md

@SbloodyS SbloodyS added this to the 3.4.2 milestone Mar 19, 2026
@SbloodyS SbloodyS self-assigned this Mar 19, 2026
@SbloodyS SbloodyS added bug Something isn't working backend labels Mar 19, 2026
@SbloodyS SbloodyS marked this pull request as ready for review March 19, 2026 05:50
@github-actions github-actions bot added the test label Mar 19, 2026
@SbloodyS SbloodyS requested a review from ruanwenjun March 19, 2026 06:10
Comment on lines +151 to +161
String httpBody = "{\"name\":\"tom\",\"scores\":[100,98],\"metadata\":{\"grade\":\"A\"}}";
String httpResponse = "{\"status\": \"success\"}";

MockWebServer server = new MockWebServer();
mockWebServers.add(server);
server.start();
server.setDispatcher(generateMockDispatcher(DEFAULT_MOCK_PATH, HttpStatus.SC_OK, httpResponse));

String paramData = generateHttpParameters(server.url(DEFAULT_MOCK_PATH).toString(), HttpRequestMethod.POST,
httpBody, new ArrayList<>(), HttpCheckCondition.STATUS_CODE_DEFAULT, "");
HttpTask httpTask = generateHttpTaskFromParamData(paramData, null);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we directly use generateHttpTask to generate http task and server?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Already fixed. PATL. @ruanwenjun

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 60%)

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend bug Something isn't working test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] JSONUtils Problem

2 participants