Skip to content

Increase baseline unit coverage for untested bean and file-upload paths#599

Merged
hazendaz merged 2 commits into
masterfrom
copilot/analyze-test-coverage
Apr 19, 2026
Merged

Increase baseline unit coverage for untested bean and file-upload paths#599
hazendaz merged 2 commits into
masterfrom
copilot/analyze-test-coverage

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 19, 2026

This project had broad mixed functionality with minimal test coverage, leaving many simple core classes unverified. This PR adds focused unit tests across high-signal, low-dependency classes to materially improve baseline coverage and reduce regression risk.

  • Coverage expansion in com.hazendaz.beans
    • Added tests for:
      • RandomHelper (genRand, rand, randomstring bounds/shape assertions)
      • InventoryVendorList (constructor state and getCount null/non-null branches)
      • PopupBean (duplicate toggle behavior and generic testExtends invocation)
      • ByteManipulation (main output behavior via captured System.out)
  • Coverage expansion in com.hazendaz.fileupload
    • Added tests for:
      • UploadedImage (setData, setLength, and MIME selection in setName for csv/non-csv/no-extension inputs)
      • FileUploadBean (cancel flow, upload list clearing, date/files setters, size/null handling, timestamp/now format, no-op setNow, and paint stream-writing path)
  • Behavioral focus
    • Tests target existing observable behavior and branch paths without changing production code contracts.

Example (new coverage around MIME branching in UploadedImage):

final UploadedImage image = new UploadedImage();

image.setName("data.csv");
Assertions.assertEquals("text/csv", image.getMime());

image.setName("data.txt");
Assertions.assertEquals("text/unknown", image.getMime());

@hazendaz hazendaz marked this pull request as ready for review April 19, 2026 16:44
@hazendaz hazendaz merged commit aa129d7 into master Apr 19, 2026
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