Skip to content

Commit 0a30b71

Browse files
committed
Fix failing tests caused by previous commit
1 parent 0311854 commit 0a30b71

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

spring-test/src/test/java/org/springframework/test/web/client/response/ResponseCreatorsTests.java

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2017 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -40,7 +40,7 @@ public void success() throws Exception {
4040

4141
assertEquals(HttpStatus.OK, response.getStatusCode());
4242
assertTrue(response.getHeaders().isEmpty());
43-
assertNull(response.getBody());
43+
assertArrayEquals(new byte[0], FileCopyUtils.copyToByteArray(response.getBody()));
4444
}
4545

4646
@Test
@@ -71,7 +71,7 @@ public void created() throws Exception {
7171

7272
assertEquals(HttpStatus.CREATED, response.getStatusCode());
7373
assertEquals(location, response.getHeaders().getLocation());
74-
assertNull(response.getBody());
74+
assertArrayEquals(new byte[0], FileCopyUtils.copyToByteArray(response.getBody()));
7575
}
7676

7777
@Test
@@ -81,7 +81,7 @@ public void noContent() throws Exception {
8181

8282
assertEquals(HttpStatus.NO_CONTENT, response.getStatusCode());
8383
assertTrue(response.getHeaders().isEmpty());
84-
assertNull(response.getBody());
84+
assertArrayEquals(new byte[0], FileCopyUtils.copyToByteArray(response.getBody()));
8585
}
8686

8787
@Test
@@ -91,7 +91,7 @@ public void badRequest() throws Exception {
9191

9292
assertEquals(HttpStatus.BAD_REQUEST, response.getStatusCode());
9393
assertTrue(response.getHeaders().isEmpty());
94-
assertNull(response.getBody());
94+
assertArrayEquals(new byte[0], FileCopyUtils.copyToByteArray(response.getBody()));
9595
}
9696

9797
@Test
@@ -101,7 +101,7 @@ public void unauthorized() throws Exception {
101101

102102
assertEquals(HttpStatus.UNAUTHORIZED, response.getStatusCode());
103103
assertTrue(response.getHeaders().isEmpty());
104-
assertNull(response.getBody());
104+
assertArrayEquals(new byte[0], FileCopyUtils.copyToByteArray(response.getBody()));
105105
}
106106

107107
@Test
@@ -111,7 +111,7 @@ public void serverError() throws Exception {
111111

112112
assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, response.getStatusCode());
113113
assertTrue(response.getHeaders().isEmpty());
114-
assertNull(response.getBody());
114+
assertArrayEquals(new byte[0], FileCopyUtils.copyToByteArray(response.getBody()));
115115
}
116116

117117
@Test
@@ -121,7 +121,7 @@ public void withStatus() throws Exception {
121121

122122
assertEquals(HttpStatus.FORBIDDEN, response.getStatusCode());
123123
assertTrue(response.getHeaders().isEmpty());
124-
assertNull(response.getBody());
124+
assertArrayEquals(new byte[0], FileCopyUtils.copyToByteArray(response.getBody()));
125125
}
126126

127127
}

0 commit comments

Comments
 (0)