Skip to content

Improve test coverage across multiple modules#637

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/analyze-test-coverage
Draft

Improve test coverage across multiple modules#637
Copilot wants to merge 2 commits intomainfrom
copilot/analyze-test-coverage

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 4, 2026

Summary

This PR adds comprehensive test cases to improve coverage across multiple modules in the fj-doc repository, targeting classes that had no dedicated test coverage.

Changes

fj-doc-base — 8 new test classes

  • TestEnumDocAlignH, TestEnumDocAlignV, TestEnumDocStyle — Tests for all enum values, fromValue(), and idFromValueWithDefault() (including unknown value fallback)
  • TestDocStyleAlignHelper — Tests for parseStyle(), getAlign(), getValign() with known and unknown values
  • TestDocParserHelper — Tests for the singleton, all recognized container tag names, and non-container rejections
  • TestDocParserUtil — Tests for doubleNested() and doubleNestedWithDefaultInt() with primary key, fallback key, and default value paths
  • TestDocTableUtil — Tests for table row partitioning (header vs data rows, strict header detection, empty tables, mixed header rows)
  • TestDefaultMimeHelper — Tests for MIME type lookups for known types (pdf, xml, html, xls) and unknown types
  • TestTableIntegrityCheckResult — Tests for result code, empty messages list, adding/setting messages
  • TestReflectiveDocConvert — Tests the DocConvert implementation for content piping

fj-doc-lib-simpletable-import — New TestCommonConvertUtils

  • Tests exception-rethrowing behavior (default rethrow-exception=1) for both CSV and XLSX conversion paths
  • Tests null-return behavior when rethrow-exception=0 is set
  • Uses broken InputStream and invalid byte content to trigger error paths

fj-doc-mod-opencsv — New TestOpenCSVTypeHandler

  • Tests the non-UTF8 OpenCSVTypeHandler directly (complementing the existing UTF-8 handler test)
  • Covers custom separator (;) and line-ending configuration path
  • Covers default separator path and missing table ID path (empty output)
  • Tests handler constants (TYPE_CSV, MODULE, MIME, HANDLER, HANDLER_UTF8)

fj-doc-base-yaml — New TestDocYamlJsonConvert

  • Tests DocYamlToJson — YAML to JSON round-trip conversion
  • Tests DocJsonToYaml — JSON to YAML round-trip conversion
  • Tests YamlConstants.getDefaultMapper() not null

fj-doc-base-json — New TestJsonConstants

  • Tests JsonConstants.getDefaultMapper() not null
  • Tests DocObjectMapperConstants.PROPERTY_XSD_VERSION constant value

fj-doc-freemarker — New TestFMFunctions

  • FMFunHelper — Tests parameter count validation with and without enough arguments, custom error messages
  • CleanTextFun — Tests regex-based text cleaning with expected replacements, no-match case, and insufficient arguments
  • TextWrapFun — Tests wrapping with valid input and throws on empty arguments
  • FormatLocalDateTimeFun — Tests date/time formatting with LocalDateTime object and pattern, throws on too few arguments

Testing

All new tests pass. No existing tests were modified.

Copilot AI and others added 2 commits April 4, 2026 20:56
…, TextWrapFun, FormatLocalDateTimeFun)

Agent-Logs-Url: https://github.com/fugerit-org/fj-doc/sessions/c11c4c69-f231-49f2-857f-12ff3059cd2c

Co-authored-by: fugerit79 <20170348+fugerit79@users.noreply.github.com>
@codacy-production
Copy link
Copy Markdown

codacy-production bot commented Apr 4, 2026

Not up to standards ⛔

🔴 Issues 2 medium

Alerts:
⚠ 2 issues (≤ 0 issues of at least minor severity)

Results:
2 new issues

Category Results
BestPractice 2 medium

View in Codacy

🟢 Metrics 82 complexity

Metric Results
Complexity 82

View in Codacy

TIP This summary will be updated as you push new changes. Give us feedback

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