File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
spring-core/src/test/java/org/springframework/core Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -132,8 +132,11 @@ public void storingAsXmlSortsPropertiesAndOmitsComments() throws IOException {
132
132
133
133
String [] lines = lines (baos );
134
134
135
- assertThat (lines ).containsExactly ( //
136
- "<?xml version=\" 1.0\" encoding=\" UTF-8\" standalone=\" no\" ?>" , //
135
+ assertThat (lines ).isNotEmpty ();
136
+ // Leniently match first line due to differences between JDK 8 and JDK 9+.
137
+ String regex = "<\\ ?xml .*\\ ?>" ;
138
+ assertThat (lines [0 ]).matches (regex );
139
+ assertThat (lines ).filteredOn (line -> !line .matches (regex )).containsExactly ( //
137
140
"<!DOCTYPE properties SYSTEM \" http://java.sun.com/dtd/properties.dtd\" >" , //
138
141
"<properties>" , //
139
142
"<entry key=\" color\" >blue</entry>" , //
You can’t perform that action at this time.
0 commit comments