Skip to content

Commit 2a38b9a

Browse files
authored
Fix SamlServiceProviderDocumentTests (#54718)
Don't assume byte for byte equality because internal structures do not guarantee order
1 parent 959f41e commit 2a38b9a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

x-pack/plugin/identity-provider/src/test/java/org/elasticsearch/xpack/idp/saml/sp/SamlServiceProviderDocumentTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import java.util.Set;
3131
import java.util.stream.Collectors;
3232

33+
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertToXContentEquivalent;
3334
import static org.hamcrest.Matchers.emptyIterable;
3435
import static org.hamcrest.Matchers.equalTo;
3536
import static org.hamcrest.Matchers.not;
@@ -144,7 +145,7 @@ private SamlServiceProviderDocument assertXContentRoundTrip(SamlServiceProviderD
144145
assertThat(obj2, equalTo(obj1));
145146

146147
final BytesReference bytes2 = XContentHelper.toXContent(obj2, xContentType, humanReadable);
147-
assertThat(bytes2, equalTo(bytes1));
148+
assertToXContentEquivalent(bytes1, bytes2, xContentType);
148149

149150
return obj2;
150151
}

0 commit comments

Comments
 (0)