This repository was archived by the owner on Apr 5, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +8
-15
lines changed
src/test/java/de/filefighter/rest Expand file tree Collapse file tree 2 files changed +8
-15
lines changed Original file line number Diff line number Diff line change 43
43
<version >1.18.16</version >
44
44
</dependency >
45
45
46
- <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-io -->
47
- <dependency >
48
- <groupId >commons-io</groupId >
49
- <artifactId >commons-io</artifactId >
50
- <version >2.8.0</version >
51
- </dependency >
52
-
53
46
<!-- TESTING -->
54
47
<dependency >
55
48
<groupId >org.junit.jupiter</groupId >
Original file line number Diff line number Diff line change 1
1
package de .filefighter .rest ;
2
2
3
- import java .io .IOException ;
4
- import java .io .InputStream ;
5
- import java .io .StringWriter ;
3
+ import java .io .*;
6
4
7
- import org . apache . commons . io .IOUtils ;
5
+ import io . cucumber . messages . internal . com . google . common . io .CharStreams ;
8
6
import org .springframework .http .client .ClientHttpResponse ;
9
7
10
8
public class ResponseResults {
@@ -13,10 +11,12 @@ public class ResponseResults {
13
11
14
12
ResponseResults (final ClientHttpResponse response ) throws IOException {
15
13
this .theResponse = response ;
16
- final InputStream bodyInputStream = response .getBody ();
17
- final StringWriter stringWriter = new StringWriter ();
18
- IOUtils .copy (bodyInputStream , stringWriter ); //TODO: change maybe?
19
- this .body = stringWriter .toString ();
14
+
15
+ String text ;
16
+ try (Reader reader = new InputStreamReader (response .getBody ())) {
17
+ text = CharStreams .toString (reader );
18
+ }
19
+ body = text ;
20
20
}
21
21
22
22
public ClientHttpResponse getTheResponse () {
You can’t perform that action at this time.
0 commit comments