Resource handler tests expect status 404 for directory in jar file

Issue: SPR-16832
This commit is contained in:
Juergen Hoeller
2018-05-30 00:31:35 +02:00
parent 616a40adb6
commit f3e860e8f1
2 changed files with 7 additions and 7 deletions

View File

@@ -426,10 +426,11 @@ public class ResourceWebHandlerTests {
public void directoryInJarFile() {
MockServerWebExchange exchange = MockServerWebExchange.from(MockServerHttpRequest.get(""));
setPathWithinHandlerMapping(exchange, "underscorejs/");
this.handler.handle(exchange).block(TIMEOUT);
assertNull(exchange.getResponse().getStatusCode());
assertEquals(0, exchange.getResponse().getHeaders().getContentLength());
StepVerifier.create(this.handler.handle(exchange))
.expectErrorSatisfies(err -> {
assertThat(err, instanceOf(ResponseStatusException.class));
assertEquals(HttpStatus.NOT_FOUND, ((ResponseStatusException) err).getStatus());
}).verify(TIMEOUT);
}
@Test