Allow responses with non-standard status codes to be documented
Fixes gh-639
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2018 the original author or authors.
|
||||
* Copyright 2014-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.
|
||||
@@ -61,4 +61,13 @@ public class MockMvcResponseConverterTests {
|
||||
Collections.singletonList("name=value; Domain=localhost; HttpOnly"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void responseWithCustomStatus() {
|
||||
MockHttpServletResponse response = new MockHttpServletResponse();
|
||||
response.setStatus(600);
|
||||
OperationResponse operationResponse = this.factory.convert(response);
|
||||
assertThat(operationResponse.getStatus()).isNull();
|
||||
assertThat(operationResponse.getStatusCode()).isEqualTo(600);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user