Skip to content

Commit

Permalink
Merge pull request #10574 from Captain1653/unnecessary-throws
Browse files Browse the repository at this point in the history
Remove unnecessary exceptions from signature in tests from core/play
  • Loading branch information
mergify[bot] committed Dec 4, 2020
2 parents b564f21 + 704b2ad commit 5d24e86
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 31 deletions.
26 changes: 13 additions & 13 deletions core/play/src/test/java/play/core/PathsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
public final class PathsTest {
/** Current Path: /playframework Target Path: /one Relative Path: one */
@Test
public void testRelative1() throws Throwable {
public void testRelative1() {
final String startPath = "/playframework";
final String targetPath = "/one";

Expand All @@ -23,7 +23,7 @@ public void testRelative1() throws Throwable {

/** Current Path: /one/two Target Path: /one/two/asset.js Relative Path: two/asset.js */
@Test
public void testRelative2() throws Throwable {
public void testRelative2() {
final String startPath = "/one/two";
final String targetPath = "/one/two/asset.js";

Expand All @@ -35,7 +35,7 @@ public void testRelative2() throws Throwable {

/** Current Path: /one/two Target Path: /one Relative Path: ../one */
@Test
public void testRelative3() throws Throwable {
public void testRelative3() {
final String startPath = "/one/two";
final String targetPath = "/one";

Expand All @@ -47,7 +47,7 @@ public void testRelative3() throws Throwable {

/** Current Path: /one/two/ Target Path: /one/ Relative Path: ../ */
@Test
public void testRelative4() throws Throwable {
public void testRelative4() {
final String startPath = "/one/two/";
final String targetPath = "/one/";

Expand All @@ -59,7 +59,7 @@ public void testRelative4() throws Throwable {

/** Current Path: /one/two Target Path: /one-b/two-b Relative Path: ../one-b/two-b */
@Test
public void testRelative5() throws Throwable {
public void testRelative5() {
final String startPath = "/one/two";
final String targetPath = "/one-b/two-b";

Expand All @@ -74,7 +74,7 @@ public void testRelative5() throws Throwable {
* ../../one-b/two-b
*/
@Test
public void testRelative6() throws Throwable {
public void testRelative6() {
final String startPath = "/one/two/three";
final String targetPath = "/one-b/two-b/asset.js";

Expand All @@ -89,7 +89,7 @@ public void testRelative6() throws Throwable {
* "../three-b/four-b/asset.js
*/
@Test
public void testRelative7() throws Throwable {
public void testRelative7() {
final String startPath = "/one/two/three/four";
final String targetPath = "/one/two/three-b/four-b/asset.js";

Expand All @@ -101,7 +101,7 @@ public void testRelative7() throws Throwable {

/** Current Path: /one/two/ Target Path: /one/two-c/ Relative Path: two-c/ */
@Test
public void testRelative8() throws Throwable {
public void testRelative8() {
final String startPath = "/one/two";
final String targetPath = "/one/two-c/";

Expand All @@ -113,7 +113,7 @@ public void testRelative8() throws Throwable {

/** Current Path: /one/two Target Path: /one/two Relative Path: . */
@Test
public void testRelative9() throws Throwable {
public void testRelative9() {
final String startPath = "/one/two";
final String targetPath = "/one/two";

Expand All @@ -126,7 +126,7 @@ public void testRelative9() throws Throwable {
* ../../../../one-b/two-b/
*/
@Test
public void testRelative10() throws Throwable {
public void testRelative10() {
final String startPath = "/one/two//three/../three-b/./four/";
final String targetPath = "/one-b//two-b/./";

Expand All @@ -138,7 +138,7 @@ public void testRelative10() throws Throwable {

/** Path: /one/two/../two-b/three Canonical Path: /one/two-b/three */
@Test
public void testCanonical1() throws Throwable {
public void testCanonical1() {
final String targetPath = "/one/two/../two-b/three";

assertEquals(
Expand All @@ -149,7 +149,7 @@ public void testCanonical1() throws Throwable {

/** Path: /one/two/./three Canonical Path: /one/two/three */
@Test
public void testCanonical2() throws Throwable {
public void testCanonical2() {
final String targetPath = "/one/two/./three";

assertEquals(
Expand All @@ -160,7 +160,7 @@ public void testCanonical2() throws Throwable {

/** Path: /one/two//three Canonical Path: /one/two/three */
@Test
public void testCanonical3() throws Throwable {
public void testCanonical3() {
final String targetPath = "/one/two//three";

assertEquals(
Expand Down
36 changes: 18 additions & 18 deletions core/play/src/test/java/play/mvc/CallTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@
public final class CallTest {

@Test
public void testHttpURL1() throws Throwable {
public void testHttpURL1() {
final TestCall call = new TestCall("/myurl", "GET");

assertEquals("Call should return correct url in path()", "/myurl", call.path());
}

@Test
public void testHttpURL2() throws Throwable {
public void testHttpURL2() {
final Call call = new TestCall("/myurl", "GET").withFragment("myfragment");

assertEquals(
"Call should return correct url and fragment in path()", "/myurl#myfragment", call.path());
}

@Test
public void testHttpAbsoluteURL1() throws Throwable {
public void testHttpAbsoluteURL1() {
final Request req = new RequestBuilder().uri("http://playframework.com/playframework").build();

final TestCall call = new TestCall("/url", "GET");
Expand All @@ -41,7 +41,7 @@ public void testHttpAbsoluteURL1() throws Throwable {
}

@Test
public void testHttpAbsoluteURL2() throws Throwable {
public void testHttpAbsoluteURL2() {
final Request req = new RequestBuilder().uri("https://playframework.com/playframework").build();

final TestCall call = new TestCall("/url", "GET");
Expand All @@ -53,7 +53,7 @@ public void testHttpAbsoluteURL2() throws Throwable {
}

@Test
public void testHttpAbsoluteURL3() throws Throwable {
public void testHttpAbsoluteURL3() {
final TestCall call = new TestCall("/url", "GET");

assertEquals(
Expand All @@ -63,7 +63,7 @@ public void testHttpAbsoluteURL3() throws Throwable {
}

@Test
public void testHttpsAbsoluteURL1() throws Throwable {
public void testHttpsAbsoluteURL1() {
final Request req = new RequestBuilder().uri("https://playframework.com/playframework").build();

final TestCall call = new TestCall("/url", "GET");
Expand All @@ -75,7 +75,7 @@ public void testHttpsAbsoluteURL1() throws Throwable {
}

@Test
public void testHttpsAbsoluteURL2() throws Throwable {
public void testHttpsAbsoluteURL2() {
final Request req = new RequestBuilder().uri("http://playframework.com/playframework").build();

final TestCall call = new TestCall("/url", "GET");
Expand All @@ -87,7 +87,7 @@ public void testHttpsAbsoluteURL2() throws Throwable {
}

@Test
public void testHttpsAbsoluteURL3() throws Throwable {
public void testHttpsAbsoluteURL3() {
final TestCall call = new TestCall("/url", "GET");

assertEquals(
Expand All @@ -97,7 +97,7 @@ public void testHttpsAbsoluteURL3() throws Throwable {
}

@Test
public void testWebSocketURL1() throws Throwable {
public void testWebSocketURL1() {
final Request req = new RequestBuilder().uri("http://playframework.com/playframework").build();

final TestCall call = new TestCall("/url", "GET");
Expand All @@ -109,7 +109,7 @@ public void testWebSocketURL1() throws Throwable {
}

@Test
public void testWebSocketURL2() throws Throwable {
public void testWebSocketURL2() {
final Request req = new RequestBuilder().uri("https://playframework.com/playframework").build();

final TestCall call = new TestCall("/url", "GET");
Expand All @@ -121,7 +121,7 @@ public void testWebSocketURL2() throws Throwable {
}

@Test
public void testWebSocketURL3() throws Throwable {
public void testWebSocketURL3() {
final TestCall call = new TestCall("/url", "GET");

assertEquals(
Expand All @@ -131,7 +131,7 @@ public void testWebSocketURL3() throws Throwable {
}

@Test
public void testSecureWebSocketURL1() throws Throwable {
public void testSecureWebSocketURL1() {
final Request req = new RequestBuilder().uri("https://playframework.com/playframework").build();

final TestCall call = new TestCall("/url", "GET");
Expand All @@ -143,7 +143,7 @@ public void testSecureWebSocketURL1() throws Throwable {
}

@Test
public void testSecureWebSocketURL2() throws Throwable {
public void testSecureWebSocketURL2() {
final Request req = new RequestBuilder().uri("http://playframework.com/playframework").build();

final TestCall call = new TestCall("/url", "GET");
Expand All @@ -155,7 +155,7 @@ public void testSecureWebSocketURL2() throws Throwable {
}

@Test
public void testSecureWebSocketURL3() throws Throwable {
public void testSecureWebSocketURL3() {
final TestCall call = new TestCall("/url", "GET");

assertEquals(
Expand All @@ -165,7 +165,7 @@ public void testSecureWebSocketURL3() throws Throwable {
}

@Test
public void testRelative1() throws Throwable {
public void testRelative1() {
final Request req = new RequestBuilder().uri("http://playframework.com/one/two").build();

final TestCall call = new TestCall("/one/two-b", "GET");
Expand All @@ -174,7 +174,7 @@ public void testRelative1() throws Throwable {
}

@Test
public void testRelative2() throws Throwable {
public void testRelative2() {
final String startPath = "/one/two";

final TestCall call = new TestCall("/one/two-b", "GET");
Expand All @@ -183,7 +183,7 @@ public void testRelative2() throws Throwable {
}

@Test
public void testRelative3() throws Throwable {
public void testRelative3() {
final Request req = new RequestBuilder().uri("http://playframework.com/one/two").build();

final TestCall call = new TestCall("/one/two-b", "GET", "foo");
Expand All @@ -192,7 +192,7 @@ public void testRelative3() throws Throwable {
}

@Test
public void testCanonical() throws Throwable {
public void testCanonical() {
final TestCall call = new TestCall("/one/.././two//three-b", "GET");

assertEquals("Canonical path returned from Call", "/two/three-b", call.canonical());
Expand Down

0 comments on commit 5d24e86

Please sign in to comment.