diff options
author | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2015-08-27 17:00:25 +0200 |
---|---|---|
committer | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2015-08-27 17:01:24 +0200 |
commit | 73a38b94539a3f69c084c210cb2df9287d2c00e2 (patch) | |
tree | bfcfbcbc3edadfda8365c93e3e16adf9e6d407af /server | |
parent | aba9715aa0e4fcf433f3f7639098823e95db8c83 (diff) | |
download | sonarqube-73a38b94539a3f69c084c210cb2df9287d2c00e2.tar.gz sonarqube-73a38b94539a3f69c084c210cb2df9287d2c00e2.zip |
JsonAssert can ignore fields and small improvements
Diffstat (limited to 'server')
6 files changed, 19 insertions, 19 deletions
diff --git a/server/sonar-server/src/test/java/org/sonar/server/platform/ws/UpgradesActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/platform/ws/UpgradesActionTest.java index 0f9f96525c9..5c7bf51b6a6 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/platform/ws/UpgradesActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/platform/ws/UpgradesActionTest.java @@ -85,7 +85,7 @@ public class UpgradesActionTest { public void empty_array_is_returned_when_there_is_no_upgrade_available() throws Exception { underTest.handle(request, response); - assertJson(response.outputAsString()).setStrictArrayOrder(true).isSimilarTo(JSON_EMPTY_UPGRADE_LIST); + assertJson(response.outputAsString()).withStrictArrayOrder().isSimilarTo(JSON_EMPTY_UPGRADE_LIST); } @Test @@ -94,7 +94,7 @@ public class UpgradesActionTest { underTest.handle(request, response); - assertJson(response.outputAsString()).setStrictArrayOrder(true).isSimilarTo(JSON_EMPTY_UPGRADE_LIST); + assertJson(response.outputAsString()).withStrictArrayOrder().isSimilarTo(JSON_EMPTY_UPGRADE_LIST); } @Test @@ -104,7 +104,7 @@ public class UpgradesActionTest { underTest.handle(request, response); - assertJson(response.outputAsString()).setStrictArrayOrder(true) + assertJson(response.outputAsString()).withStrictArrayOrder() .isSimilarTo(getClass().getResource("example-upgrades_plugins.json")); } diff --git a/server/sonar-server/src/test/java/org/sonar/server/plugins/ws/AvailableActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/plugins/ws/AvailableActionTest.java index 2524a4962ce..97335260c32 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/plugins/ws/AvailableActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/plugins/ws/AvailableActionTest.java @@ -80,7 +80,7 @@ public class AvailableActionTest extends AbstractUpdateCenterBasedPluginsWsActio public void empty_array_is_returned_when_there_is_no_plugin_available() throws Exception { underTest.handle(request, response); - assertJson(response.outputAsString()).setStrictArrayOrder(true).isSimilarTo(JSON_EMPTY_PLUGIN_LIST); + assertJson(response.outputAsString()).withStrictArrayOrder().isSimilarTo(JSON_EMPTY_PLUGIN_LIST); } @Test @@ -89,7 +89,7 @@ public class AvailableActionTest extends AbstractUpdateCenterBasedPluginsWsActio underTest.handle(request, response); - assertJson(response.outputAsString()).setStrictArrayOrder(true).isSimilarTo(JSON_EMPTY_PLUGIN_LIST); + assertJson(response.outputAsString()).withStrictArrayOrder().isSimilarTo(JSON_EMPTY_PLUGIN_LIST); } @Test diff --git a/server/sonar-server/src/test/java/org/sonar/server/plugins/ws/InstalledActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/plugins/ws/InstalledActionTest.java index 6e0ba04f45c..5cec03674fb 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/plugins/ws/InstalledActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/plugins/ws/InstalledActionTest.java @@ -81,7 +81,7 @@ public class InstalledActionTest { public void empty_array_is_returned_when_there_is_not_plugin_installed() throws Exception { underTest.handle(request, response); - assertJson(response.outputAsString()).setStrictArrayOrder(true).isSimilarTo(JSON_EMPTY_PLUGIN_LIST); + assertJson(response.outputAsString()).withStrictArrayOrder().isSimilarTo(JSON_EMPTY_PLUGIN_LIST); } @Test @@ -90,7 +90,7 @@ public class InstalledActionTest { underTest.handle(request, response); - assertJson(response.outputAsString()).setStrictArrayOrder(true).isSimilarTo(JSON_EMPTY_PLUGIN_LIST); + assertJson(response.outputAsString()).withStrictArrayOrder().isSimilarTo(JSON_EMPTY_PLUGIN_LIST); } @Test @@ -169,7 +169,7 @@ public class InstalledActionTest { underTest.handle(request, response); - assertJson(response.outputAsString()).setStrictArrayOrder(true).isSimilarTo( + assertJson(response.outputAsString()).withStrictArrayOrder().isSimilarTo( "{" + " \"plugins\":" + " [" + @@ -193,7 +193,7 @@ public class InstalledActionTest { underTest.handle(request, response); - assertJson(response.outputAsString()).setStrictArrayOrder(true).isSimilarTo( + assertJson(response.outputAsString()).withStrictArrayOrder().isSimilarTo( "{" + " \"plugins\":" + " [" + diff --git a/server/sonar-server/src/test/java/org/sonar/server/plugins/ws/PendingActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/plugins/ws/PendingActionTest.java index b35c4c31c1a..69ce2b3f461 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/plugins/ws/PendingActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/plugins/ws/PendingActionTest.java @@ -72,7 +72,7 @@ public class PendingActionTest { public void empty_arrays_are_returned_when_there_nothing_pending() throws Exception { underTest.handle(request, response); - assertJson(response.outputAsString()).setStrictArrayOrder(true).isSimilarTo( + assertJson(response.outputAsString()).withStrictArrayOrder().isSimilarTo( "{" + " \"installing\": []," + " \"removing\": []" + @@ -86,7 +86,7 @@ public class PendingActionTest { underTest.handle(request, response); - assertJson(response.outputAsString()).setStrictArrayOrder(true).isSimilarTo( + assertJson(response.outputAsString()).withStrictArrayOrder().isSimilarTo( "{" + " \"installing\": []," + " \"removing\": []" + @@ -169,7 +169,7 @@ public class PendingActionTest { underTest.handle(request, response); - assertJson(response.outputAsString()).setStrictArrayOrder(true).isSimilarTo( + assertJson(response.outputAsString()).withStrictArrayOrder().isSimilarTo( "{" + " \"installing\": " + " [" + @@ -201,7 +201,7 @@ public class PendingActionTest { underTest.handle(request, response); - assertJson(response.outputAsString()).setStrictArrayOrder(true).isSimilarTo( + assertJson(response.outputAsString()).withStrictArrayOrder().isSimilarTo( "{" + " \"installing\": []," + " \"removing\": " + diff --git a/server/sonar-server/src/test/java/org/sonar/server/plugins/ws/PluginWSCommonsTest.java b/server/sonar-server/src/test/java/org/sonar/server/plugins/ws/PluginWSCommonsTest.java index 146115b6a4b..8eabde81459 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/plugins/ws/PluginWSCommonsTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/plugins/ws/PluginWSCommonsTest.java @@ -48,7 +48,7 @@ public class PluginWSCommonsTest { underTest.writePluginInfo(jsonWriter, gitPluginInfo(), null); jsonWriter.close(); - assertJson(response.outputAsString()).setStrictArrayOrder(true).isSimilarTo("{" + + assertJson(response.outputAsString()).withStrictArrayOrder().isSimilarTo("{" + " \"key\": \"scmgit\"," + " \"name\": \"Git\"," + " \"description\": \"Git SCM Provider.\"," + @@ -66,7 +66,7 @@ public class PluginWSCommonsTest { underTest.writePluginInfo(jsonWriter, gitPluginInfo(), "cat_1"); jsonWriter.close(); - assertJson(response.outputAsString()).setStrictArrayOrder(true).isSimilarTo("{" + + assertJson(response.outputAsString()).withStrictArrayOrder().isSimilarTo("{" + " \"key\": \"scmgit\"," + " \"name\": \"Git\"," + " \"description\": \"Git SCM Provider.\"," + @@ -127,7 +127,7 @@ public class PluginWSCommonsTest { jsonWriter.endObject(); jsonWriter.close(); - assertJson(response.outputAsString()).setStrictArrayOrder(true).isSimilarTo("{" + + assertJson(response.outputAsString()).withStrictArrayOrder().isSimilarTo("{" + " \"release\": {" + " \"version\": \"1.0\"," + " \"date\": \"2015-04-16\"," + @@ -144,7 +144,7 @@ public class PluginWSCommonsTest { jsonWriter.endObject(); jsonWriter.close(); - assertJson(response.outputAsString()).setStrictArrayOrder(true).isSimilarTo("{" + + assertJson(response.outputAsString()).withStrictArrayOrder().isSimilarTo("{" + " \"artifact\": {" + " \"name\": \"file.jar\"," + " \"url\": \"http://toto.com/file.jar\"" + diff --git a/server/sonar-server/src/test/java/org/sonar/server/plugins/ws/UpdatesActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/plugins/ws/UpdatesActionTest.java index 30c33a49e40..54783222df9 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/plugins/ws/UpdatesActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/plugins/ws/UpdatesActionTest.java @@ -95,7 +95,7 @@ public class UpdatesActionTest extends AbstractUpdateCenterBasedPluginsWsActionT public void empty_array_is_returned_when_there_is_no_plugin_available() throws Exception { underTest.handle(request, response); - assertJson(response.outputAsString()).setStrictArrayOrder(true).isSimilarTo(JSON_EMPTY_PLUGIN_LIST); + assertJson(response.outputAsString()).withStrictArrayOrder().isSimilarTo(JSON_EMPTY_PLUGIN_LIST); } @Test @@ -145,7 +145,7 @@ public class UpdatesActionTest extends AbstractUpdateCenterBasedPluginsWsActionT underTest.handle(request, response); - assertJson(response.outputAsString()).setStrictArrayOrder(true).isSimilarTo( + assertJson(response.outputAsString()).withStrictArrayOrder().isSimilarTo( "{" + " \"plugins\": [" + " {" + |