Skip to content

Commit 1fdf54c

Browse files
committed
Merge pull request #1754 from bikerunner/issue-1752
Issue #1752: - fix line ending issue on windows
2 parents 2c08a8a + 12642fb commit 1fdf54c

File tree

1 file changed

+20
-19
lines changed

1 file changed

+20
-19
lines changed

modules/swagger-core/src/test/java/io/swagger/ByteConverterTest.java

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
import static org.testng.Assert.assertEquals;
1717

1818
public class ByteConverterTest {
19-
19+
private static final String NEWLINE = System.getProperty("line.separator");
20+
2021
@Test
2122
public void testByte() {
2223
final Map<String, Model> models = ModelConverters.getInstance().read(ByteConverterModel.class);
@@ -42,13 +43,13 @@ public void testByteProperty() {
4243
Model model = new ModelImpl()
4344
.property("byteProperty", new ByteArrayProperty());
4445

45-
assertEquals(Json.pretty(model), "{\n" +
46-
" \"properties\" : {\n" +
47-
" \"byteProperty\" : {\n" +
48-
" \"type\" : \"string\",\n" +
49-
" \"format\" : \"byte\"\n" +
50-
" }\n" +
51-
" }\n" +
46+
assertEquals(Json.pretty(model), "{" + NEWLINE +
47+
" \"properties\" : {" + NEWLINE +
48+
" \"byteProperty\" : {" + NEWLINE +
49+
" \"type\" : \"string\"," + NEWLINE +
50+
" \"format\" : \"byte\"" + NEWLINE +
51+
" }" + NEWLINE +
52+
" }" + NEWLINE +
5253
"}");
5354
}
5455

@@ -72,17 +73,17 @@ public void testByteArray() {
7273
Model model = new ModelImpl()
7374
.property("byteArray", new ArrayProperty(new BinaryProperty()));
7475

75-
assertEquals(Json.pretty(model), "{\n" +
76-
" \"properties\" : {\n" +
77-
" \"byteArray\" : {\n" +
78-
" \"type\" : \"array\",\n" +
79-
" \"items\" : {\n" +
80-
" \"type\" : \"string\",\n" +
81-
" \"format\" : \"binary\"\n" +
82-
" }\n" +
83-
" }\n" +
84-
" }\n" +
85-
"}");
76+
assertEquals(Json.pretty(model), "{" + NEWLINE +
77+
" \"properties\" : {" + NEWLINE +
78+
" \"byteArray\" : {" + NEWLINE +
79+
" \"type\" : \"array\"," + NEWLINE +
80+
" \"items\" : {" + NEWLINE +
81+
" \"type\" : \"string\"," + NEWLINE +
82+
" \"format\" : \"binary\"" + NEWLINE +
83+
" }" + NEWLINE +
84+
" }" + NEWLINE +
85+
" }" + NEWLINE +
86+
"}");
8687
}
8788

8889
class ByteConverterModel {

0 commit comments

Comments
 (0)