### Question:
Preference extends AbstractALSResource { @POST @Path("{userID}/{itemID}") @Consumes({MediaType.TEXT_PLAIN, "text/csv", MediaType.APPLICATION_JSON}) public void post( @PathParam("userID") String userID, @PathParam("itemID") String itemID, Reader reader) throws IOException, OryxServingException { checkNotReadOnly(); BufferedReader bufferedReader = maybeBuffer(reader); String line = bufferedReader.readLine(); String value = validateAndStandardizeStrength(line); sendToTopic(userID, itemID, value); }  @POST @Path("{userID}/{itemID}") @Consumes({MediaType.TEXT_PLAIN, "text/csv", MediaType.APPLICATION_JSON}) void post(
      @PathParam("userID") String userID,
      @PathParam("itemID") String itemID,
      Reader reader); @DELETE @Path("{userID}/{itemID}") void delete(
      @PathParam("userID") String userID,
      @PathParam("itemID") String itemID);  }### Answer:
@Test public void testPostJson() { try (Response response = target("/pref/U1/I1").request().post( Entity.entity(PREFERENCE_DATA, MediaType.APPLICATION_JSON))) { checkResponse(response, "U1", "I1", "2.5"); } }
@Test public void testPostWithEmptyItemValue() { try (Response response = target("/pref/U2/I2").request().post(Entity.text(""))) { checkResponse(response, "U2", "I2", "1"); } }
@Test public void testPostWithBadItemValue() { try (Response response = target("/pref/U2/I2").request().post(Entity.text("aBc!"))) { Assert.assertEquals(Response.Status.BAD_REQUEST.getStatusCode(), response.getStatus()); } }
@Test public void testPostCSV() { try (Response response = target("/pref/U1/I1").request().post( Entity.entity(PREFERENCE_DATA, "text/csv"))) { checkResponse(response, "U1", "I1", "2.5"); } }