|
30 | 30 | import java.io.StringWriter; |
31 | 31 | import java.net.URI; |
32 | 32 | import java.nio.charset.Charset; |
| 33 | +import java.nio.charset.StandardCharsets; |
33 | 34 | import java.util.Arrays; |
34 | 35 | import org.apache.commons.io.IOUtils; |
35 | 36 | import org.apache.hc.client5.http.classic.methods.HttpDelete; |
@@ -131,6 +132,7 @@ public void setUp() throws Exception { |
131 | 132 |
|
132 | 133 | try (CloseableHttpResponse response = |
133 | 134 | handlePut(URI.create("/geowebcache/rest/global"), admin.getClient(), globalUpdate)) { |
| 135 | + System.out.println(response.getEntity().toString()); |
134 | 136 | assertEquals(200, response.getCode()); |
135 | 137 | } |
136 | 138 | } |
@@ -498,7 +500,7 @@ public void testCreateUpdateDelete() throws Exception { |
498 | 500 | final HttpGet request2 = |
499 | 501 | new HttpGet(jetty.getUri().resolve("rest/layers/").resolve(layerName + ".xml")); |
500 | 502 | try (CloseableHttpResponse response = admin.getClient().execute(request2)) { |
501 | | - assertThat(new StatusLine(response), hasProperty("statusCode", equalTo(404))); |
| 503 | + assertEquals(404, response.getCode()); |
502 | 504 | } |
503 | 505 | } |
504 | 506 | // GetCap |
@@ -1146,7 +1148,8 @@ public void testNewFileBlobstoreDontDeleteExistingContent() throws Exception { |
1146 | 1148 | // Make it sure the blobstore doesn't exist already as that would invalidate the test |
1147 | 1149 | try (CloseableHttpResponse response = |
1148 | 1150 | handleGet(URI.create("/geowebcache/rest/blobstores/maliciousCache.xml"), admin.getClient())) { |
1149 | | - assertThat(response, hasProperty("statusLine", hasProperty("statusCode", equalTo(404)))); |
| 1151 | + System.out.println(response); |
| 1152 | + assertEquals(404, response.getCode()); |
1150 | 1153 | } |
1151 | 1154 |
|
1152 | 1155 | // Create a store |
@@ -1260,6 +1263,8 @@ void doGetXML(URI uri, CloseableHttpClient client, Matcher<Integer> statusMatche |
1260 | 1263 | if (response.getCode() != 401) { |
1261 | 1264 | doc = XMLUnit.buildTestDocument(new InputSource(in)); |
1262 | 1265 | body.accept(doc); |
| 1266 | + } else { |
| 1267 | + System.out.println(IOUtils.toString(in, StandardCharsets.UTF_8)); |
1263 | 1268 | } |
1264 | 1269 | assertThat(new StatusLine(response), hasProperty("statusCode", statusMatcher)); |
1265 | 1270 | } |
|
0 commit comments