Search in sources :

Example 16 with EntityTag

use of jakarta.ws.rs.core.EntityTag in project jaxrs-api by eclipse-ee4j.

the class JAXRSClientIT method getEntityTagTest.

/*
   * @testName: getEntityTagTest
   * 
   * @assertion_ids: JAXRS:JAVADOC:847;
   * 
   * @test_Strategy: Get the entity tag.
   */
@Test
public void getEntityTagTest() throws Fault {
    String tag = "ABCDEF0123456789";
    setProperty(Property.STATUS_CODE, getStatusCode(Status.NOT_MODIFIED));
    Response response = invokePost("entitytag", tag);
    EntityTag responseTag = response.getEntityTag();
    assertEquals(tag, responseTag.getValue(), "response#getEntityTag()", responseTag.getValue(), "is unequal to expected EntityTag", tag);
    logMsg("#getEntityTag is", responseTag, "as expected");
}
Also used : Response(jakarta.ws.rs.core.Response) EntityTag(jakarta.ws.rs.core.EntityTag) Test(org.junit.jupiter.api.Test)

Aggregations

EntityTag (jakarta.ws.rs.core.EntityTag)16 Test (org.junit.jupiter.api.Test)13 Response (jakarta.ws.rs.core.Response)9 POST (jakarta.ws.rs.POST)2 Path (jakarta.ws.rs.Path)2 ClientResponseContext (jakarta.ws.rs.client.ClientResponseContext)2 ResponseBuilder (jakarta.ws.rs.core.Response.ResponseBuilder)2 HashMap (java.util.HashMap)2 ClientRequestContext (jakarta.ws.rs.client.ClientRequestContext)1