Skip to content

Commit d5aabd7

Browse files
Specify UTF8 for response content
This is needed because in some other platforms, like Windows, the default charset might be different Issue gh-12026
1 parent 53148dc commit d5aabd7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

saml2/saml2-service-provider/src/test/java/org/springframework/security/saml2/provider/service/web/Saml2MetadataFilterTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ public void doFilterWhenCharacterEncodingThenEncodeSpecialCharactersCorrectly()
165165
this.filter.setMetadataFilename(testMetadataFilename);
166166
this.filter.doFilter(this.request, this.response, this.chain);
167167
assertThat(this.response.getCharacterEncoding()).isEqualTo(StandardCharsets.UTF_8.name());
168-
assertThat(new String(this.response.getContentAsByteArray())).isEqualTo(generatedMetadata);
168+
assertThat(this.response.getContentAsString(StandardCharsets.UTF_8)).isEqualTo(generatedMetadata);
169169
}
170170

171171
@Test

0 commit comments

Comments
 (0)