private static String escapePercentExceptWhenFollowedBy_n(String message) { return revertEscapingPercent_n(escapePercent(message)); }
private static String describeErrors(List<UnsatisfiedRequirement> elementsNotSatisfyingRequirements, AssertionInfo info) { return escapePercent(elementsNotSatisfyingRequirements.stream() .map(unsatisfiedRequirement -> unsatisfiedRequirement.describe(info)) .collect(joining(format("%n%n")))); }
private static String describe(AssertionInfo info, List<ZipSatisfyError> zipSatisfyErrors) { List<String> errorsToStrings = zipSatisfyErrors.stream() .map(error -> ZipSatisfyError.describe(info, error)) .collect(toList()); return escapePercent(DELIMITER + String.join(DELIMITER, errorsToStrings)); }
private static String escapePercentExceptWhenFollowedBy_n(String message) { return revertEscapingPercent_n(escapePercent(message)); }
private static String describeDifference(Difference difference, Representation representation) { String actualFieldValue = representation.toStringOf(difference.getActual()); String otherFieldValue = representation.toStringOf(difference.getOther()); boolean sameRepresentation = Objects.areEqual(actualFieldValue, otherFieldValue); String actualFieldValueRepresentation = sameRepresentation ? representation.unambiguousToStringOf(difference.getActual()) : actualFieldValue; String otherFieldValueRepresentation = sameRepresentation ? representation.unambiguousToStringOf(difference.getOther()) : otherFieldValue; String additionalInfo = difference.getDescription() .map(desc -> format("%n- reason : %s", escapePercent(desc))) .orElse(""); return format("%nPath to difference: <%s>%n" + "- actual : <%s>%n" + "- expected: <%s>" + additionalInfo, join(difference.getPath()).with("."), escapePercent(actualFieldValueRepresentation), escapePercent(otherFieldValueRepresentation)); }
private static String describeDifference(Difference difference, Representation representation) { String actualFieldValue = representation.toStringOf(difference.getActual()); String otherFieldValue = representation.toStringOf(difference.getOther()); boolean sameRepresentation = Objects.areEqual(actualFieldValue, otherFieldValue); String actualFieldValueRepresentation = sameRepresentation ? representation.unambiguousToStringOf(difference.getActual()) : actualFieldValue; String otherFieldValueRepresentation = sameRepresentation ? representation.unambiguousToStringOf(difference.getOther()) : otherFieldValue; String additionalInfo = difference.getDescription() .map(desc -> format("%n- reason : %s", escapePercent(desc))) .orElse(""); return format("%nPath to difference: <%s>%n" + "- actual : <%s>%n" + "- expected: <%s>" + additionalInfo, join(difference.getPath()).with("."), escapePercent(actualFieldValueRepresentation), escapePercent(otherFieldValueRepresentation)); }