We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I have an arg that's a long, dynamically computed string (a stacktrace). I'd like to confirm that it contains a certain substring, with a syntax like:
assertThatServiceExceptionThrownBy(() -> throwIt()) .hasType(MyErrors.MY_ERROR) .hasArgSatisfying(arg -> { assertThat(arg.getName()).isEqualTo("my-arg"); assertThat(arg.getValue()).asString().contains("my-substring"); });
or maybe like this:
assertThatServiceExceptionThrownBy(() -> throwIt()) .hasType(MyErrors.MY_ERROR) .hasArgWithNameSatisfying("my-arg", value -> assertThat(value).asString().contains("my-substring"));
Right now I'm doing something like this, but would love to improve it:
assertThatServiceExceptionThrownBy(() -> throwIt()) .hasType(MyErrors.MY_ERROR) .satisfies(serviceException -> assertThat(serviceException.getArgs()) .satisfiesOnlyOnce(arg -> { assertThat(arg.getName()).isEqualTo("my-arg"); assertThat(arg.getValue()).asString().contains("my-substring"); }); });
The text was updated successfully, but these errors were encountered:
No branches or pull requests
What happened?
I have an arg that's a long, dynamically computed string (a stacktrace). I'd like to confirm that it contains a certain substring, with a syntax like:
or maybe like this:
Workaround
Right now I'm doing something like this, but would love to improve it:
The text was updated successfully, but these errors were encountered: