diff --git a/spring-test/src/test/java/org/springframework/mock/web/MockHttpServletResponseTests.java b/spring-test/src/test/java/org/springframework/mock/web/MockHttpServletResponseTests.java index 4be36a65dc..1687302d89 100644 --- a/spring-test/src/test/java/org/springframework/mock/web/MockHttpServletResponseTests.java +++ b/spring-test/src/test/java/org/springframework/mock/web/MockHttpServletResponseTests.java @@ -393,9 +393,7 @@ class MockHttpServletResponseTests { private void assertPrimarySessionCookie(String expectedValue) { Cookie cookie = this.response.getCookie("SESSION"); - assertThat(cookie).isNotNull(); - boolean condition = cookie instanceof MockCookie; - assertThat(condition).isTrue(); + assertThat(cookie).isInstanceOf(MockCookie.class); assertThat(cookie.getName()).isEqualTo("SESSION"); assertThat(cookie.getValue()).isEqualTo(expectedValue); assertThat(cookie.getPath()).isEqualTo("/");