Allow responses with non-standard status codes to be documented

Fixes gh-639
This commit is contained in:
Andy Wilkinson
2019-09-12 17:03:21 +01:00
parent d586d9f15b
commit 3597ebc35a
17 changed files with 107 additions and 29 deletions

View File

@@ -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);
}
}