Merge branch '5.3.x' into main
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
* Copyright 2002-2022 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.
|
||||
@@ -128,6 +128,15 @@ class ResponseCreatorsTests {
|
||||
assertThat(StreamUtils.copyToByteArray(response.getBody()).length).isEqualTo(0);
|
||||
}
|
||||
|
||||
@Test
|
||||
void withCustomStatus() throws Exception {
|
||||
DefaultResponseCreator responseCreator = MockRestResponseCreators.withRawStatus(454);
|
||||
MockClientHttpResponse response = (MockClientHttpResponse) responseCreator.createResponse(null);
|
||||
|
||||
assertThat(response.getRawStatusCode()).isEqualTo(454);
|
||||
assertThat(response.getStatusText()).isEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
void withException() {
|
||||
ResponseCreator responseCreator = MockRestResponseCreators.withException(new SocketTimeoutException());
|
||||
|
||||
Reference in New Issue
Block a user