Skip to content

Commit 755fd75

Browse files
committed
Merge pull request #31694 from quaff
* pr/31694: Upgrade copyright year of changed file Use AssertJ isInstanceOf where feasible Closes gh-31694
2 parents 4e2d357 + f8a4055 commit 755fd75

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

spring-context/src/test/java/org/springframework/context/support/ConversionServiceFactoryBeanTests.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,14 +117,14 @@ void conversionServiceInApplicationContextWithResourceOverriding() {
117117
private void doTestConversionServiceInApplicationContext(String fileName, Class<?> resourceClass) {
118118
ConfigurableApplicationContext ctx = new ClassPathXmlApplicationContext(fileName, getClass());
119119
ResourceTestBean tb = ctx.getBean("resourceTestBean", ResourceTestBean.class);
120-
assertThat(resourceClass.isInstance(tb.getResource())).isTrue();
120+
assertThat(tb.getResource()).isInstanceOf(resourceClass);
121121
assertThat(tb.getResourceArray()).hasSize(1);
122-
assertThat(resourceClass.isInstance(tb.getResourceArray()[0])).isTrue();
122+
assertThat(tb.getResourceArray()[0]).isInstanceOf(resourceClass);
123123
assertThat(tb.getResourceMap()).hasSize(1);
124-
assertThat(resourceClass.isInstance(tb.getResourceMap().get("key1"))).isTrue();
124+
assertThat(tb.getResourceMap().get("key1")).isInstanceOf(resourceClass);
125125
assertThat(tb.getResourceArrayMap()).hasSize(1);
126126
assertThat(tb.getResourceArrayMap().get("key1")).isNotEmpty();
127-
assertThat(resourceClass.isInstance(tb.getResourceArrayMap().get("key1")[0])).isTrue();
127+
assertThat(tb.getResourceArrayMap().get("key1")[0]).isInstanceOf(resourceClass);
128128
ctx.close();
129129
}
130130

spring-websocket/src/test/java/org/springframework/web/socket/config/HandlersBeanDefinitionParserTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2023 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.
@@ -243,7 +243,7 @@ private static void unwrapAndCheckDecoratedHandlerType(WebSocketHandler handler,
243243
if (handler instanceof WebSocketHandlerDecorator) {
244244
handler = ((WebSocketHandlerDecorator) handler).getLastHandler();
245245
}
246-
assertThat(handlerClass.isInstance(handler)).isTrue();
246+
assertThat(handler).isInstanceOf(handlerClass);
247247
}
248248
}
249249

0 commit comments

Comments
 (0)