Remove redundant throws clauses
Removes exceptions that are declared in a method's signature but never thrown by the method itself or its implementations/derivatives.
This commit is contained in:
+2
-2
@@ -90,13 +90,13 @@ public class MultiAnnotationTests {
|
||||
}
|
||||
|
||||
@Test(expected = AccessDeniedException.class)
|
||||
public void preAuthorizedOnlyServiceDeniesIfRoleMissing() throws Exception {
|
||||
public void preAuthorizedOnlyServiceDeniesIfRoleMissing() {
|
||||
SecurityContextHolder.getContext().setAuthentication(joe_b);
|
||||
preService.preAuthorizedMethod();
|
||||
}
|
||||
|
||||
@Test(expected = AccessDeniedException.class)
|
||||
public void securedOnlyRoleAServiceDeniesIfRoleMissing() throws Exception {
|
||||
public void securedOnlyRoleAServiceDeniesIfRoleMissing() {
|
||||
SecurityContextHolder.getContext().setAuthentication(joe_b);
|
||||
secService.securedMethod();
|
||||
}
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ public class SEC933ApplicationContextTests {
|
||||
private UserDetailsService userDetailsService;
|
||||
|
||||
@Test
|
||||
public void testSimpleApplicationContextBootstrap() throws Exception {
|
||||
public void testSimpleApplicationContextBootstrap() {
|
||||
assertThat(userDetailsService).isNotNull();
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ public class PythonInterpreterBasedSecurityTests {
|
||||
private TestService service;
|
||||
|
||||
@Test
|
||||
public void serviceMethod() throws Exception {
|
||||
public void serviceMethod() {
|
||||
SecurityContextHolder.getContext().setAuthentication(
|
||||
new UsernamePasswordAuthenticationToken("bob", "bobspassword"));
|
||||
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ public abstract class AbstractWebServerIntegrationTests {
|
||||
}
|
||||
}
|
||||
|
||||
protected final MockMvc createMockMvc(String... configLocations) throws Exception {
|
||||
protected final MockMvc createMockMvc(String... configLocations) {
|
||||
if (this.context != null) {
|
||||
throw new IllegalStateException("context is already loaded");
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
public class TestController {
|
||||
|
||||
@RequestMapping(value = "/secure/file?with?special?chars.htm", method = RequestMethod.GET)
|
||||
public String sec1255TestUrl() throws IOException {
|
||||
public String sec1255TestUrl() {
|
||||
return "I'm file?with?special?chars.htm";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user