diff --git a/spring-boot/src/test/java/org/springframework/boot/web/embedded/jetty/JettyServletWebServerFactoryTests.java b/spring-boot/src/test/java/org/springframework/boot/web/embedded/jetty/JettyServletWebServerFactoryTests.java index 8e00131ac1b..f1d7af42a57 100644 --- a/spring-boot/src/test/java/org/springframework/boot/web/embedded/jetty/JettyServletWebServerFactoryTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/web/embedded/jetty/JettyServletWebServerFactoryTests.java @@ -52,7 +52,7 @@ import org.springframework.boot.web.servlet.server.AbstractServletWebServerFacto import org.springframework.http.HttpHeaders; import static org.assertj.core.api.Assertions.assertThat; -import static org.hamcrest.CoreMatchers.instanceOf; +import static org.hamcrest.CoreMatchers.isA; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.inOrder; import static org.mockito.Mockito.mock; @@ -292,7 +292,7 @@ public class JettyServletWebServerFactoryTests } }); - this.thrown.expectCause(instanceOf(IllegalStateException.class)); + this.thrown.expectCause(isA(IllegalStateException.class)); factory.getWebServer().start(); }