Skip to content

Commit fb15952

Browse files
committed
Do not use assertEquals to compare json data structures.
Json data structures should be considered as equal also if the order of attributes differs, therefore assertEquals should not be used.
1 parent f0758b6 commit fb15952

File tree

1 file changed

+31
-31
lines changed

1 file changed

+31
-31
lines changed

core/src/test/java/cucumber/runtime/formatter/HTMLFormatterTest.java

+31-31
Original file line numberDiff line numberDiff line change
@@ -59,37 +59,37 @@ public void writes_index_html() throws Throwable {
5959
public void writes_valid_report_js() throws Throwable {
6060
writeReport();
6161
String reportJs = FixJava.readReader(new InputStreamReader(new URL(outputDir, "report.js").openStream(), "UTF-8"));
62-
assertEquals("$(document).ready(function() {var formatter = new CucumberHTML.DOMFormatter($('.cucumber-report'));formatter.uri(\"some\\\\windows\\\\path\\\\some.feature\");\n" +
63-
"formatter.feature({\n" +
64-
" \"name\": \"\",\n" +
65-
" \"description\": \"\",\n" +
66-
" \"keyword\": \"Feature\"\n" +
67-
"});\n" +
68-
"formatter.scenario({\n" +
69-
" \"name\": \"some cukes\",\n" +
70-
" \"description\": \"\",\n" +
71-
" \"keyword\": \"Scenario\"\n" +
72-
"});\n" +
73-
"formatter.step({\n" +
74-
" \"name\": \"first step\",\n" +
75-
" \"keyword\": \"Given \"\n" +
76-
"});\n" +
77-
"formatter.match({\n" +
78-
" \"location\": \"path/step_definitions.java:3\"\n" +
79-
"});\n" +
80-
"formatter.result({\n" +
81-
" \"status\": \"passed\"\n" +
82-
"});\n" +
83-
"formatter.embedding(\"image/png\", \"embedded0.png\");\n" +
84-
"formatter.after({\n" +
85-
" \"status\": \"passed\"\n" +
86-
"});\n" +
87-
"formatter.embedding(\"text/plain\", \"dodgy stack trace here\");\n" +
88-
"formatter.after({\n" +
89-
" \"status\": \"passed\"\n" +
90-
"});\n" +
91-
"});",
92-
reportJs);
62+
assertJsFunctionCallSequence(asList("" +
63+
"formatter.uri(\"some\\\\windows\\\\path\\\\some.feature\");\n",
64+
"formatter.feature({\n" +
65+
" \"name\": \"\",\n" +
66+
" \"description\": \"\",\n" +
67+
" \"keyword\": \"Feature\"\n" +
68+
"});\n",
69+
"formatter.scenario({\n" +
70+
" \"name\": \"some cukes\",\n" +
71+
" \"description\": \"\",\n" +
72+
" \"keyword\": \"Scenario\"\n" +
73+
"});\n",
74+
"formatter.step({\n" +
75+
" \"name\": \"first step\",\n" +
76+
" \"keyword\": \"Given \"\n" +
77+
"});\n",
78+
"formatter.match({\n" +
79+
" \"location\": \"path/step_definitions.java:3\"\n" +
80+
"});\n",
81+
"formatter.result({\n" +
82+
" \"status\": \"passed\"\n" +
83+
"});\n",
84+
"formatter.embedding(\"image/png\", \"embedded0.png\");\n",
85+
"formatter.after({\n" +
86+
" \"status\": \"passed\"\n" +
87+
"});\n",
88+
"formatter.embedding(\"text/plain\", \"dodgy stack trace here\");\n",
89+
"formatter.after({\n" +
90+
" \"status\": \"passed\"\n" +
91+
"});\n"),
92+
reportJs);
9393
}
9494

9595
@Test

0 commit comments

Comments
 (0)