From a0065bfd22586c01bdaf144341ce4327ee2401f1 Mon Sep 17 00:00:00 2001 From: jim-krueger Date: Tue, 12 Mar 2024 15:37:10 -0500 Subject: [PATCH] Fix code review comments. --- .../rs/jaxrs31/ee/multipart/MultipartSupportIT.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/jaxrs-tck/src/main/java/ee/jakarta/tck/ws/rs/jaxrs31/ee/multipart/MultipartSupportIT.java b/jaxrs-tck/src/main/java/ee/jakarta/tck/ws/rs/jaxrs31/ee/multipart/MultipartSupportIT.java index 2029a8d9..1d70f0e5 100644 --- a/jaxrs-tck/src/main/java/ee/jakarta/tck/ws/rs/jaxrs31/ee/multipart/MultipartSupportIT.java +++ b/jaxrs-tck/src/main/java/ee/jakarta/tck/ws/rs/jaxrs31/ee/multipart/MultipartSupportIT.java @@ -136,7 +136,7 @@ public void basicTest() throws Exception { .request(MediaType.MULTIPART_FORM_DATA_TYPE) .post(Entity.entity(new GenericEntity<>(multipart) { }, MediaType.MULTIPART_FORM_DATA))) { - Assertions.assertEquals(Response.Status.OK, response.getStatusInfo()); + Assertions.assertEquals(200, response.getStatus()); final List entityParts = response.readEntity(new GenericType<>() { }); if (entityParts.size() != 3) { @@ -153,6 +153,7 @@ public void basicTest() throws Exception { part = find(entityParts, "received-file"); Assertions.assertNotNull(part, getMessage(entityParts)); + Assertions.assertEquals("test file", part.getFileName().get()); Assertions.assertTrue(part.getContent(String.class).contains("value6")); part = find(entityParts, "added-input-stream"); @@ -187,11 +188,11 @@ public void singleFormParamTest() throws Exception { .mediaType(MediaType.TEXT_PLAIN_TYPE) .build()); try ( - Response response = client.target(createCombinedUri(uri, "test//single-form-param")) + Response response = client.target(createCombinedUri(uri, "test/single-form-param")) .request(MediaType.MULTIPART_FORM_DATA_TYPE) .post(Entity.entity(new GenericEntity<>(multipart) { }, MediaType.MULTIPART_FORM_DATA))) { - Assertions.assertEquals(Response.Status.OK, response.getStatusInfo()); + Assertions.assertEquals(200, response.getStatus()); final List entityParts = response.readEntity(new GenericType<>() { }); if (entityParts.size() != 3) { @@ -240,7 +241,7 @@ public void multiFormParamTest() throws Exception { .request(MediaType.MULTIPART_FORM_DATA_TYPE) .post(Entity.entity(new GenericEntity<>(multipart) { }, MediaType.MULTIPART_FORM_DATA))) { - Assertions.assertEquals(Response.Status.OK, response.getStatusInfo()); + Assertions.assertEquals(200, response.getStatus()); final List entityParts = response.readEntity(new GenericType<>() { }); if (entityParts.size() != 3) { @@ -360,7 +361,7 @@ public Response basicTest(final List parts) throws IOException { .mediaType(MediaType.APPLICATION_OCTET_STREAM_TYPE) .build(), EntityPart.withName("received-file") - .content(find(parts,"file")) + .content(find(parts,"file").getFileName().get(),find(parts,"file").getContent()) .mediaType(MediaType.APPLICATION_XML) .build(), EntityPart.withName("added-input-stream")