Skip to content

Add additional edge case tests for parseResultsPerPage#127

Open
machphy wants to merge 2 commits into
jeremylong:mainfrom
machphy:test/nvd-results-per-page
Open

Add additional edge case tests for parseResultsPerPage#127
machphy wants to merge 2 commits into
jeremylong:mainfrom
machphy:test/nvd-results-per-page

Conversation

@machphy

@machphy machphy commented Jun 23, 2026

Copy link
Copy Markdown

This PR adds additional unit tests for NvdCveClient.parseResultsPerPage().

Changes:

  • Added a test for parsing values when the error message does not end with a period.
  • Added a test to verify fallback behavior when the parsed value is not numeric.

All tests pass successfully.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR extends unit test coverage around NvdCveClient.parseResultsPerPage() to validate additional edge cases in parsing the NVD error message and the fallback behavior when parsing fails.

Changes:

  • Added a test to ensure parsing succeeds even when the error message does not end with a period.
  • Added a test to verify the method falls back to the configured resultsPerPage when the parsed suffix is not numeric.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +41 to +43
int recordsPerPage = client.parseResultsPerPage(
"resultsPerPage parameter cannot exceed abc."
);
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment on lines +41 to +43
int recordsPerPage = client.parseResultsPerPage(
"resultsPerPage parameter cannot exceed abc."
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants