Skip to content

Commit 8eedfdf

Browse files
committed
Polishing
1 parent 64de254 commit 8eedfdf

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

spring-test/src/test/java/org/springframework/test/context/TestExecutionListenersTests.java

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
import org.springframework.test.context.web.ServletTestExecutionListener;
4040
import org.springframework.util.ClassUtils;
4141

42-
import static java.util.Arrays.asList;
4342
import static java.util.stream.Collectors.toList;
4443
import static org.assertj.core.api.Assertions.assertThat;
4544
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
@@ -65,7 +64,8 @@ class TestExecutionListenersTests {
6564

6665
@Test
6766
void defaultListeners() {
68-
List<Class<?>> expected = asList(ServletTestExecutionListener.class,//
67+
List<Class<?>> expected = List.of(//
68+
ServletTestExecutionListener.class,//
6969
DirtiesContextBeforeModesTestExecutionListener.class,//
7070
ApplicationEventsTestExecutionListener.class,//
7171
BeanOverrideTestExecutionListener.class,//
@@ -86,7 +86,8 @@ void defaultListeners() {
8686
*/
8787
@Test
8888
void defaultListenersMergedWithCustomListenerPrepended() {
89-
List<Class<?>> expected = asList(QuuxTestExecutionListener.class,//
89+
List<Class<?>> expected = List.of(//
90+
QuuxTestExecutionListener.class,//
9091
ServletTestExecutionListener.class,//
9192
DirtiesContextBeforeModesTestExecutionListener.class,//
9293
ApplicationEventsTestExecutionListener.class,//
@@ -108,7 +109,8 @@ void defaultListenersMergedWithCustomListenerPrepended() {
108109
*/
109110
@Test
110111
void defaultListenersMergedWithCustomListenerAppended() {
111-
List<Class<?>> expected = asList(ServletTestExecutionListener.class,//
112+
List<Class<?>> expected = List.of(//
113+
ServletTestExecutionListener.class,//
112114
DirtiesContextBeforeModesTestExecutionListener.class,//
113115
ApplicationEventsTestExecutionListener.class,//
114116
BeanOverrideTestExecutionListener.class,//
@@ -120,7 +122,7 @@ void defaultListenersMergedWithCustomListenerAppended() {
120122
SqlScriptsTestExecutionListener.class,//
121123
EventPublishingTestExecutionListener.class,//
122124
MockitoResetTestExecutionListener.class,//
123-
BazTestExecutionListener.class
125+
BazTestExecutionListener.class//
124126
);
125127
assertRegisteredListeners(MergedDefaultListenersWithCustomListenerAppendedTestCase.class, expected);
126128
}
@@ -130,7 +132,8 @@ void defaultListenersMergedWithCustomListenerAppended() {
130132
*/
131133
@Test
132134
void defaultListenersMergedWithCustomListenerInserted() {
133-
List<Class<?>> expected = asList(ServletTestExecutionListener.class,//
135+
List<Class<?>> expected = List.of(//
136+
ServletTestExecutionListener.class,//
134137
DirtiesContextBeforeModesTestExecutionListener.class,//
135138
ApplicationEventsTestExecutionListener.class,//
136139
BeanOverrideTestExecutionListener.class,//
@@ -157,7 +160,7 @@ void inheritedDefaultListeners() {
157160
assertRegisteredListeners(InheritedDefaultListenersTestCase.class, List.of(QuuxTestExecutionListener.class));
158161
assertRegisteredListeners(SubInheritedDefaultListenersTestCase.class, List.of(QuuxTestExecutionListener.class));
159162
assertRegisteredListeners(SubSubInheritedDefaultListenersTestCase.class,
160-
asList(QuuxTestExecutionListener.class, EnigmaTestExecutionListener.class));
163+
List.of(QuuxTestExecutionListener.class, EnigmaTestExecutionListener.class));
161164
}
162165

163166
@Test
@@ -168,7 +171,7 @@ void customListeners() {
168171
@Test
169172
void customListenersDeclaredOnInterface() {
170173
assertRegisteredListeners(ExplicitListenersOnTestInterfaceTestCase.class,
171-
asList(FooTestExecutionListener.class, BarTestExecutionListener.class));
174+
List.of(FooTestExecutionListener.class, BarTestExecutionListener.class));
172175
}
173176

174177
@Test

0 commit comments

Comments
 (0)