Remove unnecessary throws declaration in tests

See gh-26441
This commit is contained in:
weixsun
2021-05-13 00:22:53 +08:00
committed by Stephane Nicoll
parent 574655dc84
commit 8a2be288a3
129 changed files with 345 additions and 369 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -61,7 +61,7 @@ class WebTestClientRestDocsAutoConfigurationAdvancedConfigurationIntegrationTest
}
@Test
void defaultSnippetsAreWritten() throws Exception {
void defaultSnippetsAreWritten() {
this.webTestClient.get().uri("/").exchange().expectStatus().is2xxSuccessful().expectBody()
.consumeWith(document("default-snippets"));
File defaultSnippetsDir = new File(this.generatedSnippets, "default-snippets");

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -54,7 +54,7 @@ class WebTestClientRestDocsAutoConfigurationIntegrationTests {
}
@Test
void defaultSnippetsAreWritten() throws Exception {
void defaultSnippetsAreWritten() {
this.webTestClient.get().uri("/").exchange().expectStatus().is2xxSuccessful().expectBody()
.consumeWith(document("default-snippets"));
File defaultSnippetsDir = new File(this.generatedSnippets, "default-snippets");

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -67,7 +67,7 @@ class WebTestClientSpringBootTestIntegrationTests {
static class TestConfiguration {
@Bean
SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) throws Exception {
SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
http.authorizeExchange((exchanges) -> exchanges.anyExchange().permitAll());
return http.build();
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -70,7 +70,7 @@ class WebMvcTestAllControllersIntegrationTests {
}
@Test
void shouldRunValidationFailure() throws Exception {
void shouldRunValidationFailure() {
assertThatExceptionOfType(NestedServletException.class)
.isThrownBy(() -> this.mvc.perform(get("/three/invalid")))
.withCauseInstanceOf(ConstraintViolationException.class);