diff --git a/x-pack/plugin/identity-provider/src/test/java/org/elasticsearch/xpack/idp/saml/sp/SamlServiceProviderDocumentTests.java b/x-pack/plugin/identity-provider/src/test/java/org/elasticsearch/xpack/idp/saml/sp/SamlServiceProviderDocumentTests.java index b0200cc18c6..23abff6494a 100644 --- a/x-pack/plugin/identity-provider/src/test/java/org/elasticsearch/xpack/idp/saml/sp/SamlServiceProviderDocumentTests.java +++ b/x-pack/plugin/identity-provider/src/test/java/org/elasticsearch/xpack/idp/saml/sp/SamlServiceProviderDocumentTests.java @@ -31,7 +31,7 @@ import java.util.List; import java.util.Map; import java.util.stream.Collectors; -import static org.hamcrest.MatcherAssert.assertThat; +import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertToXContentEquivalent; import static org.hamcrest.Matchers.emptyIterable; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.not; @@ -146,7 +146,7 @@ public class SamlServiceProviderDocumentTests extends IdpSamlTestCase { assertThat(obj2, equalTo(obj1)); final BytesReference bytes2 = XContentHelper.toXContent(obj2, xContentType, humanReadable); - assertThat(bytes2, equalTo(bytes1)); + assertToXContentEquivalent(bytes1, bytes2, xContentType); return obj2; }