|
48 | 48 | import org.springframework.validation.annotation.Validated;
|
49 | 49 |
|
50 | 50 | import static org.assertj.core.api.Assertions.assertThat;
|
51 |
| -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; |
| 51 | +import static org.assertj.core.api.Assertions.assertThatIllegalStateException; |
52 | 52 |
|
53 | 53 | /**
|
54 | 54 | * Tests for {@link ServletEndpointDiscoverer}.
|
@@ -106,29 +106,29 @@ void getEndpointsShouldNotDiscoverRegularEndpoints() {
|
106 | 106 | @Test
|
107 | 107 | void getEndpointWhenEndpointHasOperationsShouldThrowException() {
|
108 | 108 | this.contextRunner.withUserConfiguration(TestServletEndpointWithOperation.class)
|
109 |
| - .run(assertDiscoverer((discoverer) -> assertThatExceptionOfType(IllegalStateException.class) |
| 109 | + .run(assertDiscoverer((discoverer) -> assertThatIllegalStateException() |
110 | 110 | .isThrownBy(discoverer::getEndpoints)
|
111 | 111 | .withMessageContaining("ServletEndpoints must not declare operations")));
|
112 | 112 | }
|
113 | 113 |
|
114 | 114 | @Test
|
115 | 115 | void getEndpointWhenEndpointNotASupplierShouldThrowException() {
|
116 | 116 | this.contextRunner.withUserConfiguration(TestServletEndpointNotASupplier.class)
|
117 |
| - .run(assertDiscoverer((discoverer) -> assertThatExceptionOfType(IllegalStateException.class) |
| 117 | + .run(assertDiscoverer((discoverer) -> assertThatIllegalStateException() |
118 | 118 | .isThrownBy(discoverer::getEndpoints).withMessageContaining("must be a supplier")));
|
119 | 119 | }
|
120 | 120 |
|
121 | 121 | @Test
|
122 | 122 | void getEndpointWhenEndpointSuppliesWrongTypeShouldThrowException() {
|
123 | 123 | this.contextRunner.withUserConfiguration(TestServletEndpointSupplierOfWrongType.class)
|
124 |
| - .run(assertDiscoverer((discoverer) -> assertThatExceptionOfType(IllegalStateException.class) |
| 124 | + .run(assertDiscoverer((discoverer) -> assertThatIllegalStateException() |
125 | 125 | .isThrownBy(discoverer::getEndpoints).withMessageContaining("must supply an EndpointServlet")));
|
126 | 126 | }
|
127 | 127 |
|
128 | 128 | @Test
|
129 | 129 | void getEndpointWhenEndpointSuppliesNullShouldThrowException() {
|
130 | 130 | this.contextRunner.withUserConfiguration(TestServletEndpointSupplierOfNull.class)
|
131 |
| - .run(assertDiscoverer((discoverer) -> assertThatExceptionOfType(IllegalStateException.class) |
| 131 | + .run(assertDiscoverer((discoverer) -> assertThatIllegalStateException() |
132 | 132 | .isThrownBy(discoverer::getEndpoints).withMessageContaining("must not supply null")));
|
133 | 133 | }
|
134 | 134 |
|
|
0 commit comments