Resource handler tests expect status 404 for directory in jar file
Issue: SPR-16832
This commit is contained in:
parent
616a40adb6
commit
f3e860e8f1
|
@ -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
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -494,8 +494,7 @@ public class ResourceHttpRequestHandlerTests {
|
|||
public void directoryInJarFile() throws Exception {
|
||||
this.request.setAttribute(HandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE, "underscorejs/");
|
||||
this.handler.handleRequest(this.request, this.response);
|
||||
assertEquals(200, this.response.getStatus());
|
||||
assertEquals(0, this.response.getContentLength());
|
||||
assertEquals(404, this.response.getStatus());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Reference in New Issue