Remove unnecessary throws declaration in tests
See gh-26441
This commit is contained in:
@@ -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");
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user