yegor256/takes

Improve TkMeasuredTest Coverage (related to #1408)

オープン

#1,434 opened on 2025/07/24

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

Repository metrics

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

説明

Refactor and extend TkMeasuredTest to improve coverage and robustness (related to #1408)

The current TkMeasuredTest verifies only the presence of a custom or default header. However, there are several aspects that could be improved:

  1. Add negative/edge test cases:

    • What happens if a null or empty header is passed?
    • Does TkMeasured properly override an existing timing header?
  2. Validate header value:

    • Currently, the tests only assert that the header exists, but not that it contains a valid numeric duration (in ms).
  3. Improve assertion messages:

    • Current failure messages are generic and could be improved with more informative output (e.g. actual value of the response).

This refactor would help ensure better long-term stability and maintainability of the test.

I'm happy to prepare a PR for this if approved.

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