File tree Expand file tree Collapse file tree 2 files changed +20
-3
lines changed
src/test/java/io/swagger/v3/core/converting Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Original file line number Diff line number Diff line change 52
52
</plugins >
53
53
</build >
54
54
<dependencies >
55
+ <dependency >
56
+ <groupId >org.json</groupId >
57
+ <artifactId >json</artifactId >
58
+ <version >20230227</version >
59
+ </dependency >
60
+ <dependency >
61
+ <groupId >org.skyscreamer</groupId >
62
+ <artifactId >jsonassert</artifactId >
63
+ <version >1.5.0</version >
64
+ </dependency >
55
65
<dependency >
56
66
<groupId >jakarta.xml.bind</groupId >
57
67
<artifactId >jakarta.xml.bind-api</artifactId >
Original file line number Diff line number Diff line change 14
14
import static io .swagger .v3 .core .util .TestUtils .normalizeLineEnds ;
15
15
import static org .testng .Assert .assertEquals ;
16
16
17
+ import org .json .JSONObject ;
18
+ import org .skyscreamer .jsonassert .JSONAssert ;
19
+
17
20
public class NumericFormatTest {
18
21
@ Test
19
22
public void testFormatOfInteger () {
@@ -41,8 +44,8 @@ public void testFormatOfDecimal() {
41
44
final Map <String , Schema > models = ModelConverters .getInstance ().readAll (ModelWithDecimalFields .class );
42
45
assertEquals (models .size (), 1 );
43
46
44
- String json = Json .pretty (models );
45
- assertEquals ( normalizeLineEnds ( json ),
47
+ String json1 = Json .pretty (models );
48
+ String json2 =
46
49
"{\n " +
47
50
" \" ModelWithDecimalFields\" : {\n " +
48
51
" \" type\" : \" object\" ,\n " +
@@ -55,7 +58,11 @@ public void testFormatOfDecimal() {
55
58
" }\n " +
56
59
" }\n " +
57
60
" }\n " +
58
- "}" );
61
+ "}" ;
62
+ JSONObject jsonObj1 = new JSONObject (json1 );
63
+ JSONObject jsonObj2 = new JSONObject (json2 );
64
+
65
+ JSONAssert .assertEquals (jsonObj1 , jsonObj2 , true );
59
66
}
60
67
61
68
@ Test
You can’t perform that action at this time.
0 commit comments