Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow asserting, regardless of whether i.e. a Throwable is present #188

Closed
jamietanna opened this issue Aug 5, 2021 · 2 comments
Closed
Milestone

Comments

@jamietanna
Copy link

Current implementations expect full equality checks, including arguments, throwable, mdc`, etc to match.

One alternative is to create i.e.:

class NonCheckingThrowable extends Throwable {
  @Override
  public boolean equals(Object other) {
    return true;
  }
}

But this is not ideal - we should have some way of configuring this

@josephw
Copy link

josephw commented Dec 15, 2022

Are you using assertEquals, and requiring a LoggingEvent that's going to partially match? Would you consider Hamcrest-style matchers instead:

assertThat(logEvent, messageMatches(...));

or AssertJ custom assertions:

assertThat(logEvent).hasMessageMatching(...);

? Those seem like something that could live in this, or a related, library.

@valfirst
Copy link
Owner

Fixed: #328

@valfirst valfirst added this to the 2.8.0 milestone Dec 27, 2022
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

No branches or pull requests

3 participants