Skip to content

Parameterize the closed-stream "operation after close throws" tests #52

Description

@dfa1

Background

ZstdStreamTest has four near-identical tests that each set up a stream, close it, then assert an operation throws:

  • writeAfterCloseThrows() (~L294)
  • flushAfterCloseThrows() (~L309)
  • readAfterCloseThrows() (~L361)

They differ only in which method is called after close(). That's copy-paste that a single @ParameterizedTest expresses better.

Task

Collapse the "operation after close throws" cases into one @ParameterizedTest driven by a @MethodSource of (name, ThrowingCallable) pairs (or similar). Keep each scenario's intent visible via the source's display name.

Acceptance criteria

  • One parameterized test replaces the per-operation copies; behavior unchanged.
  • Follows the repo test conventions in CLAUDE.md: // Given / // When / // Then, exception asserted via assertThatThrownBy(result) where result is the ThrowingCallable captured under // When.
  • ./mvnw -pl zstd test stays green.

Pointers

  • zstd/src/test/java/io/github/dfa1/zstd/ZstdStreamTest.java

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomersjavaPull requests that update java code

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions