WiserAssertions: apply checkstyle rule MultipleStringLiterals

This commit is contained in:
Paul Campbell 2016-06-02 20:51:48 +01:00
parent 79032c0dd8
commit 97d67cb557

View file

@ -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;
}