public abstract class AbstractHtmlDiffMatcher extends org.hamcrest.BaseMatcher<String> implements ExpectedValueProvider<String>, ComparisonAwareMatcher
Document
s. Two documents are considered to be "identical" if
they contain the same elements and attributes in the same order.Two documents are considered to be "similar" if they
contain the same elements and attributes regardless of order.
This matcher is a ExpectedValueProvider
for knowing the original expected
value. Thanks to this information, OghamAssertions
will generate a
ComparisonFailure
with the expected string and actual string in order
to be able to visualize the differences on sources directly in the IDE.
See HtmlUtils
for more information about "identical"/"similar" HTML.
Modifier and Type | Field and Description |
---|---|
protected org.custommonkey.xmlunit.DetailedDiff |
diff |
protected String |
expected |
protected String |
name |
protected Consumer<String> |
printer |
Constructor and Description |
---|
AbstractHtmlDiffMatcher(String expected,
Consumer<String> printer,
String name) |
Modifier and Type | Method and Description |
---|---|
String |
comparisonMessage()
Generate the comparison message
|
void |
describeTo(org.hamcrest.Description description) |
String |
getExpectedValue()
Get the expected value
|
protected abstract boolean |
matches(org.custommonkey.xmlunit.DetailedDiff diff) |
boolean |
matches(Object item) |
protected final String expected
protected final String name
protected org.custommonkey.xmlunit.DetailedDiff diff
public boolean matches(Object item)
matches
in interface org.hamcrest.Matcher<String>
protected abstract boolean matches(org.custommonkey.xmlunit.DetailedDiff diff)
public void describeTo(org.hamcrest.Description description)
describeTo
in interface org.hamcrest.SelfDescribing
public String getExpectedValue()
ExpectedValueProvider
getExpectedValue
in interface ExpectedValueProvider<String>
public String comparisonMessage()
ComparisonAwareMatcher
comparisonMessage
in interface ComparisonAwareMatcher
Copyright © 2021. All rights reserved.