Refactor ServerWebExchange#getAttribute options

Issue: SPR-15718
This commit is contained in:
Rossen Stoyanchev
2017-06-29 14:54:50 -04:00
parent cd643704ad
commit 9253facf02
21 changed files with 66 additions and 74 deletions

View File

@@ -103,7 +103,7 @@ public class SimpleUrlHandlerMappingTests {
assertNotNull(actual);
assertSame(bean, actual);
//noinspection OptionalGetWithoutIsPresent
assertEquals(pathWithinMapping, exchange.getAttribute(PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE).get());
assertEquals(pathWithinMapping, exchange.getAttribute(PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE));
}
else {
assertNull(actual);

View File

@@ -388,7 +388,7 @@ public class ResourceWebHandlerTests {
assertEquals(HttpStatus.NOT_FOUND, exchange.getResponse().getStatusCode());
}
@Test(expected = IllegalStateException.class)
@Test(expected = IllegalArgumentException.class)
public void noPathWithinHandlerMappingAttribute() throws Exception {
MockServerWebExchange exchange = MockServerHttpRequest.get("").toExchange();
this.handler.handle(exchange).block(TIMEOUT);