Skip to content

Custom Hamcrest matchers to ease unit and integration testing #485

Description

@RoRoche

Hi team,

Problem

Supporting custom Hamcrest matchers would significantly improve the developer experience by making test writing easier and more fluent (unit test or integration test).

Suggestion

I suggest to implement custom Hamcrest matchers to deal with TestRecord and ConsumerRecord to write concise and elegant assertions.
This will lead to a need of several utility classes to simplify the writing of tests.
The goal is also to have clear and intelligible diagnostic messages when tests fail.

Alternatives Considered

We could stay with standard JUnit assertions but I find we can have better mismatch description with custom matchers.

We could also use AssertJ that provides a fluent API and is also extensible.

Additional Context

Concerning the libraries I suggest:

Regards,
Romain

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementThis issue or pull request improves a feature

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions