diff --git a/framework-docs/src/docs/asciidoc/web/webmvc.adoc b/framework-docs/src/docs/asciidoc/web/webmvc.adoc index 5394618902b6..b34994e64857 100644 --- a/framework-docs/src/docs/asciidoc/web/webmvc.adoc +++ b/framework-docs/src/docs/asciidoc/web/webmvc.adoc @@ -4777,7 +4777,7 @@ directly. For example: ContextSnapshot snapshot = ContextSnapshot.captureAll(); // On a different thread: restore ThreadLocal values - try (ContextSnapshot.Scope scoped = snapshot.setThreadLocals()) { + try (ContextSnapshot.Scope scope = snapshot.setThreadLocals()) { // ... } ---- diff --git a/spring-context/src/test/kotlin/org/springframework/context/aot/KotlinReflectionBeanRegistrationAotProcessorTests.kt b/spring-context/src/test/kotlin/org/springframework/context/aot/KotlinReflectionBeanRegistrationAotProcessorTests.kt index ce3988c61410..62331824dfae 100644 --- a/spring-context/src/test/kotlin/org/springframework/context/aot/KotlinReflectionBeanRegistrationAotProcessorTests.kt +++ b/spring-context/src/test/kotlin/org/springframework/context/aot/KotlinReflectionBeanRegistrationAotProcessorTests.kt @@ -16,10 +16,9 @@ package org.springframework.context.aot -import org.assertj.core.api.Assertions +import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test import org.mockito.Mockito -import org.springframework.aot.generate.GenerationContext import org.springframework.aot.hint.MemberCategory import org.springframework.aot.hint.predicate.RuntimeHintsPredicates import org.springframework.aot.test.generate.TestGenerationContext @@ -41,7 +40,7 @@ class KotlinReflectionBeanRegistrationAotProcessorTests { @Test fun processorIsRegistered() { - Assertions.assertThat( + assertThat( AotServices.factories(javaClass.classLoader).load(BeanRegistrationAotProcessor::class.java)) .anyMatch(KotlinReflectionBeanRegistrationAotProcessor::class.java::isInstance) } @@ -49,12 +48,12 @@ class KotlinReflectionBeanRegistrationAotProcessorTests { @Test fun shouldProcessKotlinBean() { process(SampleKotlinBean::class.java) - Assertions.assertThat( + assertThat( RuntimeHintsPredicates.reflection() .onType(SampleKotlinBean::class.java) .withMemberCategory(MemberCategory.INTROSPECT_DECLARED_METHODS) ).accepts(generationContext.runtimeHints) - Assertions.assertThat( + assertThat( RuntimeHintsPredicates.reflection() .onType(BaseKotlinBean::class.java) .withMemberCategory(MemberCategory.INTROSPECT_DECLARED_METHODS) @@ -64,7 +63,7 @@ class KotlinReflectionBeanRegistrationAotProcessorTests { @Test fun shouldNotProcessJavaBean() { process(SampleJavaBean::class.java) - Assertions.assertThat(generationContext.runtimeHints.reflection().typeHints()).isEmpty() + assertThat(generationContext.runtimeHints.reflection().typeHints()).isEmpty() } private fun process(beanClass: Class<*>) { diff --git a/spring-context/src/test/kotlin/org/springframework/validation/beanvalidation/KotlinMethodValidationTests.kt b/spring-context/src/test/kotlin/org/springframework/validation/beanvalidation/KotlinMethodValidationTests.kt index ba3b6f93f500..17991c97f2fa 100644 --- a/spring-context/src/test/kotlin/org/springframework/validation/beanvalidation/KotlinMethodValidationTests.kt +++ b/spring-context/src/test/kotlin/org/springframework/validation/beanvalidation/KotlinMethodValidationTests.kt @@ -20,7 +20,8 @@ import jakarta.validation.ValidationException import jakarta.validation.Validator import jakarta.validation.constraints.NotEmpty import kotlinx.coroutines.runBlocking -import org.assertj.core.api.Assertions +import org.assertj.core.api.Assertions.assertThat +import org.assertj.core.api.Assertions.assertThatExceptionOfType import org.junit.jupiter.api.Test import org.springframework.aop.framework.ProxyFactory import org.springframework.validation.annotation.Validated @@ -41,8 +42,8 @@ class KotlinMethodValidationTests { validator.afterPropertiesSet() proxyFactory.addAdvice(MethodValidationInterceptor(validator as Validator)) val proxy = proxyFactory.getProxy() as MyValidBean - Assertions.assertThat(proxy.validName("name")).isEqualTo("name") - Assertions.assertThatExceptionOfType(ValidationException::class.java).isThrownBy { + assertThat(proxy.validName("name")).isEqualTo("name") + assertThatExceptionOfType(ValidationException::class.java).isThrownBy { proxy.validName("") } } @@ -55,8 +56,8 @@ class KotlinMethodValidationTests { validator.afterPropertiesSet() proxyFactory.addAdvice(MethodValidationInterceptor(validator as Validator)) val proxy = proxyFactory.getProxy() as MyValidCoroutinesBean - Assertions.assertThat(proxy.validName("name")).isEqualTo("name") - Assertions.assertThatExceptionOfType(ValidationException::class.java).isThrownBy { + assertThat(proxy.validName("name")).isEqualTo("name") + assertThatExceptionOfType(ValidationException::class.java).isThrownBy { runBlocking { proxy.validName("") } diff --git a/spring-core/src/main/java/org/springframework/cglib/core/TinyBitSet.java b/spring-core/src/main/java/org/springframework/cglib/core/TinyBitSet.java index 52a273fd3483..f8fee66b5b60 100644 --- a/spring-core/src/main/java/org/springframework/cglib/core/TinyBitSet.java +++ b/spring-core/src/main/java/org/springframework/cglib/core/TinyBitSet.java @@ -17,7 +17,7 @@ @Deprecated public class TinyBitSet { - private static int[] T = new int[256]; + private static final int[] T = new int[256]; private int value = 0; private static int gcount(int x) { diff --git a/spring-core/src/main/java/org/springframework/core/annotation/RepeatableContainers.java b/spring-core/src/main/java/org/springframework/core/annotation/RepeatableContainers.java index 783cf28c9862..dcdbf03f3d90 100644 --- a/spring-core/src/main/java/org/springframework/core/annotation/RepeatableContainers.java +++ b/spring-core/src/main/java/org/springframework/core/annotation/RepeatableContainers.java @@ -145,7 +145,7 @@ private static class StandardRepeatableContainers extends RepeatableContainers { private static final Object NONE = new Object(); - private static StandardRepeatableContainers INSTANCE = new StandardRepeatableContainers(); + private static final StandardRepeatableContainers INSTANCE = new StandardRepeatableContainers(); StandardRepeatableContainers() { super(null); @@ -270,7 +270,7 @@ public int hashCode() { */ private static class NoRepeatableContainers extends RepeatableContainers { - private static NoRepeatableContainers INSTANCE = new NoRepeatableContainers(); + private static final NoRepeatableContainers INSTANCE = new NoRepeatableContainers(); NoRepeatableContainers() { super(null); diff --git a/spring-core/src/main/java/org/springframework/core/codec/ResourceDecoder.java b/spring-core/src/main/java/org/springframework/core/codec/ResourceDecoder.java index 4e9552a650a0..b1e664df003f 100644 --- a/spring-core/src/main/java/org/springframework/core/codec/ResourceDecoder.java +++ b/spring-core/src/main/java/org/springframework/core/codec/ResourceDecoder.java @@ -42,7 +42,7 @@ public class ResourceDecoder extends AbstractDataBufferDecoder { /** Name of hint with a filename for the resource(e.g. from "Content-Disposition" HTTP header). */ - public static String FILENAME_HINT = ResourceDecoder.class.getName() + ".filename"; + public static final String FILENAME_HINT = ResourceDecoder.class.getName() + ".filename"; public ResourceDecoder() { diff --git a/spring-core/src/main/java/org/springframework/core/io/support/PathMatchingResourcePatternResolver.java b/spring-core/src/main/java/org/springframework/core/io/support/PathMatchingResourcePatternResolver.java index 59676b52a24a..e4dec3c88f5b 100644 --- a/spring-core/src/main/java/org/springframework/core/io/support/PathMatchingResourcePatternResolver.java +++ b/spring-core/src/main/java/org/springframework/core/io/support/PathMatchingResourcePatternResolver.java @@ -897,9 +897,9 @@ private Resource findResource(ModuleReader moduleReader, String name) { } /** - * If it's a "file:" URI, use FileSystemResource to avoid duplicates - * for the same path discovered via class-path scanning. - */ + * If it's a "file:" URI, use FileSystemResource to avoid duplicates + * for the same path discovered via class-path scanning. + */ private Resource convertModuleSystemURI(URI uri) { return (ResourceUtils.URL_PROTOCOL_FILE.equals(uri.getScheme()) ? new FileSystemResource(uri.getPath()) : UrlResource.from(uri)); diff --git a/spring-core/src/main/kotlin/org/springframework/aot/hint/TypeHintExtensions.kt b/spring-core/src/main/kotlin/org/springframework/aot/hint/TypeHintExtensions.kt index e666ae8b7240..9d5b3006126a 100644 --- a/spring-core/src/main/kotlin/org/springframework/aot/hint/TypeHintExtensions.kt +++ b/spring-core/src/main/kotlin/org/springframework/aot/hint/TypeHintExtensions.kt @@ -17,7 +17,7 @@ package org.springframework.aot.hint /** - * Extension for [TypeHint.Builder.onReachableType] providing a `onReachableType())` + * Extension for [TypeHint.Builder.onReachableType] providing a `onReachableType()` * variant. * * @author Sebastien Deleuze diff --git a/spring-core/src/test/kotlin/org/springframework/aot/hint/ResourceHintsExtensionsTests.kt b/spring-core/src/test/kotlin/org/springframework/aot/hint/ResourceHintsExtensionsTests.kt index b530760f73df..8dcf832f899c 100644 --- a/spring-core/src/test/kotlin/org/springframework/aot/hint/ResourceHintsExtensionsTests.kt +++ b/spring-core/src/test/kotlin/org/springframework/aot/hint/ResourceHintsExtensionsTests.kt @@ -32,7 +32,7 @@ class ResourceHintsExtensionsTests { private val resourceHints = mockk() @Test - fun `registerType extension with MemberCategory`() { + fun `registerType extension`() { every { resourceHints.registerType(any>()) } returns resourceHints resourceHints.registerType() verify { resourceHints.registerType(String::class.java) } diff --git a/spring-r2dbc/src/test/java/org/springframework/r2dbc/connection/R2dbcTransactionManagerUnitTests.java b/spring-r2dbc/src/test/java/org/springframework/r2dbc/connection/R2dbcTransactionManagerUnitTests.java index 7247afe9d2ac..62858154e03e 100644 --- a/spring-r2dbc/src/test/java/org/springframework/r2dbc/connection/R2dbcTransactionManagerUnitTests.java +++ b/spring-r2dbc/src/test/java/org/springframework/r2dbc/connection/R2dbcTransactionManagerUnitTests.java @@ -25,7 +25,6 @@ import io.r2dbc.spi.R2dbcBadGrammarException; import io.r2dbc.spi.R2dbcTimeoutException; import io.r2dbc.spi.Statement; -import org.assertj.core.api.Assertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.ArgumentCaptor; @@ -345,7 +344,7 @@ void testConnectionReleasedWhenRollbackFails() { .doOnNext(connection -> { throw new IllegalStateException("Intentional error to trigger rollback"); }).then()).as(StepVerifier::create) - .verifyErrorSatisfies(e -> Assertions.assertThat(e) + .verifyErrorSatisfies(e -> assertThat(e) .isInstanceOf(BadSqlGrammarException.class) .hasCause(new R2dbcBadGrammarException("Rollback should fail")) ); diff --git a/spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/MockMvcWebConnection.java b/spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/MockMvcWebConnection.java index db473dec9f35..a3177d2fdcbc 100644 --- a/spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/MockMvcWebConnection.java +++ b/spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/MockMvcWebConnection.java @@ -68,7 +68,7 @@ public final class MockMvcWebConnection implements WebConnection { private WebClient webClient; - private static int MAX_FORWARDS = 100; + private static final int MAX_FORWARDS = 100; /** @@ -143,7 +143,7 @@ public WebResponse getResponse(WebRequest webRequest) throws IOException { forwards += 1; } if (forwards == MAX_FORWARDS) { - throw new IllegalStateException("Forwarded more than " + forwards + " times in a row, potential infinite forward loop"); + throw new IllegalStateException("Forwarded " + forwards + " times in a row, potential infinite forward loop"); } storeCookies(webRequest, httpServletResponse.getCookies()); diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/MockMvcWebConnectionTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/MockMvcWebConnectionTests.java index cca4bfa2e0e9..d370005b8cca 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/MockMvcWebConnectionTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/MockMvcWebConnectionTests.java @@ -85,7 +85,7 @@ public void forward() throws IOException { public void infiniteForward() { this.webClient.setWebConnection(new MockMvcWebConnection(this.mockMvc, this.webClient, "")); assertThatIllegalStateException().isThrownBy(() -> this.webClient.getPage("http://localhost/infiniteForward")) - .withMessage("Forwarded more than 100 times in a row, potential infinite forward loop"); + .withMessage("Forwarded 100 times in a row, potential infinite forward loop"); } @Test diff --git a/spring-web/src/main/java/org/springframework/http/converter/json/Jackson2ObjectMapperBuilder.java b/spring-web/src/main/java/org/springframework/http/converter/json/Jackson2ObjectMapperBuilder.java index 4c2fc199fe8e..04a23d6eab40 100644 --- a/spring-web/src/main/java/org/springframework/http/converter/json/Jackson2ObjectMapperBuilder.java +++ b/spring-web/src/main/java/org/springframework/http/converter/json/Jackson2ObjectMapperBuilder.java @@ -99,7 +99,7 @@ */ public class Jackson2ObjectMapperBuilder { - private static boolean jackson2XmlPresent = ClassUtils.isPresent( + private static final boolean jackson2XmlPresent = ClassUtils.isPresent( "com.fasterxml.jackson.dataformat.xml.XmlMapper", Jackson2ObjectMapperBuilder.class.getClassLoader()); diff --git a/spring-web/src/test/java/org/springframework/http/ResponseEntityTests.java b/spring-web/src/test/java/org/springframework/http/ResponseEntityTests.java index 7a0d51b4f088..2db6ee90af95 100644 --- a/spring-web/src/test/java/org/springframework/http/ResponseEntityTests.java +++ b/spring-web/src/test/java/org/springframework/http/ResponseEntityTests.java @@ -17,7 +17,6 @@ package org.springframework.http; import java.net.URI; -import java.util.List; import java.util.Optional; import java.util.concurrent.TimeUnit; @@ -46,11 +45,8 @@ void normal() { assertThat(responseEntity).isNotNull(); assertThat(responseEntity.getStatusCode()).isEqualTo(HttpStatus.OK); assertThat(responseEntity.getHeaders().containsKey(headerName)).isTrue(); - List list = responseEntity.getHeaders().get(headerName); - assertThat(list).hasSize(2); - assertThat(list.get(0)).isEqualTo(headerValue1); - assertThat(list.get(1)).isEqualTo(headerValue2); - assertThat((int) responseEntity.getBody()).isEqualTo((int) entity); + assertThat(responseEntity.getHeaders().get(headerName)).containsExactly(headerValue1, headerValue2); + assertThat(responseEntity.getBody()).isEqualTo(entity); } @Test @@ -69,7 +65,7 @@ void okEntity() { assertThat(responseEntity).isNotNull(); assertThat(responseEntity.getStatusCode()).isEqualTo(HttpStatus.OK); - assertThat((int) responseEntity.getBody()).isEqualTo((int) entity); + assertThat(responseEntity.getBody()).isEqualTo(entity); } @Test @@ -79,7 +75,7 @@ void ofOptional() { assertThat(responseEntity).isNotNull(); assertThat(responseEntity.getStatusCode()).isEqualTo(HttpStatus.OK); - assertThat((int) responseEntity.getBody()).isEqualTo((int) entity); + assertThat(responseEntity.getBody()).isEqualTo(entity); } @Test @@ -98,7 +94,7 @@ void ofNullable() { assertThat(responseEntity).isNotNull(); assertThat(responseEntity.getStatusCode()).isEqualTo(HttpStatus.OK); - assertThat((int) responseEntity.getBody()).isEqualTo((int) entity); + assertThat(responseEntity.getBody()).isEqualTo(entity); } @Test @@ -270,7 +266,7 @@ void emptyCacheControl() { assertThat(responseEntity).isNotNull(); assertThat(responseEntity.getStatusCode()).isEqualTo(HttpStatus.OK); assertThat(responseEntity.getHeaders().containsKey(HttpHeaders.CACHE_CONTROL)).isFalse(); - assertThat((int) responseEntity.getBody()).isEqualTo((int) entity); + assertThat(responseEntity.getBody()).isEqualTo(entity); } @Test @@ -286,7 +282,7 @@ void cacheControl() { assertThat(responseEntity).isNotNull(); assertThat(responseEntity.getStatusCode()).isEqualTo(HttpStatus.OK); assertThat(responseEntity.getHeaders().containsKey(HttpHeaders.CACHE_CONTROL)).isTrue(); - assertThat((int) responseEntity.getBody()).isEqualTo((int) entity); + assertThat(responseEntity.getBody()).isEqualTo(entity); String cacheControlHeader = responseEntity.getHeaders().getCacheControl(); assertThat(cacheControlHeader).isEqualTo( "max-age=3600, must-revalidate, private, proxy-revalidate, s-maxage=1800"); @@ -304,7 +300,7 @@ void cacheControlNoCache() { assertThat(responseEntity).isNotNull(); assertThat(responseEntity.getStatusCode()).isEqualTo(HttpStatus.OK); assertThat(responseEntity.getHeaders().containsKey(HttpHeaders.CACHE_CONTROL)).isTrue(); - assertThat((int) responseEntity.getBody()).isEqualTo((int) entity); + assertThat(responseEntity.getBody()).isEqualTo(entity); String cacheControlHeader = responseEntity.getHeaders().getCacheControl(); assertThat(cacheControlHeader).isEqualTo("no-store"); @@ -316,7 +312,7 @@ void statusCodeAsInt() { ResponseEntity responseEntity = ResponseEntity.status(200).body(entity); assertThat(responseEntity.getStatusCode().value()).isEqualTo(200); - assertThat((int) responseEntity.getBody()).isEqualTo((int) entity); + assertThat(responseEntity.getBody()).isEqualTo(entity); } @Test @@ -326,7 +322,7 @@ void customStatusCode() { ResponseEntity responseEntity = ResponseEntity.status(299).body(entity); assertThat(responseEntity.getStatusCodeValue()).isEqualTo(299); - assertThat((int) responseEntity.getBody()).isEqualTo((int) entity); + assertThat(responseEntity.getBody()).isEqualTo(entity); } } diff --git a/spring-web/src/test/kotlin/org/springframework/web/method/annotation/ModelAttributeMethodProcessorKotlinTests.kt b/spring-web/src/test/kotlin/org/springframework/web/method/annotation/ModelAttributeMethodProcessorKotlinTests.kt index c080e370da37..b088360ee608 100644 --- a/spring-web/src/test/kotlin/org/springframework/web/method/annotation/ModelAttributeMethodProcessorKotlinTests.kt +++ b/spring-web/src/test/kotlin/org/springframework/web/method/annotation/ModelAttributeMethodProcessorKotlinTests.kt @@ -16,7 +16,8 @@ package org.springframework.web.method.annotation -import org.assertj.core.api.Assertions +import org.assertj.core.api.Assertions.assertThat +import org.assertj.core.api.Assertions.assertThatThrownBy import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.mockito.ArgumentMatchers.* @@ -61,7 +62,7 @@ class ModelAttributeMethodProcessorKotlinTests { val factory = Mockito.mock() BDDMockito.given(factory.createBinder(any(), any(), eq("param"))) .willAnswer { WebRequestDataBinder(it.getArgument(1)) } - Assertions.assertThat(processor.resolveArgument(this.param, container, requestWithParam, factory)).isEqualTo(Param("b")) + assertThat(processor.resolveArgument(this.param, container, requestWithParam, factory)).isEqualTo(Param("b")) } @Test @@ -71,7 +72,7 @@ class ModelAttributeMethodProcessorKotlinTests { val factory = Mockito.mock() BDDMockito.given(factory.createBinder(any(), any(), eq("param"))) .willAnswer { WebRequestDataBinder(it.getArgument(1)) } - Assertions.assertThatThrownBy { + assertThatThrownBy { processor.resolveArgument(this.param, container, requestWithParam, factory) }.isInstanceOf(MethodArgumentNotValidException::class.java) .hasMessageContaining("parameter a") diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/DefaultClientRequestObservationConvention.java b/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/DefaultClientRequestObservationConvention.java index bacaba388a4a..24f362f30c28 100644 --- a/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/DefaultClientRequestObservationConvention.java +++ b/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/DefaultClientRequestObservationConvention.java @@ -45,6 +45,8 @@ public class DefaultClientRequestObservationConvention implements ClientRequestO private static final KeyValue URI_NONE = KeyValue.of(LowCardinalityKeyNames.URI, KeyValue.NONE_VALUE); + private static final KeyValue URI_ROOT = KeyValue.of(LowCardinalityKeyNames.URI, ROOT_PATH); + private static final KeyValue METHOD_NONE = KeyValue.of(LowCardinalityKeyNames.METHOD, KeyValue.NONE_VALUE); private static final KeyValue STATUS_IO_ERROR = KeyValue.of(LowCardinalityKeyNames.STATUS, "IO_ERROR"); @@ -101,7 +103,7 @@ protected KeyValue uri(ClientRequestObservationContext context) { } ClientRequest request = context.getRequest(); if (request != null && ROOT_PATH.equals(request.url().getPath())) { - return KeyValue.of(LowCardinalityKeyNames.URI, ROOT_PATH); + return URI_ROOT; } return URI_NONE; } diff --git a/spring-webflux/src/test/kotlin/org/springframework/web/reactive/function/client/support/KotlinWebClientHttpServiceProxyTests.kt b/spring-webflux/src/test/kotlin/org/springframework/web/reactive/function/client/support/KotlinWebClientHttpServiceProxyTests.kt index 0b6f36e072b3..6be4d626f379 100644 --- a/spring-webflux/src/test/kotlin/org/springframework/web/reactive/function/client/support/KotlinWebClientHttpServiceProxyTests.kt +++ b/spring-webflux/src/test/kotlin/org/springframework/web/reactive/function/client/support/KotlinWebClientHttpServiceProxyTests.kt @@ -18,7 +18,7 @@ package org.springframework.web.reactive.function.client.support import kotlinx.coroutines.runBlocking import okhttp3.mockwebserver.MockResponse import okhttp3.mockwebserver.MockWebServer -import org.assertj.core.api.Assertions +import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.AfterEach import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test @@ -66,7 +66,7 @@ class KotlinWebClientHttpServiceProxyTests { } runBlocking { val greeting = initHttpService().getGreetingSuspending() - Assertions.assertThat(greeting).isEqualTo("Hello Spring!") + assertThat(greeting).isEqualTo("Hello Spring!") } } @@ -93,7 +93,7 @@ class KotlinWebClientHttpServiceProxyTests { ).setBody("Hello Spring!") } val greeting = initHttpService().getGreetingBlocking() - Assertions.assertThat(greeting).isEqualTo("Hello Spring!") + assertThat(greeting).isEqualTo("Hello Spring!") } @Test @@ -115,8 +115,8 @@ class KotlinWebClientHttpServiceProxyTests { val service = initHttpService(webClient) runBlocking { val greeting = service.getGreetingSuspendingWithAttribute("myAttributeValue") - Assertions.assertThat(greeting).isEqualTo("Hello Spring!") - Assertions.assertThat(attributes).containsEntry("myAttribute", "myAttributeValue") + assertThat(greeting).isEqualTo("Hello Spring!") + assertThat(attributes).containsEntry("myAttribute", "myAttributeValue") } } diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/RequestMappingInfoHandlerMappingTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/RequestMappingInfoHandlerMappingTests.java index 590ef9060ad4..1f640ebb3ee9 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/RequestMappingInfoHandlerMappingTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/RequestMappingInfoHandlerMappingTests.java @@ -177,7 +177,7 @@ void getHandlerMediaTypeNotSupported(TestRequestMappingInfoHandlerMapping mappin } @PathPatternsParameterizedTest // gh-28062 - void getHandlerMethodTypeNotSupportedWithParseError(TestRequestMappingInfoHandlerMapping mapping) { + void getHandlerMediaTypeNotSupportedWithParseError(TestRequestMappingInfoHandlerMapping mapping) { MockHttpServletRequest request = new MockHttpServletRequest("PUT", "/person/1"); request.setContentType("This string"); assertThatExceptionOfType(HttpMediaTypeNotSupportedException.class)