1
1
/*
2
- * Copyright 2002-2012 the original author or authors.
2
+ * Copyright 2002-2017 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -40,7 +40,7 @@ public void success() throws Exception {
40
40
41
41
assertEquals (HttpStatus .OK , response .getStatusCode ());
42
42
assertTrue (response .getHeaders ().isEmpty ());
43
- assertNull ( response .getBody ());
43
+ assertArrayEquals ( new byte [ 0 ], FileCopyUtils . copyToByteArray ( response .getBody () ));
44
44
}
45
45
46
46
@ Test
@@ -71,7 +71,7 @@ public void created() throws Exception {
71
71
72
72
assertEquals (HttpStatus .CREATED , response .getStatusCode ());
73
73
assertEquals (location , response .getHeaders ().getLocation ());
74
- assertNull ( response .getBody ());
74
+ assertArrayEquals ( new byte [ 0 ], FileCopyUtils . copyToByteArray ( response .getBody () ));
75
75
}
76
76
77
77
@ Test
@@ -81,7 +81,7 @@ public void noContent() throws Exception {
81
81
82
82
assertEquals (HttpStatus .NO_CONTENT , response .getStatusCode ());
83
83
assertTrue (response .getHeaders ().isEmpty ());
84
- assertNull ( response .getBody ());
84
+ assertArrayEquals ( new byte [ 0 ], FileCopyUtils . copyToByteArray ( response .getBody () ));
85
85
}
86
86
87
87
@ Test
@@ -91,7 +91,7 @@ public void badRequest() throws Exception {
91
91
92
92
assertEquals (HttpStatus .BAD_REQUEST , response .getStatusCode ());
93
93
assertTrue (response .getHeaders ().isEmpty ());
94
- assertNull ( response .getBody ());
94
+ assertArrayEquals ( new byte [ 0 ], FileCopyUtils . copyToByteArray ( response .getBody () ));
95
95
}
96
96
97
97
@ Test
@@ -101,7 +101,7 @@ public void unauthorized() throws Exception {
101
101
102
102
assertEquals (HttpStatus .UNAUTHORIZED , response .getStatusCode ());
103
103
assertTrue (response .getHeaders ().isEmpty ());
104
- assertNull ( response .getBody ());
104
+ assertArrayEquals ( new byte [ 0 ], FileCopyUtils . copyToByteArray ( response .getBody () ));
105
105
}
106
106
107
107
@ Test
@@ -111,7 +111,7 @@ public void serverError() throws Exception {
111
111
112
112
assertEquals (HttpStatus .INTERNAL_SERVER_ERROR , response .getStatusCode ());
113
113
assertTrue (response .getHeaders ().isEmpty ());
114
- assertNull ( response .getBody ());
114
+ assertArrayEquals ( new byte [ 0 ], FileCopyUtils . copyToByteArray ( response .getBody () ));
115
115
}
116
116
117
117
@ Test
@@ -121,7 +121,7 @@ public void withStatus() throws Exception {
121
121
122
122
assertEquals (HttpStatus .FORBIDDEN , response .getStatusCode ());
123
123
assertTrue (response .getHeaders ().isEmpty ());
124
- assertNull ( response .getBody ());
124
+ assertArrayEquals ( new byte [ 0 ], FileCopyUtils . copyToByteArray ( response .getBody () ));
125
125
}
126
126
127
127
}
0 commit comments