yegor256/takes

Refactor TkHtmlTest to improve structure and edge case coverage (relates to #1408)

オープン

#1,435 opened on 2025/07/24

 (2 件のコメント) (0 件のリアクション) (0 人の担当者)Java (215 件のフォーク)github user discovery
enhancementhelp wanted

Repository metrics

Stars
 (875 個のスター)
PR merge metrics
 (平均マージ 95d 2h) (30d で 22 merged PRs)

説明

Improve and Refactor TkHtmlTest for Maintainability and Coverage (related to #1408)

The current implementation of TkHtmlTest can be improved in the following ways:

  1. Duplication: Each test manually builds a nearly identical expected response using Joined(..., body). This can be extracted into a helper method or reused variable.

  2. Edge Cases Missing:

    • No tests for null or empty input.
    • No assertion that Content-Type and Content-Length headers are semantically correct (not just matched by string).
  3. Structure Validation:

    • Could add a test to verify that the body actually starts/ends with <html> tags to ensure semantic HTML is passed.
  4. Test Readability:

    • Introduce @DisplayName annotations or comment grouping to make intent clearer.

A can provide a PR if the maintainers agree.

コントリビューターガイド