Skip to content

Commit c04d4da

Browse files
committed
Polish
1 parent b737f36 commit c04d4da

File tree

5 files changed

+11
-33
lines changed

5 files changed

+11
-33
lines changed

spring-test/src/test/java/org/springframework/test/web/client/match/MockRestRequestMatchersTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ void headerListContainsMismatch() {
210210
}
211211

212212
@Test
213-
void headerListDoesntHideHeaderWithSingleMatcher() throws IOException {
213+
void headerListDoesNotHideHeaderWithSingleMatcher() throws IOException {
214214
this.request.getHeaders().put("foo", List.of("bar", "baz"));
215215

216216
MockRestRequestMatchers.header("foo", equalTo("bar")).match(this.request);
@@ -340,7 +340,7 @@ void queryParamListContainsMismatch() {
340340
}
341341

342342
@Test
343-
void queryParamListDoesntHideQueryParamWithSingleMatcher() throws IOException {
343+
void queryParamListDoesNotHideQueryParamWithSingleMatcher() throws IOException {
344344
this.request.setURI(URI.create("http://www.foo.example/a?foo=bar&foo=baz"));
345345

346346
MockRestRequestMatchers.queryParam("foo", equalTo("bar")).match(this.request);

spring-test/src/test/java/org/springframework/test/web/servlet/request/MockHttpServletRequestBuilderTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ private static RequestAttributePostProcessor requestAttr(String attrName) {
596596
}
597597

598598

599-
private final class User implements Principal {
599+
private static final class User implements Principal {
600600

601601
@Override
602602
public String getName() {

spring-test/src/test/java/org/springframework/test/web/servlet/result/FlashAttributeResultMatchersTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public void attributeExists() throws Exception {
3434
}
3535

3636
@Test
37-
public void attributeExists_doesntExist() {
37+
public void attributeExists_DoesNotExist() {
3838
assertThatExceptionOfType(AssertionError.class).isThrownBy(() ->
3939
new FlashAttributeResultMatchers().attributeExists("bad").match(getStubMvcResult()));
4040
}

spring-test/src/test/java/org/springframework/test/web/servlet/samples/spr/ControllerAdviceIntegrationTests.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -138,7 +138,7 @@ static class SingletonControllerAdvice {
138138
static final AtomicInteger instanceCount = new AtomicInteger();
139139
static final AtomicInteger invocationCount = new AtomicInteger();
140140

141-
{
141+
SingletonControllerAdvice() {
142142
instanceCount.incrementAndGet();
143143
}
144144

@@ -154,7 +154,7 @@ static class PrototypeControllerAdvice {
154154
static final AtomicInteger instanceCount = new AtomicInteger();
155155
static final AtomicInteger invocationCount = new AtomicInteger();
156156

157-
{
157+
PrototypeControllerAdvice() {
158158
instanceCount.incrementAndGet();
159159
}
160160

@@ -170,7 +170,7 @@ static class RequestScopedControllerAdvice {
170170
static final AtomicInteger instanceCount = new AtomicInteger();
171171
static final AtomicInteger invocationCount = new AtomicInteger();
172172

173-
{
173+
RequestScopedControllerAdvice() {
174174
instanceCount.incrementAndGet();
175175
}
176176

spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/ExceptionHandlerTests.java

+3-25
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -184,30 +184,8 @@ Error handleException(Throwable exception) {
184184
}
185185
}
186186

187-
static class Person {
187+
record Person(String name) {}
188188

189-
private final String name;
190-
191-
Person(String name) {
192-
this.name = name;
193-
}
194-
195-
public String getName() {
196-
return name;
197-
}
198-
}
199-
200-
static class Error {
201-
202-
private final String error;
203-
204-
Error(String error) {
205-
this.error = error;
206-
}
207-
208-
public String getError() {
209-
return error;
210-
}
211-
}
189+
record Error(String error) {}
212190

213191
}

0 commit comments

Comments
 (0)