Added JUnit test cases for HTTPTokener by surajdm123 · Pull Request #992 · stleary/JSON-java

Conversation

@surajdm123

Context

This PR adds the missing unit test case for =HTTPTokener.

Test Plan

mvn -Dtest=HTTPTokenerTest test

...
[INFO] Running org.json.junit.HTTPTokenerTest
[INFO] Tests run: 9, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.040 s -- in org.json.junit.HTTPTokenerTest
[INFO] 
[INFO] Results:
[INFO] 
[INFO] Tests run: 9, Failures: 0, Errors: 0, Skipped: 0
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------

Screenshot 2025-07-03 at 1 00 38 AM

Next Steps

  1. Add more missing test cases to make this codebase more resilient.

@sonarqubecloud

@stleary

What problem does this code solve?
Improves test coverage from 93% to 100% for HttpTokener

Does the code still compile with Java6?
Yes

Risks
Low

Changes to the API?
No

Will this require a new release?
No

Should the documentation be updated?
No

Does it break the unit tests?
No, this PR consists of new unit tests

Was any code refactored in this commit?
No

Review status
APPROVED

Starting 3-day comment window

stleary

2 participants

@surajdm123 @stleary