Add getRawStatusCode() to ExchangeResult

Closes gh-23630
This commit is contained in:
Rossen Stoyanchev
2019-09-24 12:58:52 +01:00
parent 99d9dacc4f
commit 955000699a
4 changed files with 23 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2019 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.
@@ -62,6 +62,11 @@ public class StatusAssertionTests {
}
}
@Test // gh-23630
public void isEqualToWithCustomStatus() {
statusAssertions(600).isEqualTo(600);
}
@Test
public void reasonEquals() {
StatusAssertions assertions = statusAssertions(HttpStatus.CONFLICT);
@@ -177,6 +182,10 @@ public class StatusAssertionTests {
private StatusAssertions statusAssertions(HttpStatus status) {
return statusAssertions(status.value());
}
private StatusAssertions statusAssertions(int status) {
MockClientHttpRequest request = new MockClientHttpRequest(HttpMethod.GET, URI.create("/"));
MockClientHttpResponse response = new MockClientHttpResponse(status);