Use idiomatic AssertJ map assertions

See gh-31752
This commit is contained in:
Yanming Zhou
2023-12-05 10:35:18 +08:00
committed by Stéphane Nicoll
parent 47fe61ef79
commit 6f11716b6f
6 changed files with 55 additions and 55 deletions

View File

@@ -88,7 +88,7 @@ public class HandlersBeanDefinitionParserTests {
assertThat(condition2).isTrue();
SimpleUrlHandlerMapping shm = (SimpleUrlHandlerMapping) hm;
if (shm.getUrlMap().keySet().contains("/foo")) {
if (shm.getUrlMap().containsKey("/foo")) {
assertThat(shm.getUrlMap()).containsOnlyKeys("/foo", "/bar");
WebSocketHttpRequestHandler handler = (WebSocketHttpRequestHandler) shm.getUrlMap().get("/foo");
assertThat(handler).isNotNull();