WiserAssertions: apply checkstyle rule MultipleStringLiterals
This commit is contained in:
parent
79032c0dd8
commit
97d67cb557
1 changed files with 7 additions and 6 deletions
|
@ -40,6 +40,9 @@ import java.util.function.Supplier;
|
|||
*/
|
||||
public final class WiserAssertions {
|
||||
|
||||
private static final String ERROR_MESSAGE_SUBJECT
|
||||
= "No message with subject [{0}] found!";
|
||||
|
||||
/**
|
||||
* The messages received by Wiser.
|
||||
*/
|
||||
|
@ -105,8 +108,7 @@ public final class WiserAssertions {
|
|||
public WiserAssertions withSubject(final String subject) {
|
||||
Predicate<WiserMessage> predicate
|
||||
= m -> subject.equals(unchecked(getMimeMessage(m)::getSubject));
|
||||
findFirstOrElseThrow(predicate,
|
||||
assertionError("No message with subject [{0}] found!",
|
||||
findFirstOrElseThrow(predicate, assertionError(ERROR_MESSAGE_SUBJECT,
|
||||
subject));
|
||||
return this;
|
||||
}
|
||||
|
@ -123,8 +125,7 @@ public final class WiserAssertions {
|
|||
Predicate<WiserMessage> predicate
|
||||
= m -> unchecked(getMimeMessage(m)::getSubject)
|
||||
.contains(subject);
|
||||
findFirstOrElseThrow(predicate,
|
||||
assertionError("No message with subject [{0}] found!",
|
||||
findFirstOrElseThrow(predicate, assertionError(ERROR_MESSAGE_SUBJECT,
|
||||
subject));
|
||||
return this;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue