From ea52ecc5e08a14869ec351af38481c4008c8bcd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Nicoll?= Date: Fri, 2 Feb 2024 18:56:41 +0100 Subject: [PATCH] Polish --- .../standalone/ExceptionHandlerTests.java | 26 ++----------------- ...stAttributesRequestContextHolderTests.java | 4 +-- 2 files changed, 4 insertions(+), 26 deletions(-) diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/ExceptionHandlerTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/ExceptionHandlerTests.java index 2593bc1e824..7e8d99405e0 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/ExceptionHandlerTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/client/standalone/ExceptionHandlerTests.java @@ -205,30 +205,8 @@ class ExceptionHandlerTests { } } - static class Person { + record Person(String name) {} - private final String name; - - Person(String name) { - this.name = name; - } - - public String getName() { - return name; - } - } - - static class Error { - - private final String error; - - Error(String error) { - this.error = error; - } - - public String getError() { - return error; - } - } + record Error(String error) {} } diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/spr/CustomRequestAttributesRequestContextHolderTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/spr/CustomRequestAttributesRequestContextHolderTests.java index e9aa203f394..1059beffacf 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/spr/CustomRequestAttributesRequestContextHolderTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/spr/CustomRequestAttributesRequestContextHolderTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 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. @@ -108,7 +108,7 @@ public class CustomRequestAttributesRequestContextHolderTests { static class WebConfig implements WebMvcConfigurer { @Bean - public SingletonController singletonController() { + SingletonController singletonController() { return new SingletonController(); } }