From 8a2be288a3b695a08551e5b11e75b33759662df3 Mon Sep 17 00:00:00 2001 From: weixsun Date: Thu, 13 May 2021 00:22:53 +0800 Subject: [PATCH] Remove unnecessary throws declaration in tests See gh-26441 --- ...FoundryActuatorAutoConfigurationTests.java | 2 +- .../servlet/TokenValidatorTests.java | 14 ++++++------- .../ConditionalOnAvailableEndpointTests.java | 4 ++-- .../IncludeExcludeEndpointFilterTests.java | 4 ++-- ...ngsEndpointReactiveDocumentationTests.java | 4 ++-- ...ingsEndpointServletDocumentationTests.java | 4 ++-- ...rollerEndpointWebFluxIntegrationTests.java | 4 ++-- .../WebFluxEndpointIntegrationTests.java | 4 ++-- ...ebMvcEndpointExposureIntegrationTests.java | 2 +- ...mentWebSecurityAutoConfigurationTests.java | 6 +++--- .../endpoint/jmx/EndpointMBeanTests.java | 16 +++++++-------- ...ControllerEndpointHandlerMappingTests.java | 10 +++++----- ...ControllerEndpointHandlerMappingTests.java | 4 ++-- .../actuate/env/EnvironmentEndpointTests.java | 4 ++-- ...LogFileWebEndpointWebIntegrationTests.java | 4 ++-- ...eapDumpWebEndpointWebIntegrationTests.java | 6 +++--- ...ThreadDumpEndpointWebIntegrationTests.java | 6 +++--- .../WebMvcMetricsIntegrationTests.java | 4 ++-- .../http/servlet/HttpTraceFilterTests.java | 4 ++-- .../amqp/RabbitAutoConfigurationTests.java | 17 ++++++++-------- ...atchAutoConfigurationWithoutJdbcTests.java | 10 +++++----- .../jdbc/DataSourcePropertiesTests.java | 2 +- .../JndiDataSourceAutoConfigurationTests.java | 11 +++++----- .../jndi/TestableInitialContextFactory.java | 6 +++--- .../EmbeddedMongoAutoConfigurationTests.java | 5 ++--- ...ocketWebSocketNettyRouteProviderTests.java | 4 ++-- ...2ResourceServerAutoConfigurationTests.java | 2 +- .../jta/JtaAutoConfigurationTests.java | 3 +-- .../web/ServerPropertiesTests.java | 4 ++-- ...ervletWebServerFactoryCustomizerTests.java | 4 ++-- ...asicErrorControllerDirectMockMvcTests.java | 4 ++-- .../BasicErrorControllerMockMvcTests.java | 4 ++-- .../error/ErrorMvcAutoConfigurationTests.java | 4 ++-- .../boot/cli/ReproIntegrationTests.java | 4 ++-- .../boot/cli/command/CommandRunnerTests.java | 10 +++++----- .../init/ProjectGenerationRequestTests.java | 4 ++-- .../run/SpringApplicationRunnerTests.java | 4 ++-- ...ithLazyInitializationIntegrationTests.java | 6 ++---- .../tests/RemoteApplicationLauncher.java | 6 +++--- ...ooledDataSourceAutoConfigurationTests.java | 5 ++--- .../devtools/filewatch/ChangedFileTests.java | 14 ++++++------- .../filewatch/DirectorySnapshotTests.java | 6 +++--- .../devtools/filewatch/FileSnapshotTests.java | 4 ++-- .../filewatch/FileSystemWatcherTests.java | 4 ++-- .../ConnectionInputStreamTests.java | 6 +++--- .../boot/devtools/livereload/FrameTests.java | 6 +++--- .../livereload/LiveReloadServerTests.java | 4 ++-- .../client/DelayedLiveReloadTriggerTests.java | 4 ++-- .../client/HttpHeaderInterceptorTests.java | 4 ++-- .../devtools/restart/MainMethodTests.java | 6 +++--- .../classloader/RestartClassLoaderTests.java | 4 ++-- .../HttpTunnelPayloadForwarderTests.java | 4 ++-- .../payload/HttpTunnelPayloadTests.java | 4 ++-- .../tunnel/server/HttpTunnelServerTests.java | 4 ++-- .../MetricsHealthMicrometerExportTests.java | 2 +- ...AdvancedConfigurationIntegrationTests.java | 4 ++-- ...DocsAutoConfigurationIntegrationTests.java | 4 ++-- ...tClientSpringBootTestIntegrationTests.java | 4 ++-- ...MvcTestAllControllersIntegrationTests.java | 4 ++-- .../test/json/JsonContentAssertTests.java | 20 +++++++++---------- .../web/client/TestRestTemplateTests.java | 8 ++++---- .../build/BuildpackResolversTests.java | 4 ++-- .../platform/build/ImageBuildpackTests.java | 4 ++-- .../platform/json/MappedObjectTests.java | 4 ++-- ...ionMetadataRepositoryJsonBuilderTests.java | 2 +- .../JsonReaderTests.java | 4 ++-- ...ationMetadataAnnotationProcessorTests.java | 2 +- ...gratingWithActuatorDocumentationTests.java | 8 ++++---- .../docs/PublishingDocumentationTests.java | 6 ++---- .../docs/RunningDocumentationTests.java | 10 +++++----- .../dsl/BuildInfoDslIntegrationTests.java | 14 ++++++------- .../buildinfo/BuildInfoIntegrationTests.java | 2 +- .../AbstractBootArchiveIntegrationTests.java | 11 +++++----- ...ootBuildImageRegistryIntegrationTests.java | 2 +- .../tasks/bundling/MavenIntegrationTests.java | 6 ++---- .../MavenPublishingIntegrationTests.java | 8 +++----- .../layertools/ExtractCommandTests.java | 2 +- .../layertools/IndexedLayersTests.java | 2 +- .../boot/loader/tools/FileUtilsTests.java | 4 ++-- .../boot/loader/tools/LayersIndexTests.java | 4 ++-- .../boot/loader/ClassPathIndexFileTests.java | 4 ++-- .../boot/loader/PropertiesLauncherTests.java | 4 ++-- .../data/RandomAccessDataFileTests.java | 14 ++++++------- .../springframework/boot/SimpleMainTests.java | 4 ++-- ...gApplicationAdminMXBeanRegistrarTests.java | 4 ++-- .../ApplicationPidFileWriterTests.java | 10 +++++----- .../config/ConfigDataLoadersTests.java | 2 +- ...ngApplicationListenerIntegrationTests.java | 4 ++-- .../LoggingApplicationListenerTests.java | 4 ++-- ...ConfigurationPropertiesRegistrarTests.java | 14 ++++++------- .../properties/bind/BindResultTests.java | 4 ++-- .../bind/DataObjectPropertyNameTests.java | 4 ++-- .../ValidationBindHandlerTests.java | 6 +++--- .../convert/InetAddressFormatterTests.java | 4 ++-- .../NoSnakeYamlPropertySourceLoaderTests.java | 4 ++-- .../OriginTrackedPropertiesLoaderTests.java | 4 ++-- .../env/OriginTrackedYamlLoaderTests.java | 4 ++-- .../boot/json/YamlJsonParserTests.java | 4 ++-- ...lderClientHttpRequestInitializerTests.java | 11 +++++----- .../web/client/RestTemplateBuilderTests.java | 15 +++++++------- .../context/WebServerPortFileWriterTests.java | 12 +++++------ .../Jetty10ServletWebServerFactoryTests.java | 2 +- .../JettyReactiveWebServerFactoryTests.java | 4 ++-- .../JettyServletWebServerFactoryTests.java | 2 +- .../NettyReactiveWebServerFactoryTests.java | 4 ++-- .../netty/SslServerCustomizerTests.java | 6 +++--- .../TomcatReactiveWebServerFactoryTests.java | 4 ++-- .../undertow/FileSessionPersistenceTests.java | 3 +-- ...UndertowReactiveWebServerFactoryTests.java | 13 +++++------- .../UndertowServletWebServerFactoryTests.java | 14 ++++++------- .../servlet/FilterRegistrationBeanTests.java | 4 ++-- .../servlet/ServletRegistrationBeanTests.java | 4 ++-- .../web/servlet/WebFilterHandlerTests.java | 4 ++-- .../web/servlet/WebServletHandlerTests.java | 4 ++-- ...rvletWebServerApplicationContextTests.java | 8 ++++---- .../web/servlet/server/DocumentRootTests.java | 4 ++-- .../aop/SampleAopApplicationTests.java | 6 +++--- .../SampleIntegrationApplicationTests.java | 8 ++++---- .../kafka/SampleKafkaApplicationTests.java | 4 ++-- .../SampleLiquibaseApplicationTests.java | 4 ++-- .../SampleLogbackApplicationTests.java | 6 +++--- ...mpleIntegrationParentApplicationTests.java | 2 +- ...anagementPortSampleSecureWebFluxTests.java | 2 +- ...ampleSecureWebFluxCustomSecurityTests.java | 2 +- .../SampleTestNoMockitoApplicationTests.java | 4 ++-- ...igurationSampleTomcatApplicationTests.java | 4 ++-- .../jsp/SampleWebJspApplicationTests.java | 4 ++-- .../xml/SampleSpringXmlApplicationTests.java | 4 ++-- ...ringXmlPlaceholderBeanDefinitionTests.java | 4 ++-- 129 files changed, 345 insertions(+), 369 deletions(-) diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryActuatorAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryActuatorAutoConfigurationTests.java index d94d8aec49..2bc35b8b06 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryActuatorAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryActuatorAutoConfigurationTests.java @@ -96,7 +96,7 @@ class CloudFoundryActuatorAutoConfigurationTests { } @Test - void cloudfoundryapplicationProducesActuatorMediaType() throws Exception { + void cloudfoundryapplicationProducesActuatorMediaType() { this.contextRunner.withPropertyValues("VCAP_APPLICATION:---", "vcap.application.application_id:my-app-id", "vcap.application.cf_api:https://my-cloud-controller.com").run((context) -> { MockMvc mockMvc = MockMvcBuilders.webAppContextSetup(context).build(); diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/TokenValidatorTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/TokenValidatorTests.java index da6b83b0cd..a7b568ecbd 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/TokenValidatorTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/TokenValidatorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 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. @@ -91,7 +91,7 @@ class TokenValidatorTests { } @Test - void validateTokenWhenKidValidationFailsTwiceShouldThrowException() throws Exception { + void validateTokenWhenKidValidationFailsTwiceShouldThrowException() { ReflectionTestUtils.setField(this.tokenValidator, "tokenKeys", INVALID_KEYS); given(this.securityService.fetchTokenKeys()).willReturn(INVALID_KEYS); String header = "{\"alg\": \"RS256\", \"kid\": \"valid-key\",\"typ\": \"JWT\"}"; @@ -133,7 +133,7 @@ class TokenValidatorTests { } @Test - void validateTokenWhenSignatureInvalidShouldThrowException() throws Exception { + void validateTokenWhenSignatureInvalidShouldThrowException() { ReflectionTestUtils.setField(this.tokenValidator, "tokenKeys", Collections.singletonMap("valid-key", INVALID_KEY)); String header = "{ \"alg\": \"RS256\", \"kid\": \"valid-key\",\"typ\": \"JWT\"}"; @@ -144,7 +144,7 @@ class TokenValidatorTests { } @Test - void validateTokenWhenTokenAlgorithmIsNotRS256ShouldThrowException() throws Exception { + void validateTokenWhenTokenAlgorithmIsNotRS256ShouldThrowException() { String header = "{ \"alg\": \"HS256\", \"typ\": \"JWT\"}"; String claims = "{ \"exp\": 2147483647, \"iss\": \"http://localhost:8080/uaa/oauth/token\", \"scope\": [\"actuator.read\"]}"; assertThatExceptionOfType(CloudFoundryAuthorizationException.class).isThrownBy( @@ -153,7 +153,7 @@ class TokenValidatorTests { } @Test - void validateTokenWhenExpiredShouldThrowException() throws Exception { + void validateTokenWhenExpiredShouldThrowException() { given(this.securityService.fetchTokenKeys()).willReturn(VALID_KEYS); given(this.securityService.fetchTokenKeys()).willReturn(VALID_KEYS); String header = "{ \"alg\": \"RS256\", \"kid\": \"valid-key\", \"typ\": \"JWT\"}"; @@ -164,7 +164,7 @@ class TokenValidatorTests { } @Test - void validateTokenWhenIssuerIsNotValidShouldThrowException() throws Exception { + void validateTokenWhenIssuerIsNotValidShouldThrowException() { given(this.securityService.fetchTokenKeys()).willReturn(VALID_KEYS); given(this.securityService.getUaaUrl()).willReturn("https://other-uaa.com"); String header = "{ \"alg\": \"RS256\", \"kid\": \"valid-key\", \"typ\": \"JWT\", \"scope\": [\"actuator.read\"]}"; @@ -175,7 +175,7 @@ class TokenValidatorTests { } @Test - void validateTokenWhenAudienceIsNotValidShouldThrowException() throws Exception { + void validateTokenWhenAudienceIsNotValidShouldThrowException() { given(this.securityService.fetchTokenKeys()).willReturn(VALID_KEYS); given(this.securityService.getUaaUrl()).willReturn("http://localhost:8080/uaa"); String header = "{ \"alg\": \"RS256\", \"kid\": \"valid-key\", \"typ\": \"JWT\"}"; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/condition/ConditionalOnAvailableEndpointTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/condition/ConditionalOnAvailableEndpointTests.java index c53e299a47..49f18df9d4 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/condition/ConditionalOnAvailableEndpointTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/condition/ConditionalOnAvailableEndpointTests.java @@ -183,14 +183,14 @@ class ConditionalOnAvailableEndpointTests { } @Test // gh-21044 - void outcomeWhenIncludeAllShouldMatchDashedEndpoint() throws Exception { + void outcomeWhenIncludeAllShouldMatchDashedEndpoint() { this.contextRunner.withUserConfiguration(DashedEndpointConfiguration.class) .withPropertyValues("management.endpoints.web.exposure.include=*") .run((context) -> assertThat(context).hasSingleBean(DashedEndpoint.class)); } @Test // gh-21044 - void outcomeWhenIncludeDashedShouldMatchDashedEndpoint() throws Exception { + void outcomeWhenIncludeDashedShouldMatchDashedEndpoint() { this.contextRunner.withUserConfiguration(DashedEndpointConfiguration.class) .withPropertyValues("management.endpoints.web.exposure.include=test-dashed") .run((context) -> assertThat(context).hasSingleBean(DashedEndpoint.class)); diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/expose/IncludeExcludeEndpointFilterTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/expose/IncludeExcludeEndpointFilterTests.java index 3b439bbc16..aefe8aae5a 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/expose/IncludeExcludeEndpointFilterTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/expose/IncludeExcludeEndpointFilterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 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. @@ -145,7 +145,7 @@ class IncludeExcludeEndpointFilterTests { } @Test // gh-20997 - void matchWhenDashInName() throws Exception { + void matchWhenDashInName() { setupFilter("bus-refresh", ""); assertThat(match(EndpointId.of("bus-refresh"))).isTrue(); } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/MappingsEndpointReactiveDocumentationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/MappingsEndpointReactiveDocumentationTests.java index 9be633f7db..f0733a31c5 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/MappingsEndpointReactiveDocumentationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/MappingsEndpointReactiveDocumentationTests.java @@ -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. @@ -77,7 +77,7 @@ class MappingsEndpointReactiveDocumentationTests extends AbstractEndpointDocumen } @Test - void mappings() throws Exception { + void mappings() { List requestMappingConditions = Arrays.asList( requestMappingConditionField("").description("Details of the request mapping conditions.").optional(), requestMappingConditionField(".consumes").description("Details of the consumes condition"), diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/MappingsEndpointServletDocumentationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/MappingsEndpointServletDocumentationTests.java index b4c5c6b4e2..217a50d0e9 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/MappingsEndpointServletDocumentationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/MappingsEndpointServletDocumentationTests.java @@ -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. @@ -76,7 +76,7 @@ class MappingsEndpointServletDocumentationTests extends AbstractEndpointDocument } @Test - void mappings() throws Exception { + void mappings() { ResponseFieldsSnippet commonResponseFields = responseFields( fieldWithPath("contexts").description("Application contexts keyed by id."), fieldWithPath("contexts.*.mappings").description("Mappings in the context, keyed by mapping type."), diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/ControllerEndpointWebFluxIntegrationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/ControllerEndpointWebFluxIntegrationTests.java index 518f0a9e59..442ad7dff8 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/ControllerEndpointWebFluxIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/ControllerEndpointWebFluxIntegrationTests.java @@ -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. @@ -56,7 +56,7 @@ class ControllerEndpointWebFluxIntegrationTests { } @Test - void endpointsCanBeAccessed() throws Exception { + void endpointsCanBeAccessed() { TestSecurityContextHolder.getContext() .setAuthentication(new TestingAuthenticationToken("user", "N/A", "ROLE_ACTUATOR")); this.context = new AnnotationConfigReactiveWebApplicationContext(); diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebFluxEndpointIntegrationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebFluxEndpointIntegrationTests.java index a443dab7f4..65bf929442 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebFluxEndpointIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebFluxEndpointIntegrationTests.java @@ -51,7 +51,7 @@ class WebFluxEndpointIntegrationTests { .withUserConfiguration(EndpointsConfiguration.class); @Test - void linksAreProvidedToAllEndpointTypes() throws Exception { + void linksAreProvidedToAllEndpointTypes() { this.contextRunner.withPropertyValues("management.endpoints.web.exposure.include:*").run((context) -> { WebTestClient client = createWebTestClient(context); client.get().uri("/actuator").exchange().expectStatus().isOk().expectBody().jsonPath("_links.beans") @@ -61,7 +61,7 @@ class WebFluxEndpointIntegrationTests { } @Test - void linksPageIsNotAvailableWhenDisabled() throws Exception { + void linksPageIsNotAvailableWhenDisabled() { this.contextRunner.withPropertyValues("management.endpoints.web.discovery.enabled=false").run((context) -> { WebTestClient client = createWebTestClient(context); client.get().uri("/actuator").exchange().expectStatus().isNotFound(); diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebMvcEndpointExposureIntegrationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebMvcEndpointExposureIntegrationTests.java index e928364237..f01f078596 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebMvcEndpointExposureIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebMvcEndpointExposureIntegrationTests.java @@ -171,7 +171,7 @@ class WebMvcEndpointExposureIntegrationTests { .build(); } - private boolean isExposed(WebTestClient client, HttpMethod method, String path) throws Exception { + private boolean isExposed(WebTestClient client, HttpMethod method, String path) { path = "/actuator/" + path; EntityExchangeResult result = client.method(method).uri(path).exchange().expectBody().returnResult(); if (result.getStatus() == HttpStatus.OK) { diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/reactive/ReactiveManagementWebSecurityAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/reactive/ReactiveManagementWebSecurityAutoConfigurationTests.java index a739a60eed..3dfd03cc33 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/reactive/ReactiveManagementWebSecurityAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/reactive/ReactiveManagementWebSecurityAutoConfigurationTests.java @@ -159,7 +159,7 @@ class ReactiveManagementWebSecurityAutoConfigurationTests { static class CustomSecurityConfiguration { @Bean - SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) throws Exception { + SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) { http.authorizeExchange((exchanges) -> { exchanges.pathMatchers("/foo").permitAll(); exchanges.anyExchange().authenticated(); @@ -179,7 +179,7 @@ class ReactiveManagementWebSecurityAutoConfigurationTests { } @Bean - WebFilterChainProxy webFilterChainProxy(ServerHttpSecurity http) throws Exception { + WebFilterChainProxy webFilterChainProxy(ServerHttpSecurity http) { return new WebFilterChainProxy(getFilterChains(http)); } @@ -190,7 +190,7 @@ class ReactiveManagementWebSecurityAutoConfigurationTests { return httpSecurity; } - private List getFilterChains(ServerHttpSecurity http) throws Exception { + private List getFilterChains(ServerHttpSecurity http) { http.authorizeExchange((exchanges) -> exchanges.anyExchange().authenticated()); http.formLogin(Customizer.withDefaults()); return Collections.singletonList(http.build()); diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/jmx/EndpointMBeanTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/jmx/EndpointMBeanTests.java index fa32a928a7..21f7f7ce84 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/jmx/EndpointMBeanTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/jmx/EndpointMBeanTests.java @@ -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. @@ -22,7 +22,6 @@ import java.net.URLClassLoader; import javax.management.Attribute; import javax.management.AttributeList; import javax.management.AttributeNotFoundException; -import javax.management.InvalidAttributeValueException; import javax.management.MBeanException; import javax.management.MBeanInfo; import javax.management.ReflectionException; @@ -87,7 +86,7 @@ class EndpointMBeanTests { } @Test - void invokeWhenOperationFailedShouldTranslateException() throws MBeanException, ReflectionException { + void invokeWhenOperationFailedShouldTranslateException() { TestExposableJmxEndpoint endpoint = new TestExposableJmxEndpoint(new TestJmxOperation((arguments) -> { throw new FatalBeanException("test failure"); })); @@ -99,7 +98,7 @@ class EndpointMBeanTests { } @Test - void invokeWhenOperationFailedWithJdkExceptionShouldReuseException() throws MBeanException, ReflectionException { + void invokeWhenOperationFailedWithJdkExceptionShouldReuseException() { TestExposableJmxEndpoint endpoint = new TestExposableJmxEndpoint(new TestJmxOperation((arguments) -> { throw new UnsupportedOperationException("test failure"); })); @@ -110,7 +109,7 @@ class EndpointMBeanTests { } @Test - void invokeWhenActionNameIsNotAnOperationShouldThrowException() throws MBeanException, ReflectionException { + void invokeWhenActionNameIsNotAnOperationShouldThrowException() { EndpointMBean bean = createEndpointMBean(); assertThatExceptionOfType(ReflectionException.class) .isThrownBy(() -> bean.invoke("missingOperation", NO_PARAMS, NO_SIGNATURE)) @@ -131,7 +130,7 @@ class EndpointMBeanTests { } @Test - void invokeWhenOperationIsInvalidShouldThrowException() throws MBeanException, ReflectionException { + void invokeWhenOperationIsInvalidShouldThrowException() { TestJmxOperation operation = new TestJmxOperation() { @Override @@ -166,15 +165,14 @@ class EndpointMBeanTests { } @Test - void getAttributeShouldThrowException() throws AttributeNotFoundException, MBeanException, ReflectionException { + void getAttributeShouldThrowException() { EndpointMBean bean = createEndpointMBean(); assertThatExceptionOfType(AttributeNotFoundException.class).isThrownBy(() -> bean.getAttribute("test")) .withMessageContaining("EndpointMBeans do not support attributes"); } @Test - void setAttributeShouldThrowException() - throws AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException { + void setAttributeShouldThrowException() { EndpointMBean bean = createEndpointMBean(); assertThatExceptionOfType(AttributeNotFoundException.class) .isThrownBy(() -> bean.setAttribute(new Attribute("test", "test"))) diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/reactive/ControllerEndpointHandlerMappingTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/reactive/ControllerEndpointHandlerMappingTests.java index 23d0161b2a..635b58c15d 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/reactive/ControllerEndpointHandlerMappingTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/reactive/ControllerEndpointHandlerMappingTests.java @@ -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. @@ -51,7 +51,7 @@ class ControllerEndpointHandlerMappingTests { private final StaticApplicationContext context = new StaticApplicationContext(); @Test - void mappingWithNoPrefix() throws Exception { + void mappingWithNoPrefix() { ExposableControllerEndpoint first = firstEndpoint(); ExposableControllerEndpoint second = secondEndpoint(); ControllerEndpointHandlerMapping mapping = createMapping("", first, second); @@ -62,7 +62,7 @@ class ControllerEndpointHandlerMappingTests { } @Test - void mappingWithPrefix() throws Exception { + void mappingWithPrefix() { ExposableControllerEndpoint first = firstEndpoint(); ExposableControllerEndpoint second = secondEndpoint(); ControllerEndpointHandlerMapping mapping = createMapping("actuator", first, second); @@ -75,7 +75,7 @@ class ControllerEndpointHandlerMappingTests { } @Test - void mappingWithNoPath() throws Exception { + void mappingWithNoPath() { ExposableControllerEndpoint pathless = pathlessEndpoint(); ControllerEndpointHandlerMapping mapping = createMapping("actuator", pathless); assertThat(getHandler(mapping, HttpMethod.GET, "/actuator/pathless")) @@ -85,7 +85,7 @@ class ControllerEndpointHandlerMappingTests { } @Test - void mappingNarrowedToMethod() throws Exception { + void mappingNarrowedToMethod() { ExposableControllerEndpoint first = firstEndpoint(); ControllerEndpointHandlerMapping mapping = createMapping("actuator", first); assertThatExceptionOfType(MethodNotAllowedException.class) diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/servlet/ControllerEndpointHandlerMappingTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/servlet/ControllerEndpointHandlerMappingTests.java index f0fae4c17a..b9b1b09ec5 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/servlet/ControllerEndpointHandlerMappingTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/servlet/ControllerEndpointHandlerMappingTests.java @@ -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. @@ -73,7 +73,7 @@ class ControllerEndpointHandlerMappingTests { } @Test - void mappingNarrowedToMethod() throws Exception { + void mappingNarrowedToMethod() { ExposableControllerEndpoint first = firstEndpoint(); ControllerEndpointHandlerMapping mapping = createMapping("actuator", first); assertThatExceptionOfType(HttpRequestMethodNotSupportedException.class) diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/env/EnvironmentEndpointTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/env/EnvironmentEndpointTests.java index acc99906bc..8d3cfd17ce 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/env/EnvironmentEndpointTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/env/EnvironmentEndpointTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 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. @@ -227,7 +227,7 @@ class EnvironmentEndpointTests { } @Test - void propertyWithCharSequenceTypeIsConvertedToString() throws Exception { + void propertyWithCharSequenceTypeIsConvertedToString() { ConfigurableEnvironment environment = emptyEnvironment(); environment.getPropertySources().addFirst(singleKeyPropertySource("test", "foo", new CharSequenceProperty())); EnvironmentDescriptor descriptor = new EnvironmentEndpoint(environment).environment(null); diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/logging/LogFileWebEndpointWebIntegrationTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/logging/LogFileWebEndpointWebIntegrationTests.java index 702a759039..b7566eeace 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/logging/LogFileWebEndpointWebIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/logging/LogFileWebEndpointWebIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 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. @@ -50,7 +50,7 @@ class LogFileWebEndpointWebIntegrationTests { } @BeforeAll - static void setup(@TempDir File temp) throws IOException { + static void setup(@TempDir File temp) { tempFile = temp; } diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/management/HeapDumpWebEndpointWebIntegrationTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/management/HeapDumpWebEndpointWebIntegrationTests.java index baaf6e1a18..c6e58f8650 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/management/HeapDumpWebEndpointWebIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/management/HeapDumpWebEndpointWebIntegrationTests.java @@ -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. @@ -59,13 +59,13 @@ class HeapDumpWebEndpointWebIntegrationTests { } @WebEndpointTest - void getRequestShouldReturnHeapDumpInResponseBody(WebTestClient client) throws Exception { + void getRequestShouldReturnHeapDumpInResponseBody(WebTestClient client) { client.get().uri("/actuator/heapdump").exchange().expectStatus().isOk().expectHeader() .contentType(MediaType.APPLICATION_OCTET_STREAM).expectBody(String.class).isEqualTo("HEAPDUMP"); assertHeapDumpFileIsDeleted(); } - private void assertHeapDumpFileIsDeleted() throws InterruptedException { + private void assertHeapDumpFileIsDeleted() { Awaitility.waitAtMost(Duration.ofSeconds(5)).until(this.endpoint.file::exists, is(false)); } diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/management/ThreadDumpEndpointWebIntegrationTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/management/ThreadDumpEndpointWebIntegrationTests.java index 077aa0418c..3d4f361940 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/management/ThreadDumpEndpointWebIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/management/ThreadDumpEndpointWebIntegrationTests.java @@ -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. @@ -33,13 +33,13 @@ import static org.assertj.core.api.Assertions.assertThat; class ThreadDumpEndpointWebIntegrationTests { @WebEndpointTest - void getRequestWithJsonAcceptHeaderShouldProduceJsonThreadDumpResponse(WebTestClient client) throws Exception { + void getRequestWithJsonAcceptHeaderShouldProduceJsonThreadDumpResponse(WebTestClient client) { client.get().uri("/actuator/threaddump").accept(MediaType.APPLICATION_JSON).exchange().expectStatus().isOk() .expectHeader().contentType(MediaType.APPLICATION_JSON); } @WebEndpointTest - void getRequestWithTextPlainAcceptHeaderShouldProduceTextPlainResponse(WebTestClient client) throws Exception { + void getRequestWithTextPlainAcceptHeaderShouldProduceTextPlainResponse(WebTestClient client) { String response = client.get().uri("/actuator/threaddump").accept(MediaType.TEXT_PLAIN).exchange() .expectStatus().isOk().expectHeader().contentType("text/plain;charset=UTF-8").expectBody(String.class) .returnResult().getResponseBody(); diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcMetricsIntegrationTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcMetricsIntegrationTests.java index b604bd3080..e7d4d383b5 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcMetricsIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcMetricsIntegrationTests.java @@ -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. @@ -85,7 +85,7 @@ class WebMvcMetricsIntegrationTests { } @Test - void rethrownExceptionIsRecordedInMetricTag() throws Exception { + void rethrownExceptionIsRecordedInMetricTag() { assertThatExceptionOfType(NestedServletException.class) .isThrownBy(() -> this.mvc.perform(get("/api/rethrownError")).andReturn()); assertThat(this.registry.get("http.server.requests").tags("exception", "Exception2", "status", "500").timer() diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/trace/http/servlet/HttpTraceFilterTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/trace/http/servlet/HttpTraceFilterTests.java index 48fdcbc42c..bda27e8bd8 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/trace/http/servlet/HttpTraceFilterTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/trace/http/servlet/HttpTraceFilterTests.java @@ -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. @@ -99,7 +99,7 @@ class HttpTraceFilterTests { } @Test - void statusIsAssumedToBe500WhenChainFails() throws ServletException, IOException { + void statusIsAssumedToBe500WhenChainFails() { assertThatIOException().isThrownBy(() -> this.filter.doFilter(new MockHttpServletRequest(), new MockHttpServletResponse(), new MockFilterChain(new HttpServlet() { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/amqp/RabbitAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/amqp/RabbitAutoConfigurationTests.java index 32ea8ee0f6..597d79da68 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/amqp/RabbitAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/amqp/RabbitAutoConfigurationTests.java @@ -722,7 +722,7 @@ class RabbitAutoConfigurationTests { } @Test - void enableSslWithValidateServerCertificateFalse() throws Exception { + void enableSslWithValidateServerCertificateFalse() { this.contextRunner.withUserConfiguration(TestConfiguration.class) .withPropertyValues("spring.rabbitmq.ssl.enabled:true", "spring.rabbitmq.ssl.validateServerCertificate=false") @@ -734,7 +734,7 @@ class RabbitAutoConfigurationTests { } @Test - void enableSslWithValidateServerCertificateDefault() throws Exception { + void enableSslWithValidateServerCertificateDefault() { this.contextRunner.withUserConfiguration(TestConfiguration.class) .withPropertyValues("spring.rabbitmq.ssl.enabled:true").run((context) -> { com.rabbitmq.client.ConnectionFactory rabbitConnectionFactory = getTargetConnectionFactory(context); @@ -785,43 +785,42 @@ class RabbitAutoConfigurationTests { } @Test - void whenACredentialsProviderIsAvailableThenConnectionFactoryIsConfiguredToUseIt() throws Exception { + void whenACredentialsProviderIsAvailableThenConnectionFactoryIsConfiguredToUseIt() { this.contextRunner.withUserConfiguration(CredentialsProviderConfiguration.class) .run((context) -> assertThat(getTargetConnectionFactory(context).params(null).getCredentialsProvider()) .isEqualTo(CredentialsProviderConfiguration.credentialsProvider)); } @Test - void whenAPrimaryCredentialsProviderIsAvailableThenConnectionFactoryIsConfiguredToUseIt() throws Exception { + void whenAPrimaryCredentialsProviderIsAvailableThenConnectionFactoryIsConfiguredToUseIt() { this.contextRunner.withUserConfiguration(PrimaryCredentialsProviderConfiguration.class) .run((context) -> assertThat(getTargetConnectionFactory(context).params(null).getCredentialsProvider()) .isEqualTo(PrimaryCredentialsProviderConfiguration.credentialsProvider)); } @Test - void whenMultipleCredentialsProvidersAreAvailableThenConnectionFactoryUsesDefaultProvider() throws Exception { + void whenMultipleCredentialsProvidersAreAvailableThenConnectionFactoryUsesDefaultProvider() { this.contextRunner.withUserConfiguration(MultipleCredentialsProvidersConfiguration.class) .run((context) -> assertThat(getTargetConnectionFactory(context).params(null).getCredentialsProvider()) .isInstanceOf(DefaultCredentialsProvider.class)); } @Test - void whenACredentialsRefreshServiceIsAvailableThenConnectionFactoryIsConfiguredToUseIt() throws Exception { + void whenACredentialsRefreshServiceIsAvailableThenConnectionFactoryIsConfiguredToUseIt() { this.contextRunner.withUserConfiguration(CredentialsRefreshServiceConfiguration.class).run( (context) -> assertThat(getTargetConnectionFactory(context).params(null).getCredentialsRefreshService()) .isEqualTo(CredentialsRefreshServiceConfiguration.credentialsRefreshService)); } @Test - void whenAPrimaryCredentialsRefreshServiceIsAvailableThenConnectionFactoryIsConfiguredToUseIt() throws Exception { + void whenAPrimaryCredentialsRefreshServiceIsAvailableThenConnectionFactoryIsConfiguredToUseIt() { this.contextRunner.withUserConfiguration(PrimaryCredentialsRefreshServiceConfiguration.class).run( (context) -> assertThat(getTargetConnectionFactory(context).params(null).getCredentialsRefreshService()) .isEqualTo(PrimaryCredentialsRefreshServiceConfiguration.credentialsRefreshService)); } @Test - void whenMultipleCredentialsRefreshServiceAreAvailableThenConnectionFactoryHasNoCredentialsRefreshService() - throws Exception { + void whenMultipleCredentialsRefreshServiceAreAvailableThenConnectionFactoryHasNoCredentialsRefreshService() { this.contextRunner.withUserConfiguration(MultipleCredentialsRefreshServicesConfiguration.class).run( (context) -> assertThat(getTargetConnectionFactory(context).params(null).getCredentialsRefreshService()) .isNull()); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfigurationWithoutJdbcTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfigurationWithoutJdbcTests.java index 118b56f8f0..3974c7e909 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfigurationWithoutJdbcTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfigurationWithoutJdbcTests.java @@ -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. @@ -60,22 +60,22 @@ class BatchAutoConfigurationWithoutJdbcTests { static class BatchConfiguration implements BatchConfigurer { @Override - public JobRepository getJobRepository() throws Exception { + public JobRepository getJobRepository() { return mock(JobRepository.class); } @Override - public PlatformTransactionManager getTransactionManager() throws Exception { + public PlatformTransactionManager getTransactionManager() { return mock(PlatformTransactionManager.class); } @Override - public JobLauncher getJobLauncher() throws Exception { + public JobLauncher getJobLauncher() { return mock(JobLauncher.class); } @Override - public JobExplorer getJobExplorer() throws Exception { + public JobExplorer getJobExplorer() { return mock(JobExplorer.class); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/DataSourcePropertiesTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/DataSourcePropertiesTests.java index b82438dde9..74b9ad9ef4 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/DataSourcePropertiesTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/DataSourcePropertiesTests.java @@ -79,7 +79,7 @@ class DataSourcePropertiesTests { } @Test - void whenEmbeddedConnectionIsNoneAndNoUrlIsConfiguredThenDetermineUrlThrows() throws Exception { + void whenEmbeddedConnectionIsNoneAndNoUrlIsConfiguredThenDetermineUrlThrows() { DataSourceProperties properties = new DataSourceProperties(); properties.setGenerateUniqueName(false); properties.setEmbeddedDatabaseConnection(EmbeddedDatabaseConnection.NONE); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/JndiDataSourceAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/JndiDataSourceAutoConfigurationTests.java index 358b52ae4f..a959384603 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/JndiDataSourceAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/JndiDataSourceAutoConfigurationTests.java @@ -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. @@ -19,7 +19,6 @@ package org.springframework.boot.autoconfigure.jdbc; import java.util.Set; import javax.naming.Context; -import javax.naming.NamingException; import javax.sql.DataSource; import org.apache.commons.dbcp2.BasicDataSource; @@ -80,7 +79,7 @@ class JndiDataSourceAutoConfigurationTests { } @Test - void dataSourceIsAvailableFromJndi() throws IllegalStateException, NamingException { + void dataSourceIsAvailableFromJndi() { DataSource dataSource = new BasicDataSource(); configureJndi("foo", dataSource); @@ -94,7 +93,7 @@ class JndiDataSourceAutoConfigurationTests { @SuppressWarnings("unchecked") @Test - void mbeanDataSourceIsExcludedFromExport() throws IllegalStateException, NamingException { + void mbeanDataSourceIsExcludedFromExport() throws IllegalStateException { DataSource dataSource = new BasicDataSource(); configureJndi("foo", dataSource); @@ -111,7 +110,7 @@ class JndiDataSourceAutoConfigurationTests { @SuppressWarnings("unchecked") @Test - void mbeanDataSourceIsExcludedFromExportByAllExporters() throws IllegalStateException, NamingException { + void mbeanDataSourceIsExcludedFromExportByAllExporters() throws IllegalStateException { DataSource dataSource = new BasicDataSource(); configureJndi("foo", dataSource); this.context = new AnnotationConfigApplicationContext(); @@ -128,7 +127,7 @@ class JndiDataSourceAutoConfigurationTests { @SuppressWarnings("unchecked") @Test - void standardDataSourceIsNotExcludedFromExport() throws IllegalStateException, NamingException { + void standardDataSourceIsNotExcludedFromExport() throws IllegalStateException { DataSource dataSource = mock(DataSource.class); configureJndi("foo", dataSource); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jndi/TestableInitialContextFactory.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jndi/TestableInitialContextFactory.java index 806963a94a..1d8cbc69f9 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jndi/TestableInitialContextFactory.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jndi/TestableInitialContextFactory.java @@ -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. @@ -35,7 +35,7 @@ public class TestableInitialContextFactory implements InitialContextFactory { private static TestableContext context; @Override - public Context getInitialContext(Hashtable environment) throws NamingException { + public Context getInitialContext(Hashtable environment) { return getContext(); } @@ -78,7 +78,7 @@ public class TestableInitialContextFactory implements InitialContextFactory { } @Override - public Object lookup(String name) throws NamingException { + public Object lookup(String name) { return this.bindings.get(name); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mongo/embedded/EmbeddedMongoAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mongo/embedded/EmbeddedMongoAutoConfigurationTests.java index 7d53244044..f6108abadb 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mongo/embedded/EmbeddedMongoAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mongo/embedded/EmbeddedMongoAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 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. @@ -17,7 +17,6 @@ package org.springframework.boot.autoconfigure.mongo.embedded; import java.io.File; -import java.io.IOException; import java.nio.file.Path; import java.util.EnumSet; import java.util.Map; @@ -150,7 +149,7 @@ class EmbeddedMongoAutoConfigurationTests { } @Test - void mongoWritesToCustomDatabaseDir(@TempDir Path temp) throws IOException { + void mongoWritesToCustomDatabaseDir(@TempDir Path temp) { File customDatabaseDir = new File(temp.toFile(), "custom-database-dir"); FileSystemUtils.deleteRecursively(customDatabaseDir); load("spring.mongodb.embedded.storage.databaseDir=" + customDatabaseDir.getPath()); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/rsocket/RSocketWebSocketNettyRouteProviderTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/rsocket/RSocketWebSocketNettyRouteProviderTests.java index d81d5c3bd1..839f9c14c1 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/rsocket/RSocketWebSocketNettyRouteProviderTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/rsocket/RSocketWebSocketNettyRouteProviderTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 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 @@ import static org.assertj.core.api.Assertions.assertThat; class RSocketWebSocketNettyRouteProviderTests { @Test - void webEndpointsShouldWork() throws Exception { + void webEndpointsShouldWork() { new ReactiveWebApplicationContextRunner(AnnotationConfigReactiveWebServerApplicationContext::new) .withConfiguration( AutoConfigurations.of(HttpHandlerAutoConfiguration.class, WebFluxAutoConfiguration.class, diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/resource/reactive/ReactiveOAuth2ResourceServerAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/resource/reactive/ReactiveOAuth2ResourceServerAutoConfigurationTests.java index 8339e4d35a..4fc7b29b82 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/resource/reactive/ReactiveOAuth2ResourceServerAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/resource/reactive/ReactiveOAuth2ResourceServerAutoConfigurationTests.java @@ -469,7 +469,7 @@ class ReactiveOAuth2ResourceServerAutoConfigurationTests { static class SecurityWebFilterChainConfig { @Bean - SecurityWebFilterChain testSpringSecurityFilterChain(ServerHttpSecurity http) throws Exception { + SecurityWebFilterChain testSpringSecurityFilterChain(ServerHttpSecurity http) { http.authorizeExchange((exchanges) -> { exchanges.pathMatchers("/message/**").hasRole("ADMIN"); exchanges.anyExchange().authenticated(); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/transaction/jta/JtaAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/transaction/jta/JtaAutoConfigurationTests.java index f8b411b0af..8ba9a58c66 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/transaction/jta/JtaAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/transaction/jta/JtaAutoConfigurationTests.java @@ -17,7 +17,6 @@ package org.springframework.boot.autoconfigure.transaction.jta; import java.io.File; -import java.io.IOException; import java.nio.file.Path; import javax.jms.ConnectionFactory; @@ -115,7 +114,7 @@ class JtaAutoConfigurationTests { } @Test - void defaultAtomikosTransactionManagerName(@TempDir Path dir) throws IOException { + void defaultAtomikosTransactionManagerName(@TempDir Path dir) { this.context = new AnnotationConfigApplicationContext(); File logs = new File(dir.toFile(), "jta"); TestPropertyValues.of("spring.jta.logDir:" + logs.getAbsolutePath()).applyTo(this.context); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/ServerPropertiesTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/ServerPropertiesTests.java index 8825f6b93e..7f1ffd735a 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/ServerPropertiesTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/ServerPropertiesTests.java @@ -433,7 +433,7 @@ class ServerPropertiesTests { } @Test - void jettyMaxHttpFormPostSizeMatchesDefault() throws Exception { + void jettyMaxHttpFormPostSizeMatchesDefault() { JettyServletWebServerFactory jettyFactory = new JettyServletWebServerFactory(0); JettyWebServer jetty = (JettyWebServer) jettyFactory .getWebServer((ServletContextInitializer) (servletContext) -> servletContext @@ -527,7 +527,7 @@ class ServerPropertiesTests { .isEqualTo(HttpDecoderSpec.DEFAULT_INITIAL_BUFFER_SIZE); } - private Connector getDefaultConnector() throws Exception { + private Connector getDefaultConnector() { return new Connector(TomcatServletWebServerFactory.DEFAULT_PROTOCOL); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/ServletWebServerFactoryCustomizerTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/ServletWebServerFactoryCustomizerTests.java index fe871eabc9..f48db359c6 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/ServletWebServerFactoryCustomizerTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/ServletWebServerFactoryCustomizerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 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. @@ -98,7 +98,7 @@ class ServletWebServerFactoryCustomizerTests { } @Test - void customizeSessionProperties() throws Exception { + void customizeSessionProperties() { Map map = new HashMap<>(); map.put("server.servlet.session.timeout", "123"); map.put("server.servlet.session.tracking-modes", "cookie,url"); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/error/BasicErrorControllerDirectMockMvcTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/error/BasicErrorControllerDirectMockMvcTests.java index 93ee6aa58a..d2153b0775 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/error/BasicErrorControllerDirectMockMvcTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/error/BasicErrorControllerDirectMockMvcTests.java @@ -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. @@ -98,7 +98,7 @@ class BasicErrorControllerDirectMockMvcTests { } @Test - void errorPageNotAvailableWithWhitelabelDisabled() throws Exception { + void errorPageNotAvailableWithWhitelabelDisabled() { setup((ConfigurableWebApplicationContext) new SpringApplication(WebMvcIncludedConfiguration.class) .run("--server.port=0", "--server.error.whitelabel.enabled=false")); assertThatExceptionOfType(ServletException.class) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/error/BasicErrorControllerMockMvcTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/error/BasicErrorControllerMockMvcTests.java index 07c6bcf9a4..ececfe5e90 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/error/BasicErrorControllerMockMvcTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/error/BasicErrorControllerMockMvcTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 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. @@ -180,7 +180,7 @@ class BasicErrorControllerMockMvcTests { } @RequestMapping("/noContent") - void noContent() throws Exception { + void noContent() { throw new NoContentException("Expected!"); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/error/ErrorMvcAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/error/ErrorMvcAutoConfigurationTests.java index 9b5f24881b..455ed87b38 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/error/ErrorMvcAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/error/ErrorMvcAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 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. @@ -69,7 +69,7 @@ class ErrorMvcAutoConfigurationTests { } @Test - void renderCanUseJavaTimeTypeAsTimestamp() throws Exception { // gh-23256 + void renderCanUseJavaTimeTypeAsTimestamp() { // gh-23256 this.contextRunner.run((context) -> { View errorView = context.getBean("error", View.class); ErrorAttributes errorAttributes = context.getBean(ErrorAttributes.class); diff --git a/spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/ReproIntegrationTests.java b/spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/ReproIntegrationTests.java index d96970f9ea..36b10c7e64 100644 --- a/spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/ReproIntegrationTests.java +++ b/spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/ReproIntegrationTests.java @@ -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. @@ -64,7 +64,7 @@ class ReproIntegrationTests { } @Test - void jarFileExtensionNeeded() throws Exception { + void jarFileExtensionNeeded() { assertThatExceptionOfType(ExecutionException.class) .isThrownBy(() -> this.cli.jar("secure.groovy", "data-jpa.groovy")) .withMessageContaining("is not a JAR file"); diff --git a/spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/command/CommandRunnerTests.java b/spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/command/CommandRunnerTests.java index 2ebd1023e0..88ba197774 100644 --- a/spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/command/CommandRunnerTests.java +++ b/spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/command/CommandRunnerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 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. @@ -94,7 +94,7 @@ class CommandRunnerTests { } @Test - void runWithoutArguments() throws Exception { + void runWithoutArguments() { assertThatExceptionOfType(NoArgumentsException.class).isThrownBy(this.commandRunner::run); } @@ -105,7 +105,7 @@ class CommandRunnerTests { } @Test - void missingCommand() throws Exception { + void missingCommand() { assertThatExceptionOfType(NoSuchCommandException.class).isThrownBy(() -> this.commandRunner.run("missing")); } @@ -170,13 +170,13 @@ class CommandRunnerTests { } @Test - void helpNoCommand() throws Exception { + void helpNoCommand() { assertThatExceptionOfType(NoHelpCommandArgumentsException.class) .isThrownBy(() -> this.commandRunner.run("help")); } @Test - void helpUnknownCommand() throws Exception { + void helpUnknownCommand() { assertThatExceptionOfType(NoSuchCommandException.class) .isThrownBy(() -> this.commandRunner.run("help", "missing")); } diff --git a/spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/command/init/ProjectGenerationRequestTests.java b/spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/command/init/ProjectGenerationRequestTests.java index 97096ad45f..55d5bcb554 100644 --- a/spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/command/init/ProjectGenerationRequestTests.java +++ b/spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/command/init/ProjectGenerationRequestTests.java @@ -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. @@ -199,7 +199,7 @@ class ProjectGenerationRequestTests { } @Test - void noTypeAndNoDefault() throws Exception { + void noTypeAndNoDefault() { assertThatExceptionOfType(ReportableException.class) .isThrownBy(() -> this.request.generateUrl(readMetadata("types-conflict"))) .withMessageContaining("no default is defined"); diff --git a/spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/command/run/SpringApplicationRunnerTests.java b/spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/command/run/SpringApplicationRunnerTests.java index c00b3d86bd..a0679245e7 100644 --- a/spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/command/run/SpringApplicationRunnerTests.java +++ b/spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/command/run/SpringApplicationRunnerTests.java @@ -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. @@ -32,7 +32,7 @@ import static org.mockito.Mockito.mock; class SpringApplicationRunnerTests { @Test - void exceptionMessageWhenSourcesContainsNoClasses() throws Exception { + void exceptionMessageWhenSourcesContainsNoClasses() { SpringApplicationRunnerConfiguration configuration = mock(SpringApplicationRunnerConfiguration.class); given(configuration.getClasspath()).willReturn(new String[] { "foo", "bar" }); given(configuration.getLogLevel()).willReturn(Level.INFO); diff --git a/spring-boot-project/spring-boot-devtools/src/intTest/java/org/springframework/boot/devtools/tests/DevToolsWithLazyInitializationIntegrationTests.java b/spring-boot-project/spring-boot-devtools/src/intTest/java/org/springframework/boot/devtools/tests/DevToolsWithLazyInitializationIntegrationTests.java index b9f6ff73f8..135bcdbfb0 100644 --- a/spring-boot-project/spring-boot-devtools/src/intTest/java/org/springframework/boot/devtools/tests/DevToolsWithLazyInitializationIntegrationTests.java +++ b/spring-boot-project/spring-boot-devtools/src/intTest/java/org/springframework/boot/devtools/tests/DevToolsWithLazyInitializationIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 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. @@ -16,8 +16,6 @@ package org.springframework.boot.devtools.tests; -import java.io.IOException; - import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -49,7 +47,7 @@ class DevToolsWithLazyInitializationIntegrationTests extends AbstractDevToolsInt assertThat(template.getForObject(urlBase + "/two", String.class)).isEqualTo("two"); } - static Object[] parameters() throws IOException { + static Object[] parameters() { Directories directories = new Directories(buildOutput, temp); return new Object[] { new Object[] { new LocalApplicationLauncher(directories) }, new Object[] { new ExplodedRemoteApplicationLauncher(directories) }, diff --git a/spring-boot-project/spring-boot-devtools/src/intTest/java/org/springframework/boot/devtools/tests/RemoteApplicationLauncher.java b/spring-boot-project/spring-boot-devtools/src/intTest/java/org/springframework/boot/devtools/tests/RemoteApplicationLauncher.java index 8fbd4168ff..0fcf1d4787 100644 --- a/spring-boot-project/spring-boot-devtools/src/intTest/java/org/springframework/boot/devtools/tests/RemoteApplicationLauncher.java +++ b/spring-boot-project/spring-boot-devtools/src/intTest/java/org/springframework/boot/devtools/tests/RemoteApplicationLauncher.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 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. @@ -100,13 +100,13 @@ abstract class RemoteApplicationLauncher extends AbstractApplicationLauncher { return StringUtils.collectionToDelimitedString(entries, File.pathSeparator); } - private int awaitServerPort(LaunchedJvm jvm, File serverPortFile) throws Exception { + private int awaitServerPort(LaunchedJvm jvm, File serverPortFile) { return Awaitility.waitAtMost(Duration.ofMinutes(3)) .until(() -> new ApplicationState(serverPortFile, jvm), ApplicationState::hasServerPort) .getServerPort(); } - private void awaitRemoteSpringApplication(LaunchedJvm launchedJvm) throws Exception { + private void awaitRemoteSpringApplication(LaunchedJvm launchedJvm) { FileContents contents = new FileContents(launchedJvm.getStandardOut()); try { Awaitility.waitAtMost(Duration.ofMinutes(3)).until(contents::get, diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/DevToolsPooledDataSourceAutoConfigurationTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/DevToolsPooledDataSourceAutoConfigurationTests.java index 056eae12df..74f0b29e2e 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/DevToolsPooledDataSourceAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/DevToolsPooledDataSourceAutoConfigurationTests.java @@ -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. @@ -17,7 +17,6 @@ package org.springframework.boot.devtools.autoconfigure; import java.io.File; -import java.io.IOException; import java.sql.SQLException; import java.sql.Statement; import java.time.Duration; @@ -52,7 +51,7 @@ import static org.mockito.Mockito.verify; class DevToolsPooledDataSourceAutoConfigurationTests extends AbstractDevToolsDataSourceAutoConfigurationTests { @BeforeEach - void before(@TempDir File tempDir) throws IOException { + void before(@TempDir File tempDir) { System.setProperty("derby.stream.error.file", new File(tempDir, "derby.log").getAbsolutePath()); } diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/filewatch/ChangedFileTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/filewatch/ChangedFileTests.java index f441d24075..bb5c3a344e 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/filewatch/ChangedFileTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/filewatch/ChangedFileTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 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. @@ -37,42 +37,42 @@ class ChangedFileTests { File tempDir; @Test - void sourceDirectoryMustNotBeNull() throws Exception { + void sourceDirectoryMustNotBeNull() { assertThatIllegalArgumentException() .isThrownBy(() -> new ChangedFile(null, new File(this.tempDir, "file"), Type.ADD)) .withMessageContaining("SourceDirectory must not be null"); } @Test - void fileMustNotBeNull() throws Exception { + void fileMustNotBeNull() { assertThatIllegalArgumentException() .isThrownBy(() -> new ChangedFile(new File(this.tempDir, "directory"), null, Type.ADD)) .withMessageContaining("File must not be null"); } @Test - void typeMustNotBeNull() throws Exception { + void typeMustNotBeNull() { assertThatIllegalArgumentException().isThrownBy( () -> new ChangedFile(new File(this.tempDir, "file"), new File(this.tempDir, "directory"), null)) .withMessageContaining("Type must not be null"); } @Test - void getFile() throws Exception { + void getFile() { File file = new File(this.tempDir, "file"); ChangedFile changedFile = new ChangedFile(new File(this.tempDir, "directory"), file, Type.ADD); assertThat(changedFile.getFile()).isEqualTo(file); } @Test - void getType() throws Exception { + void getType() { ChangedFile changedFile = new ChangedFile(new File(this.tempDir, "directory"), new File(this.tempDir, "file"), Type.DELETE); assertThat(changedFile.getType()).isEqualTo(Type.DELETE); } @Test - void getRelativeName() throws Exception { + void getRelativeName() { File subDirectory = new File(this.tempDir, "A"); File file = new File(subDirectory, "B.txt"); ChangedFile changedFile = new ChangedFile(this.tempDir, file, Type.ADD); diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/filewatch/DirectorySnapshotTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/filewatch/DirectorySnapshotTests.java index 6dd76ffadf..517bc60314 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/filewatch/DirectorySnapshotTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/filewatch/DirectorySnapshotTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 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. @@ -65,7 +65,7 @@ class DirectorySnapshotTests { } @Test - void directoryDoesNotHaveToExist() throws Exception { + void directoryDoesNotHaveToExist() { File file = new File(this.tempDir, "does/not/exist"); DirectorySnapshot snapshot = new DirectorySnapshot(file); assertThat(snapshot).isEqualTo(new DirectorySnapshot(file)); @@ -107,7 +107,7 @@ class DirectorySnapshotTests { } @Test - void getChangedFilesSnapshotMustBeTheSameSourceDirectory() throws Exception { + void getChangedFilesSnapshotMustBeTheSameSourceDirectory() { assertThatIllegalArgumentException().isThrownBy( () -> this.initialSnapshot.getChangedFiles(new DirectorySnapshot(createTestDirectoryStructure()), null)) .withMessageContaining("Snapshot source directory must be '" + this.directory + "'"); diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/filewatch/FileSnapshotTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/filewatch/FileSnapshotTests.java index c7fa0241eb..267222aa6b 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/filewatch/FileSnapshotTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/filewatch/FileSnapshotTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 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. @@ -51,7 +51,7 @@ class FileSnapshotTests { } @Test - void fileMustNotBeADirectory() throws Exception { + void fileMustNotBeADirectory() { File file = new File(this.tempDir, "file"); file.mkdir(); assertThatIllegalArgumentException().isThrownBy(() -> new FileSnapshot(file)) diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/filewatch/FileSystemWatcherTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/filewatch/FileSystemWatcherTests.java index bdd34c9538..52c56ab951 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/filewatch/FileSystemWatcherTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/filewatch/FileSystemWatcherTests.java @@ -110,7 +110,7 @@ class FileSystemWatcherTests { } @Test - void cannotAddSourceDirectoryToStartedListener() throws Exception { + void cannotAddSourceDirectoryToStartedListener() { this.watcher.start(); assertThatIllegalStateException().isThrownBy(() -> this.watcher.addSourceDirectory(this.tempDir)) .withMessageContaining("FileSystemWatcher already started"); @@ -300,7 +300,7 @@ class FileSystemWatcherTests { this.watcher.addListener((changeSet) -> FileSystemWatcherTests.this.changes.add(changeSet)); } - private File startWithNewDirectory() throws IOException { + private File startWithNewDirectory() { File directory = new File(this.tempDir, UUID.randomUUID().toString()); directory.mkdir(); this.watcher.addSourceDirectory(directory); diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/livereload/ConnectionInputStreamTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/livereload/ConnectionInputStreamTests.java index d93077831b..37b7c8278b 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/livereload/ConnectionInputStreamTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/livereload/ConnectionInputStreamTests.java @@ -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. @@ -58,13 +58,13 @@ class ConnectionInputStreamTests { } @Test - void checkedRead() throws Exception { + void checkedRead() { ConnectionInputStream inputStream = new ConnectionInputStream(new ByteArrayInputStream(NO_BYTES)); assertThatIOException().isThrownBy(inputStream::checkedRead).withMessageContaining("End of stream"); } @Test - void checkedReadArray() throws Exception { + void checkedReadArray() { byte[] buffer = new byte[100]; ConnectionInputStream inputStream = new ConnectionInputStream(new ByteArrayInputStream(NO_BYTES)); assertThatIOException().isThrownBy(() -> inputStream.checkedRead(buffer, 0, buffer.length)) diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/livereload/FrameTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/livereload/FrameTests.java index ad54ab398c..3a4d49ae55 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/livereload/FrameTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/livereload/FrameTests.java @@ -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. @@ -85,14 +85,14 @@ class FrameTests { } @Test - void readFragmentedNotSupported() throws Exception { + void readFragmentedNotSupported() { byte[] bytes = new byte[] { 0x0F }; assertThatIllegalStateException().isThrownBy(() -> Frame.read(newConnectionInputStream(bytes))) .withMessageContaining("Fragmented frames are not supported"); } @Test - void readLargeFramesNotSupported() throws Exception { + void readLargeFramesNotSupported() { byte[] bytes = new byte[] { (byte) 0x80, (byte) 0xFF }; assertThatIllegalStateException().isThrownBy(() -> Frame.read(newConnectionInputStream(bytes))) .withMessageContaining("Large frames are not supported"); diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/livereload/LiveReloadServerTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/livereload/LiveReloadServerTests.java index 8b15e1e152..ea9787af93 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/livereload/LiveReloadServerTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/livereload/LiveReloadServerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 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. @@ -112,7 +112,7 @@ class LiveReloadServerTests { assertThat(this.server.getClosedExceptions().size()).isGreaterThan(0); } - private void awaitClosedException() throws InterruptedException { + private void awaitClosedException() { Awaitility.waitAtMost(Duration.ofSeconds(10)).until(this.server::getClosedExceptions, is(not(empty()))); } diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/client/DelayedLiveReloadTriggerTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/client/DelayedLiveReloadTriggerTests.java index 4d38810da6..45e986ba59 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/client/DelayedLiveReloadTriggerTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/client/DelayedLiveReloadTriggerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 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. @@ -69,7 +69,7 @@ class DelayedLiveReloadTriggerTests { private DelayedLiveReloadTrigger trigger; @BeforeEach - void setup() throws IOException { + void setup() { this.trigger = new DelayedLiveReloadTrigger(this.liveReloadServer, this.requestFactory, URL); } diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/client/HttpHeaderInterceptorTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/client/HttpHeaderInterceptorTests.java index 942acb901f..86e4ce66cf 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/client/HttpHeaderInterceptorTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/client/HttpHeaderInterceptorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 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. @@ -62,7 +62,7 @@ class HttpHeaderInterceptorTests { private MockHttpServletRequest httpRequest; @BeforeEach - void setup() throws Exception { + void setup() { this.body = new byte[] {}; this.httpRequest = new MockHttpServletRequest(); this.request = new ServletServerHttpRequest(this.httpRequest); diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/MainMethodTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/MainMethodTests.java index 3d06a537ff..bb0761fbe4 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/MainMethodTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/MainMethodTests.java @@ -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. @@ -57,13 +57,13 @@ class MainMethodTests { } @Test - void missingArgsMainMethod() throws Exception { + void missingArgsMainMethod() { assertThatIllegalStateException().isThrownBy(() -> new TestThread(MissingArgs::main).test()) .withMessageContaining("Unable to find main method"); } @Test - void nonStatic() throws Exception { + void nonStatic() { assertThatIllegalStateException().isThrownBy(() -> new TestThread(() -> new NonStaticMain().main()).test()) .withMessageContaining("Unable to find main method"); } diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/classloader/RestartClassLoaderTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/classloader/RestartClassLoaderTests.java index 33cbd45cbd..261b8b452f 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/classloader/RestartClassLoaderTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/classloader/RestartClassLoaderTests.java @@ -185,7 +185,7 @@ class RestartClassLoaderTests { } @Test - void getDeletedClass() throws Exception { + void getDeletedClass() { String name = PACKAGE_PATH + "/Sample.class"; this.updatedFiles.addFile(name, new ClassLoaderFile(Kind.DELETED, null)); assertThatExceptionOfType(ClassNotFoundException.class) @@ -193,7 +193,7 @@ class RestartClassLoaderTests { } @Test - void getUpdatedClass() throws Exception { + void getUpdatedClass() { String name = PACKAGE_PATH + "/Sample.class"; this.updatedFiles.addFile(name, new ClassLoaderFile(Kind.MODIFIED, new byte[10])); assertThatExceptionOfType(ClassFormatError.class) diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/tunnel/payload/HttpTunnelPayloadForwarderTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/tunnel/payload/HttpTunnelPayloadForwarderTests.java index 7217e0f898..4d0499c8af 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/tunnel/payload/HttpTunnelPayloadForwarderTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/tunnel/payload/HttpTunnelPayloadForwarderTests.java @@ -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. @@ -63,7 +63,7 @@ class HttpTunnelPayloadForwarderTests { } @Test - void overflow() throws Exception { + void overflow() { WritableByteChannel channel = Channels.newChannel(new ByteArrayOutputStream()); HttpTunnelPayloadForwarder forwarder = new HttpTunnelPayloadForwarder(channel); assertThatIllegalStateException().isThrownBy(() -> { diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/tunnel/payload/HttpTunnelPayloadTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/tunnel/payload/HttpTunnelPayloadTests.java index 3ffb025e3f..b53974b267 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/tunnel/payload/HttpTunnelPayloadTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/tunnel/payload/HttpTunnelPayloadTests.java @@ -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. @@ -93,7 +93,7 @@ class HttpTunnelPayloadTests { } @Test - void getWithMissingHeader() throws Exception { + void getWithMissingHeader() { MockHttpServletRequest servletRequest = new MockHttpServletRequest(); servletRequest.setContent("hello".getBytes()); HttpInputMessage request = new ServletServerHttpRequest(servletRequest); diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/tunnel/server/HttpTunnelServerTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/tunnel/server/HttpTunnelServerTests.java index a299cc3eea..9d9bd7fad2 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/tunnel/server/HttpTunnelServerTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/tunnel/server/HttpTunnelServerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 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. @@ -83,7 +83,7 @@ class HttpTunnelServerTests { private MockServerChannel serverChannel; @BeforeEach - void setup() throws Exception { + void setup() { this.server = new HttpTunnelServer(this.serverConnection); this.servletRequest = new MockHttpServletRequest(); this.servletRequest.setAsyncSupported(true); diff --git a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/actuator/maphealthindicatorstometrics/MetricsHealthMicrometerExportTests.java b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/actuator/maphealthindicatorstometrics/MetricsHealthMicrometerExportTests.java index df93867f10..3671f7eb37 100644 --- a/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/actuator/maphealthindicatorstometrics/MetricsHealthMicrometerExportTests.java +++ b/spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/actuator/maphealthindicatorstometrics/MetricsHealthMicrometerExportTests.java @@ -47,7 +47,7 @@ class MetricsHealthMicrometerExportTests { private MeterRegistry registry; @Test - void registryExportsHealth() throws Exception { + void registryExportsHealth() { Gauge gauge = this.registry.get("health").gauge(); assertThat(gauge.value()).isEqualTo(2); } diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/restdocs/WebTestClientRestDocsAutoConfigurationAdvancedConfigurationIntegrationTests.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/restdocs/WebTestClientRestDocsAutoConfigurationAdvancedConfigurationIntegrationTests.java index eb87023131..0eb8748481 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/restdocs/WebTestClientRestDocsAutoConfigurationAdvancedConfigurationIntegrationTests.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/restdocs/WebTestClientRestDocsAutoConfigurationAdvancedConfigurationIntegrationTests.java @@ -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"); diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/restdocs/WebTestClientRestDocsAutoConfigurationIntegrationTests.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/restdocs/WebTestClientRestDocsAutoConfigurationIntegrationTests.java index 979455ffbe..c02e04d8e3 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/restdocs/WebTestClientRestDocsAutoConfigurationIntegrationTests.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/restdocs/WebTestClientRestDocsAutoConfigurationIntegrationTests.java @@ -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"); diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/reactive/webclient/WebTestClientSpringBootTestIntegrationTests.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/reactive/webclient/WebTestClientSpringBootTestIntegrationTests.java index 64a9009a1d..c265afba11 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/reactive/webclient/WebTestClientSpringBootTestIntegrationTests.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/reactive/webclient/WebTestClientSpringBootTestIntegrationTests.java @@ -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(); } diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/WebMvcTestAllControllersIntegrationTests.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/WebMvcTestAllControllersIntegrationTests.java index e1cd442ef8..c5065ddd99 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/WebMvcTestAllControllersIntegrationTests.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/WebMvcTestAllControllersIntegrationTests.java @@ -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); diff --git a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/json/JsonContentAssertTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/json/JsonContentAssertTests.java index ed5765661f..5d729cde6e 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/json/JsonContentAssertTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/json/JsonContentAssertTests.java @@ -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. @@ -116,7 +116,7 @@ class JsonContentAssertTests { } @Test - void isEqualToWhenFileIsNotMatchingShouldFail() throws Exception { + void isEqualToWhenFileIsNotMatchingShouldFail() { assertThatExceptionOfType(AssertionError.class) .isThrownBy(() -> assertThat(forJson(SOURCE)).isEqualTo(createFile(DIFFERENT))); } @@ -199,7 +199,7 @@ class JsonContentAssertTests { } @Test - void isEqualToJsonWhenFileIsNotMatchingShouldFail() throws Exception { + void isEqualToJsonWhenFileIsNotMatchingShouldFail() { assertThatExceptionOfType(AssertionError.class) .isThrownBy(() -> assertThat(forJson(SOURCE)).isEqualToJson(createFile(DIFFERENT))); } @@ -276,7 +276,7 @@ class JsonContentAssertTests { } @Test - void isStrictlyEqualToJsonWhenFileIsNotMatchingShouldFail() throws Exception { + void isStrictlyEqualToJsonWhenFileIsNotMatchingShouldFail() { assertThatExceptionOfType(AssertionError.class) .isThrownBy(() -> assertThat(forJson(SOURCE)).isStrictlyEqualToJson(createFile(LENIENT_SAME))); } @@ -430,7 +430,7 @@ class JsonContentAssertTests { } @Test - void isEqualToJsonWhenFileIsNotMatchingAndComparatorShouldFail() throws Exception { + void isEqualToJsonWhenFileIsNotMatchingAndComparatorShouldFail() { assertThatExceptionOfType(AssertionError.class) .isThrownBy(() -> assertThat(forJson(SOURCE)).isEqualToJson(createFile(DIFFERENT), COMPARATOR)); } @@ -496,7 +496,7 @@ class JsonContentAssertTests { } @Test - void isNotEqualToWhenFileIsMatchingShouldFail() throws Exception { + void isNotEqualToWhenFileIsMatchingShouldFail() { assertThatExceptionOfType(AssertionError.class) .isThrownBy(() -> assertThat(forJson(SOURCE)).isNotEqualTo(createFile(LENIENT_SAME))); } @@ -578,7 +578,7 @@ class JsonContentAssertTests { } @Test - void isNotEqualToJsonWhenFileIsMatchingShouldFail() throws Exception { + void isNotEqualToJsonWhenFileIsMatchingShouldFail() { assertThatExceptionOfType(AssertionError.class) .isThrownBy(() -> assertThat(forJson(SOURCE)).isNotEqualToJson(createFile(LENIENT_SAME))); } @@ -655,7 +655,7 @@ class JsonContentAssertTests { } @Test - void isNotStrictlyEqualToJsonWhenFileIsMatchingShouldFail() throws Exception { + void isNotStrictlyEqualToJsonWhenFileIsMatchingShouldFail() { assertThatExceptionOfType(AssertionError.class) .isThrownBy(() -> assertThat(forJson(SOURCE)).isNotStrictlyEqualToJson(createFile(SOURCE))); } @@ -732,7 +732,7 @@ class JsonContentAssertTests { } @Test - void isNotEqualToJsonWhenFileIsMatchingAndLenientShouldFail() throws Exception { + void isNotEqualToJsonWhenFileIsMatchingAndLenientShouldFail() { assertThatExceptionOfType(AssertionError.class).isThrownBy( () -> assertThat(forJson(SOURCE)).isNotEqualToJson(createFile(LENIENT_SAME), JSONCompareMode.LENIENT)); } @@ -809,7 +809,7 @@ class JsonContentAssertTests { } @Test - void isNotEqualToJsonWhenFileIsMatchingAndComparatorShouldFail() throws Exception { + void isNotEqualToJsonWhenFileIsMatchingAndComparatorShouldFail() { assertThatExceptionOfType(AssertionError.class) .isThrownBy(() -> assertThat(forJson(SOURCE)).isNotEqualToJson(createFile(LENIENT_SAME), COMPARATOR)); } diff --git a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/client/TestRestTemplateTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/client/TestRestTemplateTests.java index fe94595254..055250ae88 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/client/TestRestTemplateTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/client/TestRestTemplateTests.java @@ -125,7 +125,7 @@ class TestRestTemplateTests { } @Test - void authenticated() throws Exception { + void authenticated() { TestRestTemplate restTemplate = new TestRestTemplate("user", "password"); assertBasicAuthorizationCredentials(restTemplate, "user", "password"); } @@ -200,7 +200,7 @@ class TestRestTemplateTests { } @Test - void withBasicAuthAddsBasicAuthWhenNotAlreadyPresent() throws Exception { + void withBasicAuthAddsBasicAuthWhenNotAlreadyPresent() { TestRestTemplate original = new TestRestTemplate(); TestRestTemplate basicAuth = original.withBasicAuth("user", "password"); assertThat(getConverterClasses(original)).containsExactlyElementsOf(getConverterClasses(basicAuth)); @@ -210,7 +210,7 @@ class TestRestTemplateTests { } @Test - void withBasicAuthReplacesBasicAuthWhenAlreadyPresent() throws Exception { + void withBasicAuthReplacesBasicAuthWhenAlreadyPresent() { TestRestTemplate original = new TestRestTemplate("foo", "bar").withBasicAuth("replace", "replace"); TestRestTemplate basicAuth = original.withBasicAuth("user", "password"); assertThat(getConverterClasses(basicAuth)).containsExactlyElementsOf(getConverterClasses(original)); @@ -366,7 +366,7 @@ class TestRestTemplateTests { } private void assertBasicAuthorizationCredentials(TestRestTemplate testRestTemplate, String username, - String password) throws Exception { + String password) { ClientHttpRequest request = ReflectionTestUtils.invokeMethod(testRestTemplate.getRestTemplate(), "createRequest", URI.create("http://localhost"), HttpMethod.POST); if (username == null) { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/BuildpackResolversTests.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/BuildpackResolversTests.java index 760a99030e..4356f56387 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/BuildpackResolversTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/BuildpackResolversTests.java @@ -53,7 +53,7 @@ class BuildpackResolversTests extends AbstractJsonTests { } @Test - void resolveAllWithBuilderBuildpackReferenceReturnsExpectedBuildpack() throws IOException { + void resolveAllWithBuilderBuildpackReferenceReturnsExpectedBuildpack() { BuildpackReference reference = BuildpackReference.of("urn:cnb:builder:paketo-buildpacks/spring-boot@3.5.0"); Buildpacks buildpacks = BuildpackResolvers.resolveAll(this.resolverContext, Collections.singleton(reference)); assertThat(buildpacks.getBuildpacks()).hasSize(1); @@ -92,7 +92,7 @@ class BuildpackResolversTests extends AbstractJsonTests { } @Test - void resolveAllWithInvalidLocatorThrowsException() throws IOException { + void resolveAllWithInvalidLocatorThrowsException() { BuildpackReference reference = BuildpackReference.of("unknown-buildpack@0.0.1"); assertThatIllegalArgumentException() .isThrownBy(() -> BuildpackResolvers.resolveAll(this.resolverContext, Collections.singleton(reference))) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/ImageBuildpackTests.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/ImageBuildpackTests.java index 7670840852..648dbb3a9c 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/ImageBuildpackTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/ImageBuildpackTests.java @@ -105,7 +105,7 @@ class ImageBuildpackTests extends AbstractJsonTests { } @Test - void resolveWhenFullyQualifiedReferenceWithInvalidImageReferenceThrowsException() throws Exception { + void resolveWhenFullyQualifiedReferenceWithInvalidImageReferenceThrowsException() { BuildpackReference reference = BuildpackReference.of("docker://buildpack@0.0.1"); BuildpackResolverContext resolverContext = mock(BuildpackResolverContext.class); assertThatIllegalArgumentException().isThrownBy(() -> ImageBuildpack.resolve(resolverContext, reference)) @@ -113,7 +113,7 @@ class ImageBuildpackTests extends AbstractJsonTests { } @Test - void resolveWhenUnqualifiedReferenceWithInvalidImageReferenceReturnsNull() throws Exception { + void resolveWhenUnqualifiedReferenceWithInvalidImageReferenceReturnsNull() { BuildpackReference reference = BuildpackReference.of("buildpack@0.0.1"); BuildpackResolverContext resolverContext = mock(BuildpackResolverContext.class); Buildpack buildpack = ImageBuildpack.resolve(resolverContext, reference); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/json/MappedObjectTests.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/json/MappedObjectTests.java index 4c272617aa..3e52079ec5 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/json/MappedObjectTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/json/MappedObjectTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 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. @@ -41,7 +41,7 @@ class MappedObjectTests extends AbstractJsonTests { } @Test - void ofReadsJson() throws Exception { + void ofReadsJson() { assertThat(this.mapped.getNode()).isNotNull(); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-metadata/src/test/java/org/springframework/boot/configurationmetadata/ConfigurationMetadataRepositoryJsonBuilderTests.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-metadata/src/test/java/org/springframework/boot/configurationmetadata/ConfigurationMetadataRepositoryJsonBuilderTests.java index 7a7e9b573b..123a8f10cf 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-metadata/src/test/java/org/springframework/boot/configurationmetadata/ConfigurationMetadataRepositoryJsonBuilderTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-metadata/src/test/java/org/springframework/boot/configurationmetadata/ConfigurationMetadataRepositoryJsonBuilderTests.java @@ -34,7 +34,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException class ConfigurationMetadataRepositoryJsonBuilderTests extends AbstractConfigurationMetadataTests { @Test - void nullResource() throws IOException { + void nullResource() { assertThatIllegalArgumentException() .isThrownBy(() -> ConfigurationMetadataRepositoryJsonBuilder.create().withJsonResource(null)); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-metadata/src/test/java/org/springframework/boot/configurationmetadata/JsonReaderTests.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-metadata/src/test/java/org/springframework/boot/configurationmetadata/JsonReaderTests.java index e7e232054a..68550fb34f 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-metadata/src/test/java/org/springframework/boot/configurationmetadata/JsonReaderTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-metadata/src/test/java/org/springframework/boot/configurationmetadata/JsonReaderTests.java @@ -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. @@ -46,7 +46,7 @@ class JsonReaderTests extends AbstractConfigurationMetadataTests { } @Test - void invalidMetadata() throws IOException { + void invalidMetadata() { assertThatIllegalStateException().isThrownBy(() -> readFor("invalid")).withCauseInstanceOf(JSONException.class); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/ConfigurationMetadataAnnotationProcessorTests.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/ConfigurationMetadataAnnotationProcessorTests.java index 3143a3c7c3..b942ee93c0 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/ConfigurationMetadataAnnotationProcessorTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/ConfigurationMetadataAnnotationProcessorTests.java @@ -243,7 +243,7 @@ class ConfigurationMetadataAnnotationProcessorTests extends AbstractMetadataGene } @Test - void parseArrayConfig() throws Exception { + void parseArrayConfig() { ConfigurationMetadata metadata = compile(SimpleArrayProperties.class); assertThat(metadata).has(Metadata.withGroup("array").ofType(SimpleArrayProperties.class)); assertThat(metadata).has(Metadata.withProperty("array.primitive", "java.lang.Integer[]")); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/IntegratingWithActuatorDocumentationTests.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/IntegratingWithActuatorDocumentationTests.java index 1768b4a4aa..da30a982fc 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/IntegratingWithActuatorDocumentationTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/IntegratingWithActuatorDocumentationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 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. @@ -41,14 +41,14 @@ class IntegratingWithActuatorDocumentationTests { GradleBuild gradleBuild; @TestTemplate - void basicBuildInfo() throws IOException { + void basicBuildInfo() { this.gradleBuild.script("src/docs/gradle/integrating-with-actuator/build-info-basic").build("bootBuildInfo"); assertThat(new File(this.gradleBuild.getProjectDir(), "build/resources/main/META-INF/build-info.properties")) .isFile(); } @TestTemplate - void buildInfoCustomValues() throws IOException { + void buildInfoCustomValues() { this.gradleBuild.script("src/docs/gradle/integrating-with-actuator/build-info-custom-values") .build("bootBuildInfo"); File file = new File(this.gradleBuild.getProjectDir(), "build/resources/main/META-INF/build-info.properties"); @@ -61,7 +61,7 @@ class IntegratingWithActuatorDocumentationTests { } @TestTemplate - void buildInfoAdditional() throws IOException { + void buildInfoAdditional() { this.gradleBuild.script("src/docs/gradle/integrating-with-actuator/build-info-additional") .build("bootBuildInfo"); File file = new File(this.gradleBuild.getProjectDir(), "build/resources/main/META-INF/build-info.properties"); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/PublishingDocumentationTests.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/PublishingDocumentationTests.java index e696c46834..028dfdd109 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/PublishingDocumentationTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/PublishingDocumentationTests.java @@ -16,8 +16,6 @@ package org.springframework.boot.gradle.docs; -import java.io.IOException; - import org.junit.jupiter.api.TestTemplate; import org.junit.jupiter.api.condition.DisabledForJreRange; import org.junit.jupiter.api.condition.JRE; @@ -41,14 +39,14 @@ class PublishingDocumentationTests { @DisabledForJreRange(min = JRE.JAVA_16) @TestTemplate - void mavenUpload() throws IOException { + void mavenUpload() { assertThat(this.gradleBuild.expectDeprecationWarningsWithAtLeastVersion("5.6") .script("src/docs/gradle/publishing/maven").build("deployerRepository").getOutput()) .contains("https://repo.example.com"); } @TestTemplate - void mavenPublish() throws IOException { + void mavenPublish() { assertThat(this.gradleBuild.script("src/docs/gradle/publishing/maven-publish").build("publishingConfiguration") .getOutput()).contains("MavenPublication").contains("https://repo.example.com"); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/RunningDocumentationTests.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/RunningDocumentationTests.java index e75b905314..87d597f384 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/RunningDocumentationTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/RunningDocumentationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 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. @@ -65,25 +65,25 @@ class RunningDocumentationTests { } @TestTemplate - void bootRunSourceResources() throws IOException { + void bootRunSourceResources() { assertThat(this.gradleBuild.script("src/docs/gradle/running/boot-run-source-resources") .build("configuredClasspath").getOutput()).contains(new File("src/main/resources").getPath()); } @TestTemplate - void bootRunDisableOptimizedLaunch() throws IOException { + void bootRunDisableOptimizedLaunch() { assertThat(this.gradleBuild.script("src/docs/gradle/running/boot-run-disable-optimized-launch") .build("optimizedLaunch").getOutput()).contains("false"); } @TestTemplate - void bootRunSystemPropertyDefaultValue() throws IOException { + void bootRunSystemPropertyDefaultValue() { assertThat(this.gradleBuild.script("src/docs/gradle/running/boot-run-system-property") .build("configuredSystemProperties").getOutput()).contains("com.example.property = default"); } @TestTemplate - void bootRunSystemPropetry() throws IOException { + void bootRunSystemPropetry() { assertThat(this.gradleBuild.script("src/docs/gradle/running/boot-run-system-property") .build("-Pexample=custom", "configuredSystemProperties").getOutput()) .contains("com.example.property = custom"); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/dsl/BuildInfoDslIntegrationTests.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/dsl/BuildInfoDslIntegrationTests.java index 4c3cd55730..3ca1134000 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/dsl/BuildInfoDslIntegrationTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/dsl/BuildInfoDslIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 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. @@ -42,7 +42,7 @@ class BuildInfoDslIntegrationTests { GradleBuild gradleBuild; @TestTemplate - void basicJar() throws IOException { + void basicJar() { assertThat(this.gradleBuild.build("bootBuildInfo", "--stacktrace").task(":bootBuildInfo").getOutcome()) .isEqualTo(TaskOutcome.SUCCESS); Properties properties = buildInfoProperties(); @@ -53,7 +53,7 @@ class BuildInfoDslIntegrationTests { } @TestTemplate - void jarWithCustomName() throws IOException { + void jarWithCustomName() { assertThat(this.gradleBuild.build("bootBuildInfo", "--stacktrace").task(":bootBuildInfo").getOutcome()) .isEqualTo(TaskOutcome.SUCCESS); Properties properties = buildInfoProperties(); @@ -64,7 +64,7 @@ class BuildInfoDslIntegrationTests { } @TestTemplate - void basicWar() throws IOException { + void basicWar() { assertThat(this.gradleBuild.build("bootBuildInfo", "--stacktrace").task(":bootBuildInfo").getOutcome()) .isEqualTo(TaskOutcome.SUCCESS); Properties properties = buildInfoProperties(); @@ -75,7 +75,7 @@ class BuildInfoDslIntegrationTests { } @TestTemplate - void warWithCustomName() throws IOException { + void warWithCustomName() { assertThat(this.gradleBuild.build("bootBuildInfo", "--stacktrace").task(":bootBuildInfo").getOutcome()) .isEqualTo(TaskOutcome.SUCCESS); Properties properties = buildInfoProperties(); @@ -86,7 +86,7 @@ class BuildInfoDslIntegrationTests { } @TestTemplate - void additionalProperties() throws IOException { + void additionalProperties() { assertThat(this.gradleBuild.build("bootBuildInfo", "--stacktrace").task(":bootBuildInfo").getOutcome()) .isEqualTo(TaskOutcome.SUCCESS); Properties properties = buildInfoProperties(); @@ -99,7 +99,7 @@ class BuildInfoDslIntegrationTests { } @TestTemplate - void classesDependency() throws IOException { + void classesDependency() { assertThat(this.gradleBuild.build("classes", "--stacktrace").task(":bootBuildInfo").getOutcome()) .isEqualTo(TaskOutcome.SUCCESS); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/buildinfo/BuildInfoIntegrationTests.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/buildinfo/BuildInfoIntegrationTests.java index 31e4f41de7..ce126b3f5b 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/buildinfo/BuildInfoIntegrationTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/buildinfo/BuildInfoIntegrationTests.java @@ -92,7 +92,7 @@ class BuildInfoIntegrationTests { } @TestTemplate - void notUpToDateWhenExecutedTwiceWithFixedTimeAndChangedProjectVersion() throws IOException { + void notUpToDateWhenExecutedTwiceWithFixedTimeAndChangedProjectVersion() { assertThat(this.gradleBuild.scriptProperty("projectVersion", "0.1.0").build("buildInfo").task(":buildInfo") .getOutcome()).isEqualTo(TaskOutcome.SUCCESS); assertThat(this.gradleBuild.scriptProperty("projectVersion", "0.2.0").build("buildInfo").task(":buildInfo") diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/AbstractBootArchiveIntegrationTests.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/AbstractBootArchiveIntegrationTests.java index aaec5c9f08..013e975c71 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/AbstractBootArchiveIntegrationTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/AbstractBootArchiveIntegrationTests.java @@ -86,7 +86,7 @@ abstract class AbstractBootArchiveIntegrationTests { } @TestTemplate - void basicBuild() throws InvalidRunnerConfigurationException, UnexpectedBuildFailure, IOException { + void basicBuild() { assertThat(this.gradleBuild.build(this.taskName).task(":" + this.taskName).getOutcome()) .isEqualTo(TaskOutcome.SUCCESS); } @@ -106,7 +106,7 @@ abstract class AbstractBootArchiveIntegrationTests { } @TestTemplate - void upToDateWhenBuiltTwice() throws InvalidRunnerConfigurationException, UnexpectedBuildFailure, IOException { + void upToDateWhenBuiltTwice() { assertThat(this.gradleBuild.build(this.taskName).task(":" + this.taskName).getOutcome()) .isEqualTo(TaskOutcome.SUCCESS); assertThat(this.gradleBuild.build(this.taskName).task(":" + this.taskName).getOutcome()) @@ -114,8 +114,7 @@ abstract class AbstractBootArchiveIntegrationTests { } @TestTemplate - void upToDateWhenBuiltTwiceWithLaunchScriptIncluded() - throws InvalidRunnerConfigurationException, UnexpectedBuildFailure, IOException { + void upToDateWhenBuiltTwiceWithLaunchScriptIncluded() { assertThat(this.gradleBuild.build("-PincludeLaunchScript=true", this.taskName).task(":" + this.taskName) .getOutcome()).isEqualTo(TaskOutcome.SUCCESS); assertThat(this.gradleBuild.build("-PincludeLaunchScript=true", this.taskName).task(":" + this.taskName) @@ -167,7 +166,7 @@ abstract class AbstractBootArchiveIntegrationTests { } @TestTemplate - void duplicatesAreHandledGracefully() throws IOException { + void duplicatesAreHandledGracefully() { assertThat(this.gradleBuild.build(this.taskName).task(":" + this.taskName).getOutcome()) .isEqualTo(TaskOutcome.SUCCESS); } @@ -257,7 +256,7 @@ abstract class AbstractBootArchiveIntegrationTests { } @TestTemplate - void layersWithCustomSourceSet() throws IOException { + void layersWithCustomSourceSet() { assertThat(this.gradleBuild.build(this.taskName).task(":" + this.taskName).getOutcome()) .isEqualTo(TaskOutcome.SUCCESS); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootBuildImageRegistryIntegrationTests.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootBuildImageRegistryIntegrationTests.java index de7531dcec..5fd56b4abb 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootBuildImageRegistryIntegrationTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootBuildImageRegistryIntegrationTests.java @@ -66,7 +66,7 @@ public class BootBuildImageRegistryIntegrationTests { } @TestTemplate - void buildsImageAndPublishesToRegistry() throws IOException, InterruptedException { + void buildsImageAndPublishesToRegistry() throws IOException { writeMainClass(); String repoName = "test-image"; String imageName = this.registryAddress + "/" + repoName; diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/MavenIntegrationTests.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/MavenIntegrationTests.java index 8073178299..975c63c8f4 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/MavenIntegrationTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/MavenIntegrationTests.java @@ -17,8 +17,6 @@ package org.springframework.boot.gradle.tasks.bundling; import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; import org.gradle.testkit.runner.BuildResult; import org.gradle.testkit.runner.TaskOutcome; @@ -43,7 +41,7 @@ class MavenIntegrationTests { GradleBuild gradleBuild; @TestTemplate - void bootJarCanBeUploaded() throws FileNotFoundException, IOException { + void bootJarCanBeUploaded() { BuildResult result = this.gradleBuild.expectDeprecationWarningsWithAtLeastVersion("6.0.0") .build("uploadBootArchives"); assertThat(result.task(":uploadBootArchives").getOutcome()).isEqualTo(TaskOutcome.SUCCESS); @@ -53,7 +51,7 @@ class MavenIntegrationTests { } @TestTemplate - void bootWarCanBeUploaded() throws IOException { + void bootWarCanBeUploaded() { BuildResult result = this.gradleBuild.expectDeprecationWarningsWithAtLeastVersion("6.0.0") .build("uploadBootArchives"); assertThat(result.task(":uploadBootArchives").getOutcome()).isEqualTo(TaskOutcome.SUCCESS); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/MavenPublishingIntegrationTests.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/MavenPublishingIntegrationTests.java index 2acefd0d8b..2571e1e256 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/MavenPublishingIntegrationTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/MavenPublishingIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 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. @@ -17,8 +17,6 @@ package org.springframework.boot.gradle.tasks.bundling; import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; import org.gradle.testkit.runner.BuildResult; import org.gradle.testkit.runner.TaskOutcome; @@ -41,7 +39,7 @@ class MavenPublishingIntegrationTests { GradleBuild gradleBuild; @TestTemplate - void bootJarCanBePublished() throws FileNotFoundException, IOException { + void bootJarCanBePublished() { BuildResult result = this.gradleBuild.build("publish"); assertThat(result.task(":publish").getOutcome()).isEqualTo(TaskOutcome.SUCCESS); assertThat(artifactWithSuffix("jar")).isFile(); @@ -50,7 +48,7 @@ class MavenPublishingIntegrationTests { } @TestTemplate - void bootWarCanBePublished() throws IOException { + void bootWarCanBePublished() { BuildResult result = this.gradleBuild.build("publish"); assertThat(result.task(":publish").getOutcome()).isEqualTo(TaskOutcome.SUCCESS); assertThat(artifactWithSuffix("war")).isFile(); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-jarmode-layertools/src/test/java/org/springframework/boot/jarmode/layertools/ExtractCommandTests.java b/spring-boot-project/spring-boot-tools/spring-boot-jarmode-layertools/src/test/java/org/springframework/boot/jarmode/layertools/ExtractCommandTests.java index 357a45b359..114ecb0de9 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-jarmode-layertools/src/test/java/org/springframework/boot/jarmode/layertools/ExtractCommandTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-jarmode-layertools/src/test/java/org/springframework/boot/jarmode/layertools/ExtractCommandTests.java @@ -75,7 +75,7 @@ class ExtractCommandTests { } @Test - void runExtractsLayers() throws Exception { + void runExtractsLayers() { given(this.context.getArchiveFile()).willReturn(this.jarFile); given(this.context.getWorkingDir()).willReturn(this.extract); this.command.run(Collections.emptyMap(), Collections.emptyList()); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-jarmode-layertools/src/test/java/org/springframework/boot/jarmode/layertools/IndexedLayersTests.java b/spring-boot-project/spring-boot-tools/spring-boot-jarmode-layertools/src/test/java/org/springframework/boot/jarmode/layertools/IndexedLayersTests.java index c3ad14beed..2074dbe605 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-jarmode-layertools/src/test/java/org/springframework/boot/jarmode/layertools/IndexedLayersTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-jarmode-layertools/src/test/java/org/springframework/boot/jarmode/layertools/IndexedLayersTests.java @@ -51,7 +51,7 @@ class IndexedLayersTests { } @Test - void createWhenIndexFileIsMalformedThrowsException() throws Exception { + void createWhenIndexFileIsMalformedThrowsException() { assertThatIllegalStateException().isThrownBy(() -> new IndexedLayers("test")) .withMessage("Layer index file is malformed"); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/test/java/org/springframework/boot/loader/tools/FileUtilsTests.java b/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/test/java/org/springframework/boot/loader/tools/FileUtilsTests.java index e24c84e159..1050e1ec51 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/test/java/org/springframework/boot/loader/tools/FileUtilsTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/test/java/org/springframework/boot/loader/tools/FileUtilsTests.java @@ -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. @@ -43,7 +43,7 @@ class FileUtilsTests { private File originDirectory; @BeforeEach - void init() throws IOException { + void init() { this.outputDirectory = new File(this.tempDir, "remove"); this.originDirectory = new File(this.tempDir, "keep"); this.outputDirectory.mkdirs(); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/test/java/org/springframework/boot/loader/tools/LayersIndexTests.java b/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/test/java/org/springframework/boot/loader/tools/LayersIndexTests.java index 127e674294..c1759b2402 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/test/java/org/springframework/boot/loader/tools/LayersIndexTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/test/java/org/springframework/boot/loader/tools/LayersIndexTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 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. @@ -52,7 +52,7 @@ class LayersIndexTests { } @Test - void writeToWhenSimpleNamesSortsAlphabetically() throws Exception { + void writeToWhenSimpleNamesSortsAlphabetically() { LayersIndex index = new LayersIndex(LAYER_A); index.add(LAYER_A, "cat"); index.add(LAYER_A, "dog"); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/ClassPathIndexFileTests.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/ClassPathIndexFileTests.java index 889b045ed9..a7e74a6fa5 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/ClassPathIndexFileTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/ClassPathIndexFileTests.java @@ -42,7 +42,7 @@ class ClassPathIndexFileTests { File temp; @Test - void loadIfPossibleWhenRootIsNotFileReturnsNull() throws IOException { + void loadIfPossibleWhenRootIsNotFileReturnsNull() { assertThatIllegalArgumentException() .isThrownBy(() -> ClassPathIndexFile.loadIfPossible(new URL("https://example.com/file"), "test.idx")) .withMessage("URL does not reference a file"); @@ -95,7 +95,7 @@ class ClassPathIndexFileTests { } } - private ClassPathIndexFile copyAndLoadTestIndexFile() throws IOException, MalformedURLException { + private ClassPathIndexFile copyAndLoadTestIndexFile() throws IOException { copyTestIndexFile(); ClassPathIndexFile indexFile = ClassPathIndexFile.loadIfPossible(this.temp.toURI().toURL(), "test.idx"); return indexFile; diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/PropertiesLauncherTests.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/PropertiesLauncherTests.java index 53fb071df7..d36269c3a4 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/PropertiesLauncherTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/PropertiesLauncherTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 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. @@ -401,7 +401,7 @@ class PropertiesLauncherTests { assertThat(bytes).isNotEmpty(); } - private void waitFor(String value) throws Exception { + private void waitFor(String value) { Awaitility.waitAtMost(Duration.ofSeconds(5)).until(this.output::toString, containsString(value)); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/data/RandomAccessDataFileTests.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/data/RandomAccessDataFileTests.java index 0e42e0fb12..fd567134f4 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/data/RandomAccessDataFileTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/data/RandomAccessDataFileTests.java @@ -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. @@ -96,23 +96,23 @@ class RandomAccessDataFileTests { } @Test - void readWhenOffsetIsBeyondEOFShouldThrowException() throws Exception { + void readWhenOffsetIsBeyondEOFShouldThrowException() { assertThatExceptionOfType(IndexOutOfBoundsException.class).isThrownBy(() -> this.file.read(257, 0)); } @Test - void readWhenOffsetIsBeyondEndOfSubsectionShouldThrowException() throws Exception { + void readWhenOffsetIsBeyondEndOfSubsectionShouldThrowException() { RandomAccessData subsection = this.file.getSubsection(0, 10); assertThatExceptionOfType(IndexOutOfBoundsException.class).isThrownBy(() -> subsection.read(11, 0)); } @Test - void readWhenOffsetPlusLengthGreaterThanEOFShouldThrowException() throws Exception { + void readWhenOffsetPlusLengthGreaterThanEOFShouldThrowException() { assertThatExceptionOfType(EOFException.class).isThrownBy(() -> this.file.read(256, 1)); } @Test - void readWhenOffsetPlusLengthGreaterThanEndOfSubsectionShouldThrowException() throws Exception { + void readWhenOffsetPlusLengthGreaterThanEndOfSubsectionShouldThrowException() { RandomAccessData subsection = this.file.getSubsection(0, 10); assertThatExceptionOfType(EOFException.class).isThrownBy(() -> subsection.read(10, 1)); } @@ -125,13 +125,13 @@ class RandomAccessDataFileTests { } @Test - void inputStreamReadNullBytes() throws Exception { + void inputStreamReadNullBytes() { assertThatNullPointerException().isThrownBy(() -> this.inputStream.read(null)) .withMessage("Bytes must not be null"); } @Test - void inputStreamReadNullBytesWithOffset() throws Exception { + void inputStreamReadNullBytesWithOffset() { assertThatNullPointerException().isThrownBy(() -> this.inputStream.read(null, 0, 1)) .withMessage("Bytes must not be null"); } diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/SimpleMainTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/SimpleMainTests.java index ddc0731a60..24b9f9f730 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/SimpleMainTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/SimpleMainTests.java @@ -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. @@ -44,7 +44,7 @@ class SimpleMainTests { private static final String SPRING_STARTUP = "Started SpringApplication in"; @Test - void emptyApplicationContext() throws Exception { + void emptyApplicationContext() { assertThatIllegalArgumentException().isThrownBy(() -> SpringApplication.main(getArgs())); } diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/admin/SpringApplicationAdminMXBeanRegistrarTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/admin/SpringApplicationAdminMXBeanRegistrarTests.java index b8d8c11f2e..163cde055b 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/admin/SpringApplicationAdminMXBeanRegistrarTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/admin/SpringApplicationAdminMXBeanRegistrarTests.java @@ -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. @@ -112,7 +112,7 @@ class SpringApplicationAdminMXBeanRegistrarTests { } @Test - void shutdownApp() throws InstanceNotFoundException { + void shutdownApp() { final ObjectName objectName = createObjectName(OBJECT_NAME); SpringApplication application = new SpringApplication(Config.class); application.setWebApplicationType(WebApplicationType.NONE); diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/ApplicationPidFileWriterTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/ApplicationPidFileWriterTests.java index 5a62022ce5..3dbeec2647 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/ApplicationPidFileWriterTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/ApplicationPidFileWriterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 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. @@ -68,7 +68,7 @@ class ApplicationPidFileWriterTests { } @Test - void createPidFile() throws Exception { + void createPidFile() { File file = new File(this.tempDir, "pid"); ApplicationPidFileWriter listener = new ApplicationPidFileWriter(file); listener.onApplicationEvent(EVENT); @@ -76,7 +76,7 @@ class ApplicationPidFileWriterTests { } @Test - void overridePidFile() throws Exception { + void overridePidFile() { File file = new File(this.tempDir, "pid"); System.setProperty("PIDFILE", new File(this.tempDir, "override").getAbsolutePath()); ApplicationPidFileWriter listener = new ApplicationPidFileWriter(file); @@ -85,7 +85,7 @@ class ApplicationPidFileWriterTests { } @Test - void overridePidFileWithSpring() throws Exception { + void overridePidFileWithSpring() { File file = new File(this.tempDir, "pid"); SpringApplicationEvent event = createPreparedEvent("spring.pid.file", file.getAbsolutePath()); ApplicationPidFileWriter listener = new ApplicationPidFileWriter(); @@ -120,7 +120,7 @@ class ApplicationPidFileWriterTests { } @Test - void withNoEnvironment() throws Exception { + void withNoEnvironment() { File file = new File(this.tempDir, "pid"); ApplicationPidFileWriter listener = new ApplicationPidFileWriter(file); listener.setTriggerEventType(ApplicationStartingEvent.class); diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigDataLoadersTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigDataLoadersTests.java index df7b9655ba..b6ddb6e6ae 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigDataLoadersTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigDataLoadersTests.java @@ -88,7 +88,7 @@ class ConfigDataLoadersTests { } @Test - void loadWhenMultipleLoadersSupportLocationThrowsException() throws Exception { + void loadWhenMultipleLoadersSupportLocationThrowsException() { TestConfigDataResource location = new TestConfigDataResource("test"); ConfigDataLoaders loaders = new ConfigDataLoaders(this.logFactory, this.bootstrapContext, Arrays.asList(LoggingConfigDataLoader.class.getName(), TestConfigDataLoader.class.getName())); diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/logging/LoggingApplicationListenerIntegrationTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/logging/LoggingApplicationListenerIntegrationTests.java index 24cb44f5df..dbc8f46c7c 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/logging/LoggingApplicationListenerIntegrationTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/logging/LoggingApplicationListenerIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 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. @@ -57,7 +57,7 @@ class LoggingApplicationListenerIntegrationTests { } @Test - void logFileRegisteredInTheContextWhenApplicable(@TempDir File tempDir) throws Exception { + void logFileRegisteredInTheContextWhenApplicable(@TempDir File tempDir) { String logFile = new File(tempDir, "test.log").getAbsolutePath(); try (ConfigurableApplicationContext context = new SpringApplicationBuilder(SampleService.class) .web(WebApplicationType.NONE).properties("logging.file.name=" + logFile).run()) { diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/logging/LoggingApplicationListenerTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/logging/LoggingApplicationListenerTests.java index 8ea4400197..9857be4eef 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/logging/LoggingApplicationListenerTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/logging/LoggingApplicationListenerTests.java @@ -129,7 +129,7 @@ class LoggingApplicationListenerTests { } @AfterEach - void clear() throws IOException { + void clear() { LoggingSystem loggingSystem = LoggingSystem.get(getClass().getClassLoader()); loggingSystem.setLogLevel("ROOT", LogLevel.INFO); loggingSystem.cleanUp(); @@ -420,7 +420,7 @@ class LoggingApplicationListenerTests { } @Test - void shutdownHookRegistrationCanBeDisabled() throws Exception { + void shutdownHookRegistrationCanBeDisabled() { TestLoggingApplicationListener listener = new TestLoggingApplicationListener(); Object registered = ReflectionTestUtils.getField(listener, TestLoggingApplicationListener.class, "shutdownHookRegistered"); diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/EnableConfigurationPropertiesRegistrarTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/EnableConfigurationPropertiesRegistrarTests.java index ab316ea0ba..4fde563278 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/EnableConfigurationPropertiesRegistrarTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/EnableConfigurationPropertiesRegistrarTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 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. @@ -16,8 +16,6 @@ package org.springframework.boot.context.properties; -import java.io.IOException; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -53,7 +51,7 @@ class EnableConfigurationPropertiesRegistrarTests { } @Test - void typeWithDefaultConstructorShouldRegisterGenericBeanDefinition() throws Exception { + void typeWithDefaultConstructorShouldRegisterGenericBeanDefinition() { register(TestConfiguration.class); BeanDefinition beanDefinition = this.beanFactory .getBeanDefinition("foo-" + getClass().getName() + "$FooProperties"); @@ -61,7 +59,7 @@ class EnableConfigurationPropertiesRegistrarTests { } @Test - void typeWithConstructorBindingShouldRegisterConfigurationPropertiesBeanDefinition() throws Exception { + void typeWithConstructorBindingShouldRegisterConfigurationPropertiesBeanDefinition() { register(TestConfiguration.class); BeanDefinition beanDefinition = this.beanFactory .getBeanDefinition("bar-" + getClass().getName() + "$BarProperties"); @@ -69,7 +67,7 @@ class EnableConfigurationPropertiesRegistrarTests { } @Test - void typeWithMultipleConstructorsShouldRegisterGenericBeanDefinition() throws Exception { + void typeWithMultipleConstructorsShouldRegisterGenericBeanDefinition() { register(TestConfiguration.class); BeanDefinition beanDefinition = this.beanFactory .getBeanDefinition("bing-" + getClass().getName() + "$BingProperties"); @@ -84,14 +82,14 @@ class EnableConfigurationPropertiesRegistrarTests { } @Test - void registrationWithDuplicatedTypeShouldRegisterSingleBeanDefinition() throws IOException { + void registrationWithDuplicatedTypeShouldRegisterSingleBeanDefinition() { register(DuplicateConfiguration.class); String name = "foo-" + getClass().getName() + "$FooProperties"; verify(this.beanFactory, times(1)).registerBeanDefinition(eq(name), any()); } @Test - void registrationWithNoTypeShouldNotRegisterAnything() throws IOException { + void registrationWithNoTypeShouldNotRegisterAnything() { register(EmptyConfiguration.class); String[] names = this.beanFactory.getBeanNamesForType(Object.class); for (String name : names) { diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/BindResultTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/BindResultTests.java index bb9b98d359..46784450c2 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/BindResultTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/BindResultTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 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. @@ -153,7 +153,7 @@ class BindResultTests { } @Test - void orElseThrowWhenHasNoValueShouldThrowException() throws Exception { + void orElseThrowWhenHasNoValueShouldThrowException() { BindResult result = BindResult.of(null); assertThatIOException().isThrownBy(() -> result.orElseThrow(IOException::new)); } diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/DataObjectPropertyNameTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/DataObjectPropertyNameTests.java index 468454623c..068db9d2d3 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/DataObjectPropertyNameTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/DataObjectPropertyNameTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 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. @@ -39,7 +39,7 @@ class DataObjectPropertyNameTests { } @Test - void toDashedFormWhenContainsIndexedAddsNoDashToIndex() throws Exception { + void toDashedFormWhenContainsIndexedAddsNoDashToIndex() { assertThat(DataObjectPropertyName.toDashedForm("test[fooBar]")).isEqualTo("test[fooBar]"); assertThat(DataObjectPropertyName.toDashedForm("testAgain[fooBar]")).isEqualTo("test-again[fooBar]"); } diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/validation/ValidationBindHandlerTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/validation/ValidationBindHandlerTests.java index 450e1e79e7..34480b24a3 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/validation/ValidationBindHandlerTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/validation/ValidationBindHandlerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 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. @@ -218,7 +218,7 @@ class ValidationBindHandlerTests { } @Test - void validateMapValues() throws Exception { + void validateMapValues() { MockConfigurationPropertySource source = new MockConfigurationPropertySource(); source.put("test.items.[itemOne].number", "one"); source.put("test.items.[ITEM2].number", "two"); @@ -229,7 +229,7 @@ class ValidationBindHandlerTests { } @Test - void validateMapValuesWithNonUniformSource() throws Exception { + void validateMapValuesWithNonUniformSource() { Map map = new LinkedHashMap<>(); map.put("test.items.itemOne.number", "one"); map.put("test.items.ITEM2.number", "two"); diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/convert/InetAddressFormatterTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/convert/InetAddressFormatterTests.java index 33b2820645..626b0eb375 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/convert/InetAddressFormatterTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/convert/InetAddressFormatterTests.java @@ -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. @@ -37,7 +37,7 @@ import static org.junit.jupiter.api.Assumptions.assumingThat; class InetAddressFormatterTests { @ConversionServiceTest - void convertFromInetAddressToStringShouldConvert(ConversionService conversionService) throws UnknownHostException { + void convertFromInetAddressToStringShouldConvert(ConversionService conversionService) { assumingThat(isResolvable("example.com"), () -> { InetAddress address = InetAddress.getByName("example.com"); String converted = conversionService.convert(address, String.class); diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/env/NoSnakeYamlPropertySourceLoaderTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/env/NoSnakeYamlPropertySourceLoaderTests.java index cd9d92d78c..4192448c46 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/env/NoSnakeYamlPropertySourceLoaderTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/env/NoSnakeYamlPropertySourceLoaderTests.java @@ -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. @@ -34,7 +34,7 @@ class NoSnakeYamlPropertySourceLoaderTests { private YamlPropertySourceLoader loader = new YamlPropertySourceLoader(); @Test - void load() throws Exception { + void load() { ByteArrayResource resource = new ByteArrayResource("foo:\n bar: spam".getBytes()); assertThatIllegalStateException().isThrownBy(() -> this.loader.load("resource", resource)) .withMessageContaining("Attempted to load resource but snakeyaml was not found on the classpath"); diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/env/OriginTrackedPropertiesLoaderTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/env/OriginTrackedPropertiesLoaderTests.java index 16a6c8bca9..13d1af165c 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/env/OriginTrackedPropertiesLoaderTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/env/OriginTrackedPropertiesLoaderTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 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. @@ -90,7 +90,7 @@ class OriginTrackedPropertiesLoaderTests { } @Test - void getMalformedUnicodeProperty() throws Exception { + void getMalformedUnicodeProperty() { // gh-12716 ClassPathResource resource = new ClassPathResource("test-properties-malformed-unicode.properties", getClass()); assertThatIllegalStateException().isThrownBy(() -> new OriginTrackedPropertiesLoader(resource).load()) diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/env/OriginTrackedYamlLoaderTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/env/OriginTrackedYamlLoaderTests.java index 1c41a623e1..874dfaaf0c 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/env/OriginTrackedYamlLoaderTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/env/OriginTrackedYamlLoaderTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 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. @@ -130,7 +130,7 @@ class OriginTrackedYamlLoaderTests { } @Test - void unsupportedType() throws Exception { + void unsupportedType() { String yaml = "value: !!java.net.URL [!!java.lang.String [!!java.lang.StringBuilder [\"http://localhost:9000/\"]]]"; Resource resource = new ByteArrayResource(yaml.getBytes(StandardCharsets.UTF_8)); this.loader = new OriginTrackedYamlLoader(resource); diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/json/YamlJsonParserTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/json/YamlJsonParserTests.java index 928679b069..f7e88aab9a 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/json/YamlJsonParserTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/json/YamlJsonParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 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. @@ -34,7 +34,7 @@ public class YamlJsonParserTests extends AbstractJsonParserTests { } @Test - void customTypesAreNotLoaded() throws Exception { + void customTypesAreNotLoaded() { assertThatExceptionOfType(ConstructorException.class) .isThrownBy(() -> getParser().parseMap("{value: !!java.net.URL [\"http://localhost:9000/\"]}")) .withCauseInstanceOf(IllegalStateException.class); diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/client/RestTemplateBuilderClientHttpRequestInitializerTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/client/RestTemplateBuilderClientHttpRequestInitializerTests.java index 520579d46e..4bf219cf54 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/client/RestTemplateBuilderClientHttpRequestInitializerTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/client/RestTemplateBuilderClientHttpRequestInitializerTests.java @@ -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. @@ -16,7 +16,6 @@ package org.springframework.boot.web.client; -import java.io.IOException; import java.util.Arrays; import java.util.Collections; import java.util.LinkedHashMap; @@ -48,14 +47,14 @@ public class RestTemplateBuilderClientHttpRequestInitializerTests { private final MockClientHttpRequest request = new MockClientHttpRequest(); @Test - void createRequestWhenHasBasicAuthAndNoAuthHeaderAddsHeader() throws IOException { + void createRequestWhenHasBasicAuthAndNoAuthHeaderAddsHeader() { new RestTemplateBuilderClientHttpRequestInitializer(new BasicAuthentication("spring", "boot", null), Collections.emptyMap(), Collections.emptySet()).initialize(this.request); assertThat(this.request.getHeaders().get(HttpHeaders.AUTHORIZATION)).containsExactly("Basic c3ByaW5nOmJvb3Q="); } @Test - void createRequestWhenHasBasicAuthAndExistingAuthHeaderDoesNotAddHeader() throws IOException { + void createRequestWhenHasBasicAuthAndExistingAuthHeaderDoesNotAddHeader() { this.request.getHeaders().setBasicAuth("boot", "spring"); new RestTemplateBuilderClientHttpRequestInitializer(new BasicAuthentication("spring", "boot", null), Collections.emptyMap(), Collections.emptySet()).initialize(this.request); @@ -63,7 +62,7 @@ public class RestTemplateBuilderClientHttpRequestInitializerTests { } @Test - void createRequestWhenHasDefaultHeadersAddsMissing() throws IOException { + void createRequestWhenHasDefaultHeadersAddsMissing() { this.request.getHeaders().add("one", "existing"); Map> defaultHeaders = new LinkedHashMap<>(); defaultHeaders.put("one", Collections.singletonList("1")); @@ -78,7 +77,7 @@ public class RestTemplateBuilderClientHttpRequestInitializerTests { @Test @SuppressWarnings("unchecked") - void createRequestWhenHasRequestCustomizersAppliesThemInOrder() throws IOException { + void createRequestWhenHasRequestCustomizersAppliesThemInOrder() { Set> customizers = new LinkedHashSet<>(); customizers.add(mock(RestTemplateRequestCustomizer.class)); customizers.add(mock(RestTemplateRequestCustomizer.class)); diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/client/RestTemplateBuilderTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/client/RestTemplateBuilderTests.java index 40f60d06bb..7eac2c08f5 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/client/RestTemplateBuilderTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/client/RestTemplateBuilderTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 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. @@ -16,7 +16,6 @@ package org.springframework.boot.web.client; -import java.io.IOException; import java.net.URI; import java.nio.charset.StandardCharsets; import java.time.Duration; @@ -304,7 +303,7 @@ class RestTemplateBuilderTests { } @Test - void basicAuthenticationShouldApply() throws Exception { + void basicAuthenticationShouldApply() { RestTemplate template = this.builder.basicAuthentication("spring", "boot", StandardCharsets.UTF_8).build(); ClientHttpRequest request = createRequest(template); assertThat(request.getHeaders()).containsOnlyKeys(HttpHeaders.AUTHORIZATION); @@ -312,14 +311,14 @@ class RestTemplateBuilderTests { } @Test - void defaultHeaderAddsHeader() throws IOException { + void defaultHeaderAddsHeader() { RestTemplate template = this.builder.defaultHeader("spring", "boot").build(); ClientHttpRequest request = createRequest(template); assertThat(request.getHeaders()).contains(entry("spring", Collections.singletonList("boot"))); } @Test - void defaultHeaderAddsHeaderValues() throws IOException { + void defaultHeaderAddsHeaderValues() { String name = HttpHeaders.ACCEPT; String[] values = { MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_XML_VALUE }; RestTemplate template = this.builder.defaultHeader(name, values).build(); @@ -328,7 +327,7 @@ class RestTemplateBuilderTests { } @Test // gh-17885 - void defaultHeaderWhenUsingMockRestServiceServerAddsHeader() throws IOException { + void defaultHeaderWhenUsingMockRestServiceServerAddsHeader() { RestTemplate template = this.builder.defaultHeader("spring", "boot").build(); MockRestServiceServer.bindTo(template).build(); ClientHttpRequest request = createRequest(template); @@ -336,7 +335,7 @@ class RestTemplateBuilderTests { } @Test - void requestCustomizersAddsCustomizers() throws IOException { + void requestCustomizersAddsCustomizers() { RestTemplate template = this.builder .requestCustomizers((request) -> request.getHeaders().add("spring", "framework")).build(); ClientHttpRequest request = createRequest(template); @@ -344,7 +343,7 @@ class RestTemplateBuilderTests { } @Test - void additionalRequestCustomizersAddsCustomizers() throws IOException { + void additionalRequestCustomizersAddsCustomizers() { RestTemplate template = this.builder .requestCustomizers((request) -> request.getHeaders().add("spring", "framework")) .additionalRequestCustomizers((request) -> request.getHeaders().add("for", "java")).build(); diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/context/WebServerPortFileWriterTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/context/WebServerPortFileWriterTests.java index c5bbcbdbdd..a791a9b784 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/context/WebServerPortFileWriterTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/context/WebServerPortFileWriterTests.java @@ -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. @@ -53,7 +53,7 @@ class WebServerPortFileWriterTests { } @Test - void createPortFile() throws Exception { + void createPortFile() { File file = new File(this.tempDir, "port.file"); WebServerPortFileWriter listener = new WebServerPortFileWriter(file); listener.onApplicationEvent(mockEvent("", 8080)); @@ -61,7 +61,7 @@ class WebServerPortFileWriterTests { } @Test - void overridePortFileWithDefault() throws Exception { + void overridePortFileWithDefault() { System.setProperty("PORTFILE", new File(this.tempDir, "port.file").getAbsolutePath()); WebServerPortFileWriter listener = new WebServerPortFileWriter(); listener.onApplicationEvent(mockEvent("", 8080)); @@ -70,7 +70,7 @@ class WebServerPortFileWriterTests { } @Test - void overridePortFileWithExplicitFile() throws Exception { + void overridePortFileWithExplicitFile() { File file = new File(this.tempDir, "port.file"); System.setProperty("PORTFILE", new File(this.tempDir, "override.file").getAbsolutePath()); WebServerPortFileWriter listener = new WebServerPortFileWriter(file); @@ -80,7 +80,7 @@ class WebServerPortFileWriterTests { } @Test - void createManagementPortFile() throws Exception { + void createManagementPortFile() { File file = new File(this.tempDir, "port.file"); WebServerPortFileWriter listener = new WebServerPortFileWriter(file); listener.onApplicationEvent(mockEvent("", 8080)); @@ -96,7 +96,7 @@ class WebServerPortFileWriterTests { } @Test - void createUpperCaseManagementPortFile() throws Exception { + void createUpperCaseManagementPortFile() { File file = new File(this.tempDir, "port.file"); file = new File(file.getParentFile(), file.getName().toUpperCase(Locale.ENGLISH)); WebServerPortFileWriter listener = new WebServerPortFileWriter(file); diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/jetty/Jetty10ServletWebServerFactoryTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/jetty/Jetty10ServletWebServerFactoryTests.java index 404200c967..e167189611 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/jetty/Jetty10ServletWebServerFactoryTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/jetty/Jetty10ServletWebServerFactoryTests.java @@ -47,7 +47,7 @@ public class Jetty10ServletWebServerFactoryTests extends JettyServletWebServerFa @Test @Override @Disabled("Jetty 10 adds methods to Configuration that we can't mock while compiling against 9") - protected void jettyConfigurations() throws Exception { + protected void jettyConfigurations() { } } diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/jetty/JettyReactiveWebServerFactoryTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/jetty/JettyReactiveWebServerFactoryTests.java index 621a44c466..e6a93f8033 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/jetty/JettyReactiveWebServerFactoryTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/jetty/JettyReactiveWebServerFactoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 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. @@ -116,7 +116,7 @@ class JettyReactiveWebServerFactoryTests extends AbstractReactiveWebServerFactor } @Test - void whenServerIsShuttingDownGracefullyThenNewConnectionsCannotBeMade() throws Exception { + void whenServerIsShuttingDownGracefullyThenNewConnectionsCannotBeMade() { JettyReactiveWebServerFactory factory = getFactory(); factory.setShutdown(Shutdown.GRACEFUL); BlockingHandler blockingHandler = new BlockingHandler(); diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/jetty/JettyServletWebServerFactoryTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/jetty/JettyServletWebServerFactoryTests.java index f71ee30aef..5c59d80620 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/jetty/JettyServletWebServerFactoryTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/jetty/JettyServletWebServerFactoryTests.java @@ -384,7 +384,7 @@ class JettyServletWebServerFactoryTests extends AbstractJettyServletWebServerFac } @Test - void faultyListenerCausesStartFailure() throws Exception { + void faultyListenerCausesStartFailure() { JettyServletWebServerFactory factory = getFactory(); factory.addServerCustomizers((JettyServerCustomizer) (server) -> { Collection contexts = server.getBeans(WebAppContext.class); diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/netty/NettyReactiveWebServerFactoryTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/netty/NettyReactiveWebServerFactoryTests.java index f06839cb22..899fa38155 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/netty/NettyReactiveWebServerFactoryTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/netty/NettyReactiveWebServerFactoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 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. @@ -113,7 +113,7 @@ class NettyReactiveWebServerFactoryTests extends AbstractReactiveWebServerFactor } @Test - void whenServerIsShuttingDownGracefullyThenNewConnectionsCannotBeMade() throws Exception { + void whenServerIsShuttingDownGracefullyThenNewConnectionsCannotBeMade() { NettyReactiveWebServerFactory factory = getFactory(); factory.setShutdown(Shutdown.GRACEFUL); BlockingHandler blockingHandler = new BlockingHandler(); diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/netty/SslServerCustomizerTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/netty/SslServerCustomizerTests.java index 9ba91d5db6..e1eace5595 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/netty/SslServerCustomizerTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/netty/SslServerCustomizerTests.java @@ -35,7 +35,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalStateException; class SslServerCustomizerTests { @Test - void keyStoreProviderIsUsedWhenCreatingKeyStore() throws Exception { + void keyStoreProviderIsUsedWhenCreatingKeyStore() { Ssl ssl = new Ssl(); ssl.setKeyPassword("password"); ssl.setKeyStore("src/test/resources/test.jks"); @@ -47,7 +47,7 @@ class SslServerCustomizerTests { } @Test - void trustStoreProviderIsUsedWhenCreatingTrustStore() throws Exception { + void trustStoreProviderIsUsedWhenCreatingTrustStore() { Ssl ssl = new Ssl(); ssl.setTrustStorePassword("password"); ssl.setTrustStore("src/test/resources/test.jks"); @@ -59,7 +59,7 @@ class SslServerCustomizerTests { } @Test - void getKeyManagerFactoryWhenSslIsEnabledWithNoKeyStoreThrowsWebServerException() throws Exception { + void getKeyManagerFactoryWhenSslIsEnabledWithNoKeyStoreThrowsWebServerException() { Ssl ssl = new Ssl(); SslServerCustomizer customizer = new SslServerCustomizer(ssl, null, null); assertThatIllegalStateException().isThrownBy(() -> customizer.getKeyManagerFactory(ssl, null)) diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/tomcat/TomcatReactiveWebServerFactoryTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/tomcat/TomcatReactiveWebServerFactoryTests.java index 616a2d404a..5b6ff84e7a 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/tomcat/TomcatReactiveWebServerFactoryTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/tomcat/TomcatReactiveWebServerFactoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 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. @@ -242,7 +242,7 @@ class TomcatReactiveWebServerFactoryTests extends AbstractReactiveWebServerFacto } @Test - void whenServerIsShuttingDownGracefullyThenNewConnectionsCannotBeMade() throws Exception { + void whenServerIsShuttingDownGracefullyThenNewConnectionsCannotBeMade() { TomcatReactiveWebServerFactory factory = getFactory(); factory.setShutdown(Shutdown.GRACEFUL); BlockingHandler blockingHandler = new BlockingHandler(); diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/undertow/FileSessionPersistenceTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/undertow/FileSessionPersistenceTests.java index c1952a1ad1..53a4ba7bbc 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/undertow/FileSessionPersistenceTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/undertow/FileSessionPersistenceTests.java @@ -17,7 +17,6 @@ package org.springframework.boot.web.embedded.undertow; import java.io.File; -import java.io.IOException; import java.util.Date; import java.util.LinkedHashMap; import java.util.Map; @@ -45,7 +44,7 @@ class FileSessionPersistenceTests { private Date expiration = new Date(System.currentTimeMillis() + 10000); @BeforeEach - void setup(@TempDir File tempDir) throws IOException { + void setup(@TempDir File tempDir) { this.dir = tempDir; this.dir.mkdir(); this.persistence = new FileSessionPersistence(this.dir); diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/undertow/UndertowReactiveWebServerFactoryTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/undertow/UndertowReactiveWebServerFactoryTests.java index d6bb518e5d..2b0cba9e30 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/undertow/UndertowReactiveWebServerFactoryTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/undertow/UndertowReactiveWebServerFactoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 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. @@ -17,8 +17,6 @@ package org.springframework.boot.web.embedded.undertow; import java.io.File; -import java.io.IOException; -import java.net.URISyntaxException; import java.time.Duration; import java.util.Arrays; @@ -98,17 +96,17 @@ class UndertowReactiveWebServerFactoryTests extends AbstractReactiveWebServerFac } @Test - void accessLogCanBeEnabled() throws IOException, URISyntaxException, InterruptedException { + void accessLogCanBeEnabled() { testAccessLog(null, null, "access_log.log"); } @Test - void accessLogCanBeCustomized() throws IOException, URISyntaxException, InterruptedException { + void accessLogCanBeCustomized() { testAccessLog("my_access.", "logz", "my_access.logz"); } @Test - void whenServerIsShuttingDownGracefullyThenNewConnectionsAreRejectedWithServiceUnavailable() throws Exception { + void whenServerIsShuttingDownGracefullyThenNewConnectionsAreRejectedWithServiceUnavailable() { UndertowReactiveWebServerFactory factory = getFactory(); factory.setShutdown(Shutdown.GRACEFUL); BlockingHandler blockingHandler = new BlockingHandler(); @@ -130,8 +128,7 @@ class UndertowReactiveWebServerFactoryTests extends AbstractReactiveWebServerFac this.webServer.stop(); } - private void testAccessLog(String prefix, String suffix, String expectedFile) - throws IOException, URISyntaxException, InterruptedException { + private void testAccessLog(String prefix, String suffix, String expectedFile) { UndertowReactiveWebServerFactory factory = getFactory(); factory.setAccessLogEnabled(true); factory.setAccessLogPrefix(prefix); diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/undertow/UndertowServletWebServerFactoryTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/undertow/UndertowServletWebServerFactoryTests.java index ade65a43ad..e833dd92b2 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/undertow/UndertowServletWebServerFactoryTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/undertow/UndertowServletWebServerFactoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 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. @@ -177,12 +177,12 @@ class UndertowServletWebServerFactoryTests extends AbstractServletWebServerFacto } @Test - void accessLogCanBeEnabled() throws IOException, URISyntaxException, InterruptedException { + void accessLogCanBeEnabled() throws IOException, URISyntaxException { testAccessLog(null, null, "access_log.log"); } @Test - void accessLogCanBeCustomized() throws IOException, URISyntaxException, InterruptedException { + void accessLogCanBeCustomized() throws IOException, URISyntaxException { testAccessLog("my_access.", "logz", "my_access.logz"); } @@ -213,7 +213,7 @@ class UndertowServletWebServerFactoryTests extends AbstractServletWebServerFacto } private void testAccessLog(String prefix, String suffix, String expectedFile) - throws IOException, URISyntaxException, InterruptedException { + throws IOException, URISyntaxException { UndertowServletWebServerFactory factory = getFactory(); factory.setAccessLogEnabled(true); factory.setAccessLogPrefix(prefix); @@ -236,7 +236,7 @@ class UndertowServletWebServerFactoryTests extends AbstractServletWebServerFacto } @Test - void sslRestrictedProtocolsEmptyCipherFailure() throws Exception { + void sslRestrictedProtocolsEmptyCipherFailure() { assertThatIOException() .isThrownBy(() -> testRestrictedSSLProtocolsAndCipherSuites(new String[] { "TLSv1.2" }, new String[] { "TLS_EMPTY_RENEGOTIATION_INFO_SCSV" })) @@ -244,7 +244,7 @@ class UndertowServletWebServerFactoryTests extends AbstractServletWebServerFacto } @Test - void sslRestrictedProtocolsECDHETLS1Failure() throws Exception { + void sslRestrictedProtocolsECDHETLS1Failure() { assertThatIOException() .isThrownBy(() -> testRestrictedSSLProtocolsAndCipherSuites(new String[] { "TLSv1" }, new String[] { "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256" })) @@ -264,7 +264,7 @@ class UndertowServletWebServerFactoryTests extends AbstractServletWebServerFacto } @Test - void sslRestrictedProtocolsRSATLS11Failure() throws Exception { + void sslRestrictedProtocolsRSATLS11Failure() { assertThatIOException() .isThrownBy(() -> testRestrictedSSLProtocolsAndCipherSuites(new String[] { "TLSv1.1" }, new String[] { "TLS_RSA_WITH_AES_128_CBC_SHA256" })) diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/FilterRegistrationBeanTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/FilterRegistrationBeanTests.java index 2960aebbbc..e36060d0a2 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/FilterRegistrationBeanTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/FilterRegistrationBeanTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 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. @@ -66,7 +66,7 @@ class FilterRegistrationBeanTests extends AbstractFilterRegistrationBeanTests { } @Test - void setFilterMustNotBeNull() throws Exception { + void setFilterMustNotBeNull() { FilterRegistrationBean bean = new FilterRegistrationBean<>(); assertThatIllegalArgumentException().isThrownBy(() -> bean.onStartup(this.servletContext)) .withMessageContaining("Filter must not be null"); diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/ServletRegistrationBeanTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/ServletRegistrationBeanTests.java index 2d5ec9ad08..d94ef06850 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/ServletRegistrationBeanTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/ServletRegistrationBeanTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 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. @@ -129,7 +129,7 @@ class ServletRegistrationBeanTests { } @Test - void setServletMustNotBeNull() throws Exception { + void setServletMustNotBeNull() { ServletRegistrationBean bean = new ServletRegistrationBean<>(); assertThatIllegalArgumentException().isThrownBy(() -> bean.onStartup(this.servletContext)) .withMessageContaining("Servlet must not be null"); diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/WebFilterHandlerTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/WebFilterHandlerTests.java index 818fe38fbd..5174ee38ec 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/WebFilterHandlerTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/WebFilterHandlerTests.java @@ -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. @@ -128,7 +128,7 @@ class WebFilterHandlerTests { } @Test - void urlPatternsDeclaredTwice() throws IOException { + void urlPatternsDeclaredTwice() { assertThatIllegalStateException() .isThrownBy(() -> handleBeanDefinitionForClass(UrlPatternsDeclaredTwiceFilter.class)) .withMessageContaining("The urlPatterns and value attributes are mutually exclusive."); diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/WebServletHandlerTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/WebServletHandlerTests.java index 7817a4471d..8ecee00645 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/WebServletHandlerTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/WebServletHandlerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 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. @@ -103,7 +103,7 @@ class WebServletHandlerTests { } @Test - void urlPatternsDeclaredTwice() throws IOException { + void urlPatternsDeclaredTwice() { assertThatIllegalStateException() .isThrownBy(() -> handleBeanDefinitionForClass(UrlPatternsDeclaredTwiceServlet.class)) .withMessageContaining("The urlPatterns and value attributes are mutually exclusive."); diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/context/ServletWebServerApplicationContextTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/context/ServletWebServerApplicationContextTests.java index 154af24828..1ba3f1d3e0 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/context/ServletWebServerApplicationContextTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/context/ServletWebServerApplicationContextTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 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. @@ -395,7 +395,7 @@ class ServletWebServerApplicationContextTests { } @Test - void delegatingFilterProxyRegistrationBeansSkipsTargetBeanNames() throws Exception { + void delegatingFilterProxyRegistrationBeansSkipsTargetBeanNames() { addWebServerFactoryBean(); DelegatingFilterProxyRegistrationBean initializer = new DelegatingFilterProxyRegistrationBean("filterBean"); this.context.registerBeanDefinition("initializerBean", beanDefinition(initializer)); @@ -444,7 +444,7 @@ class ServletWebServerApplicationContextTests { } @Test - void servletRequestCanBeInjectedEarly(CapturedOutput output) throws Exception { + void servletRequestCanBeInjectedEarly(CapturedOutput output) { // gh-14990 int initialOutputLength = output.length(); addWebServerFactoryBean(); @@ -460,7 +460,7 @@ class ServletWebServerApplicationContextTests { } @Test - void webApplicationScopeIsRegistered() throws Exception { + void webApplicationScopeIsRegistered() { addWebServerFactoryBean(); this.context.refresh(); assertThat(this.context.getBeanFactory().getRegisteredScope(WebApplicationContext.SCOPE_APPLICATION)) diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/DocumentRootTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/DocumentRootTests.java index bbe4f49ac9..2212191c59 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/DocumentRootTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/DocumentRootTests.java @@ -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. @@ -49,7 +49,7 @@ class DocumentRootTests { } @Test - void explodedWarFileDocumentRootWhenRunningFromPackagedWar() throws Exception { + void explodedWarFileDocumentRootWhenRunningFromPackagedWar() { File codeSourceFile = new File(this.tempDir, "test.war"); File directory = this.documentRoot.getExplodedWarFileDocumentRoot(codeSourceFile); assertThat(directory).isNull(); diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-aop/src/test/java/smoketest/aop/SampleAopApplicationTests.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-aop/src/test/java/smoketest/aop/SampleAopApplicationTests.java index e2d30a30ea..3d216259a8 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-aop/src/test/java/smoketest/aop/SampleAopApplicationTests.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-aop/src/test/java/smoketest/aop/SampleAopApplicationTests.java @@ -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. @@ -53,13 +53,13 @@ class SampleAopApplicationTests { } @Test - void testDefaultSettings(CapturedOutput output) throws Exception { + void testDefaultSettings(CapturedOutput output) { SampleAopApplication.main(new String[0]); assertThat(output).contains("Hello Phil"); } @Test - void testCommandLineOverrides(CapturedOutput output) throws Exception { + void testCommandLineOverrides(CapturedOutput output) { SampleAopApplication.main(new String[] { "--name=Gordon" }); assertThat(output).contains("Hello Gordon"); } diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-integration/src/test/java/smoketest/integration/consumer/SampleIntegrationApplicationTests.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-integration/src/test/java/smoketest/integration/consumer/SampleIntegrationApplicationTests.java index 192732281c..0241aa0c5a 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-integration/src/test/java/smoketest/integration/consumer/SampleIntegrationApplicationTests.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-integration/src/test/java/smoketest/integration/consumer/SampleIntegrationApplicationTests.java @@ -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. @@ -57,7 +57,7 @@ class SampleIntegrationApplicationTests { } @Test - void testVanillaExchange(@TempDir Path temp) throws Exception { + void testVanillaExchange(@TempDir Path temp) { File inputDir = new File(temp.toFile(), "input"); File outputDir = new File(temp.toFile(), "output"); this.context = SpringApplication.run(SampleIntegrationApplication.class, "--service.input-dir=" + inputDir, @@ -68,7 +68,7 @@ class SampleIntegrationApplicationTests { } @Test - void testMessageGateway(@TempDir Path temp) throws Exception { + void testMessageGateway(@TempDir Path temp) { File inputDir = new File(temp.toFile(), "input"); File outputDir = new File(temp.toFile(), "output"); this.context = SpringApplication.run(SampleIntegrationApplication.class, "testviamg", @@ -76,7 +76,7 @@ class SampleIntegrationApplicationTests { awaitOutputContaining(this.context.getBean(ServiceProperties.class).getOutputDir(), "testviamg"); } - private void awaitOutputContaining(File outputDir, String requiredContents) throws Exception { + private void awaitOutputContaining(File outputDir, String requiredContents) { Awaitility.waitAtMost(Duration.ofSeconds(30)).until(() -> outputIn(outputDir), containsString(requiredContents)); } diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-kafka/src/test/java/smoketest/kafka/SampleKafkaApplicationTests.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-kafka/src/test/java/smoketest/kafka/SampleKafkaApplicationTests.java index 234dd0c22a..aff72ecab1 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-kafka/src/test/java/smoketest/kafka/SampleKafkaApplicationTests.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-kafka/src/test/java/smoketest/kafka/SampleKafkaApplicationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 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. @@ -44,7 +44,7 @@ class SampleKafkaApplicationTests { private Consumer consumer; @Test - void testVanillaExchange() throws Exception { + void testVanillaExchange() { Awaitility.waitAtMost(Duration.ofSeconds(30)).until(this.consumer::getMessages, not(empty())); assertThat(this.consumer.getMessages()).extracting("message").containsOnly("A simple test message"); } diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-liquibase/src/test/java/smoketest/liquibase/SampleLiquibaseApplicationTests.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-liquibase/src/test/java/smoketest/liquibase/SampleLiquibaseApplicationTests.java index f7fe459d77..14e068e3b9 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-liquibase/src/test/java/smoketest/liquibase/SampleLiquibaseApplicationTests.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-liquibase/src/test/java/smoketest/liquibase/SampleLiquibaseApplicationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 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. @@ -47,7 +47,7 @@ class SampleLiquibaseApplicationTests { } @Test - void testDefaultSettings(CapturedOutput output) throws Exception { + void testDefaultSettings(CapturedOutput output) { try { SampleLiquibaseApplication.main(new String[] { "--server.port=0" }); } diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-logback/src/test/java/smoketest/logback/SampleLogbackApplicationTests.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-logback/src/test/java/smoketest/logback/SampleLogbackApplicationTests.java index 5711d1b22d..857b339227 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-logback/src/test/java/smoketest/logback/SampleLogbackApplicationTests.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-logback/src/test/java/smoketest/logback/SampleLogbackApplicationTests.java @@ -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. @@ -28,13 +28,13 @@ import static org.assertj.core.api.Assertions.assertThat; class SampleLogbackApplicationTests { @Test - void testLoadedCustomLogbackConfig(CapturedOutput output) throws Exception { + void testLoadedCustomLogbackConfig(CapturedOutput output) { SampleLogbackApplication.main(new String[0]); assertThat(output).contains("Sample Debug Message").doesNotContain("Sample Trace Message"); } @Test - void testProfile(CapturedOutput output) throws Exception { + void testProfile(CapturedOutput output) { SampleLogbackApplication.main(new String[] { "--spring.profiles.active=staging" }); assertThat(output).contains("Sample Debug Message").contains("Sample Trace Message"); } diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-parent-context/src/test/java/smoketest/parent/consumer/SampleIntegrationParentApplicationTests.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-parent-context/src/test/java/smoketest/parent/consumer/SampleIntegrationParentApplicationTests.java index b86a674290..4fde078b59 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-parent-context/src/test/java/smoketest/parent/consumer/SampleIntegrationParentApplicationTests.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-parent-context/src/test/java/smoketest/parent/consumer/SampleIntegrationParentApplicationTests.java @@ -58,7 +58,7 @@ class SampleIntegrationParentApplicationTests { } } - private void awaitOutputContaining(File outputDir, String requiredContents) throws Exception { + private void awaitOutputContaining(File outputDir, String requiredContents) { Awaitility.waitAtMost(Duration.ofSeconds(30)).until(() -> outputIn(outputDir), containsString(requiredContents)); } diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-secure-webflux/src/test/java/smoketest/secure/webflux/ManagementPortSampleSecureWebFluxTests.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-secure-webflux/src/test/java/smoketest/secure/webflux/ManagementPortSampleSecureWebFluxTests.java index 007a79710d..e338be7593 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-secure-webflux/src/test/java/smoketest/secure/webflux/ManagementPortSampleSecureWebFluxTests.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-secure-webflux/src/test/java/smoketest/secure/webflux/ManagementPortSampleSecureWebFluxTests.java @@ -90,7 +90,7 @@ class ManagementPortSampleSecureWebFluxTests { static class SecurityConfiguration { @Bean - SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) throws Exception { + SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) { http.authorizeExchange((exchanges) -> { exchanges.matchers(EndpointRequest.to("health")).permitAll(); exchanges.matchers(EndpointRequest.toAnyEndpoint().excluding(MappingsEndpoint.class)) diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-secure-webflux/src/test/java/smoketest/secure/webflux/SampleSecureWebFluxCustomSecurityTests.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-secure-webflux/src/test/java/smoketest/secure/webflux/SampleSecureWebFluxCustomSecurityTests.java index 76d6374fe6..58ba49ad82 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-secure-webflux/src/test/java/smoketest/secure/webflux/SampleSecureWebFluxCustomSecurityTests.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-secure-webflux/src/test/java/smoketest/secure/webflux/SampleSecureWebFluxCustomSecurityTests.java @@ -114,7 +114,7 @@ class SampleSecureWebFluxCustomSecurityTests { } @Bean - SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) throws Exception { + SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) { http.authorizeExchange((exchanges) -> { exchanges.matchers(EndpointRequest.to("health")).permitAll(); exchanges.matchers(EndpointRequest.toAnyEndpoint().excluding(MappingsEndpoint.class)) diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-test-nomockito/src/test/java/smoketest/testnomockito/SampleTestNoMockitoApplicationTests.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-test-nomockito/src/test/java/smoketest/testnomockito/SampleTestNoMockitoApplicationTests.java index a80cac8505..c1acb3453c 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-test-nomockito/src/test/java/smoketest/testnomockito/SampleTestNoMockitoApplicationTests.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-test-nomockito/src/test/java/smoketest/testnomockito/SampleTestNoMockitoApplicationTests.java @@ -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. @@ -41,7 +41,7 @@ class SampleTestNoMockitoApplicationTests { private ApplicationContext context; @Test - void contextLoads() throws Exception { + void contextLoads() { assertThat(this.context).isNotNull(); } diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat/src/test/java/smoketest/tomcat/NonAutoConfigurationSampleTomcatApplicationTests.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat/src/test/java/smoketest/tomcat/NonAutoConfigurationSampleTomcatApplicationTests.java index e1e33f4fe7..921d23ac54 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat/src/test/java/smoketest/tomcat/NonAutoConfigurationSampleTomcatApplicationTests.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat/src/test/java/smoketest/tomcat/NonAutoConfigurationSampleTomcatApplicationTests.java @@ -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. @@ -50,7 +50,7 @@ class NonAutoConfigurationSampleTomcatApplicationTests { private TestRestTemplate restTemplate; @Test - void testHome() throws Exception { + void testHome() { ResponseEntity entity = this.restTemplate.getForEntity("/", String.class); assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK); assertThat(entity.getBody()).isEqualTo("Hello World"); diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-jsp/src/test/java/smoketest/jsp/SampleWebJspApplicationTests.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-jsp/src/test/java/smoketest/jsp/SampleWebJspApplicationTests.java index cbcf25e9ec..ec5327679d 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-jsp/src/test/java/smoketest/jsp/SampleWebJspApplicationTests.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-jsp/src/test/java/smoketest/jsp/SampleWebJspApplicationTests.java @@ -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. @@ -53,7 +53,7 @@ class SampleWebJspApplicationTests { } @Test - void customErrorPage() throws Exception { + void customErrorPage() { HttpHeaders headers = new HttpHeaders(); headers.setAccept(Arrays.asList(MediaType.TEXT_HTML)); RequestEntity request = new RequestEntity<>(headers, HttpMethod.GET, URI.create("/foo")); diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-xml/src/test/java/smoketest/xml/SampleSpringXmlApplicationTests.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-xml/src/test/java/smoketest/xml/SampleSpringXmlApplicationTests.java index bc50a5c3fc..f53b314e1f 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-xml/src/test/java/smoketest/xml/SampleSpringXmlApplicationTests.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-xml/src/test/java/smoketest/xml/SampleSpringXmlApplicationTests.java @@ -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. @@ -28,7 +28,7 @@ import static org.assertj.core.api.Assertions.assertThat; class SampleSpringXmlApplicationTests { @Test - void testDefaultSettings(CapturedOutput output) throws Exception { + void testDefaultSettings(CapturedOutput output) { SampleSpringXmlApplication.main(new String[0]); assertThat(output).contains("Hello World"); } diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-xml/src/test/java/smoketest/xml/SampleSpringXmlPlaceholderBeanDefinitionTests.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-xml/src/test/java/smoketest/xml/SampleSpringXmlPlaceholderBeanDefinitionTests.java index 1d5128e8c2..04bb7987d3 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-xml/src/test/java/smoketest/xml/SampleSpringXmlPlaceholderBeanDefinitionTests.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-xml/src/test/java/smoketest/xml/SampleSpringXmlPlaceholderBeanDefinitionTests.java @@ -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. @@ -41,7 +41,7 @@ import static org.assertj.core.api.Assertions.assertThat; class SampleSpringXmlPlaceholderBeanDefinitionTests { @Test - void beanWithPlaceholderShouldNotFail(CapturedOutput output) throws Exception { + void beanWithPlaceholderShouldNotFail(CapturedOutput output) { assertThat(output).contains("Hello Other World"); }