diff options
author | David Gageot <david@gageot.net> | 2015-05-07 19:04:22 +0200 |
---|---|---|
committer | David Gageot <david@gageot.net> | 2015-05-07 19:12:29 +0200 |
commit | 5a587fb74fd9a8c8839b6f8582f5ff15f5183805 (patch) | |
tree | b0201ec0afc1dad985a53c06c703a429d4bf095b /sonar-testing-harness/src | |
parent | 18834f5bf7f0bdd34912c46a83caaaac70db1e87 (diff) | |
download | sonarqube-5a587fb74fd9a8c8839b6f8582f5ff15f5183805.tar.gz sonarqube-5a587fb74fd9a8c8839b6f8582f5ff15f5183805.zip |
Redundant throws clause in tests
Diffstat (limited to 'sonar-testing-harness/src')
-rw-r--r-- | sonar-testing-harness/src/test/java/org/sonar/test/JsonAssertTest.java | 10 | ||||
-rw-r--r-- | sonar-testing-harness/src/test/java/org/sonar/test/JsonComparisonTest.java | 22 |
2 files changed, 16 insertions, 16 deletions
diff --git a/sonar-testing-harness/src/test/java/org/sonar/test/JsonAssertTest.java b/sonar-testing-harness/src/test/java/org/sonar/test/JsonAssertTest.java index 59a05d6506f..21fbee1c439 100644 --- a/sonar-testing-harness/src/test/java/org/sonar/test/JsonAssertTest.java +++ b/sonar-testing-harness/src/test/java/org/sonar/test/JsonAssertTest.java @@ -32,7 +32,7 @@ import static org.sonar.test.JsonAssert.assertJson; public class JsonAssertTest { @Test - public void isSimilarAs_strings() throws Exception { + public void isSimilarAs_strings() { assertJson("{}").isSimilarTo("{}"); try { @@ -46,7 +46,7 @@ public class JsonAssertTest { } @Test - public void isSimilarAs_urls() throws Exception { + public void isSimilarAs_urls() { URL url1 = getClass().getResource("JsonAssertTest/sample1.json"); URL url2 = getClass().getResource("JsonAssertTest/sample2.json"); assertJson(url1).isSimilarTo(url1); @@ -60,7 +60,7 @@ public class JsonAssertTest { } @Test - public void actual_can_be_superset_of_expected() throws Exception { + public void actual_can_be_superset_of_expected() { assertJson("{\"foo\": \"bar\"}").isSimilarTo("{}"); try { assertJson("{}").isSimilarTo("{\"foo\": \"bar\"}"); @@ -76,7 +76,7 @@ public class JsonAssertTest { } @Test - public void enable_strict_order_of_arrays() throws Exception { + public void enable_strict_order_of_arrays() { try { assertJson("[1,2]").setStrictArrayOrder(true).isSimilarTo("[2, 1]"); fail(); @@ -86,7 +86,7 @@ public class JsonAssertTest { } @Test - public void enable_strict_timezone() throws Exception { + public void enable_strict_timezone() { try { assertJson("[\"2010-05-18T15:50:45+0100\"]").setStrictTimezone(true).isSimilarTo("[\"2010-05-18T16:50:45+0200\"]"); fail(); diff --git a/sonar-testing-harness/src/test/java/org/sonar/test/JsonComparisonTest.java b/sonar-testing-harness/src/test/java/org/sonar/test/JsonComparisonTest.java index 6dc57199a7c..d640a76367d 100644 --- a/sonar-testing-harness/src/test/java/org/sonar/test/JsonComparisonTest.java +++ b/sonar-testing-harness/src/test/java/org/sonar/test/JsonComparisonTest.java @@ -31,13 +31,13 @@ public class JsonComparisonTest { } @Test - public void syntax_agnostic() throws Exception { + public void syntax_agnostic() { assertThat(areSimilar("{}", " { } ")).isTrue(); assertThat(areSimilar("{\"foo\":\"bar\"}", "{\"foo\": \"bar\" \n }")).isTrue(); } @Test - public void object() throws Exception { + public void object() { assertThat(areSimilar("{}", "{}")).isTrue(); // exactly the same @@ -54,7 +54,7 @@ public class JsonComparisonTest { } @Test - public void strict_order_of_array() throws Exception { + public void strict_order_of_array() { assertThat(isSimilar_strict_array_order("[]", "[]")).isTrue(); assertThat(isSimilar_strict_array_order("[1, 2]", "[1, 2]")).isTrue(); @@ -66,7 +66,7 @@ public class JsonComparisonTest { } @Test - public void lenient_order_of_array() throws Exception { + public void lenient_order_of_array() { assertThat(areSimilar("[]", "[]")).isTrue(); assertThat(areSimilar("[1, 2]", "[1, 2]")).isTrue(); assertThat(areSimilar("[1, 2]", "[1]")).isFalse(); @@ -77,12 +77,12 @@ public class JsonComparisonTest { } @Test - public void lenient_order_of_arrays_by_default() throws Exception { + public void lenient_order_of_arrays_by_default() { assertThat(new JsonComparison().isStrictArrayOrder()).isFalse(); } @Test - public void null_value() throws Exception { + public void null_value() { assertThat(areSimilar("[null]", "[null]")).isTrue(); assertThat(areSimilar("[null]", "[]")).isFalse(); @@ -99,7 +99,7 @@ public class JsonComparisonTest { } @Test - public void maps_and_arrays() throws Exception { + public void maps_and_arrays() { assertThat(areSimilar("[]", "{}")).isFalse(); assertThat(areSimilar("{}", "[]")).isFalse(); @@ -121,7 +121,7 @@ public class JsonComparisonTest { } @Test - public void lenient_timezone() throws Exception { + public void lenient_timezone() { // lenient mode by default assertThat(new JsonComparison().isStrictTimezone()).isFalse(); @@ -136,7 +136,7 @@ public class JsonComparisonTest { } @Test - public void strict_timezone() throws Exception { + public void strict_timezone() { assertThat(new JsonComparison().setStrictTimezone(true).isStrictTimezone()).isTrue(); // same instant, same timezone @@ -151,7 +151,7 @@ public class JsonComparisonTest { } @Test - public void compare_doubles() throws Exception { + public void compare_doubles() { assertThat(areSimilar("{\"foo\": true}", "{\"foo\": false}")).isFalse(); assertThat(areSimilar("{\"foo\": true}", "{\"foo\": true}")).isTrue(); assertThat(areSimilar("{\"foo\": true}", "{\"foo\": \"true\"}")).isFalse(); @@ -159,7 +159,7 @@ public class JsonComparisonTest { } @Test - public void compare_booleans() throws Exception { + public void compare_booleans() { assertThat(areSimilar("{\"foo\": 3.14}", "{\"foo\": 3.14000000}")).isTrue(); assertThat(areSimilar("{\"foo\": 3.14}", "{\"foo\": 3.1400001}")).isTrue(); } |