Search in sources :

Example 1 with Entity

use of jakarta.ws.rs.client.Entity in project jaxrs-api by eclipse-ee4j.

the class JaxrsWebTestCase method buildRequest.

/**
 * Build Invocation
 */
protected Invocation buildRequest(WebTarget target) {
    Invocation.Builder builder;
    builder = target.request(getAcceptMediaType());
    for (Entry<String, String> entry : headerMap.entrySet()) {
        if (!entry.getKey().equals("Accept"))
            builder.header(entry.getKey(), entry.getValue());
    }
    Invocation i;
    if (entity != null) {
        if (entity instanceof Entity)
            i = builder.build(requestType, (Entity<?>) entity);
        else
            i = builder.build(requestType, Entity.entity(entity, getContentType()));
        TestUtil.logMsg("[Request] Adding entity: " + entity);
    } else
        i = builder.build(requestType);
    return i;
}
Also used : Entity(jakarta.ws.rs.client.Entity) Invocation(jakarta.ws.rs.client.Invocation)

Aggregations

Entity (jakarta.ws.rs.client.Entity)1 Invocation (jakarta.ws.rs.client.Invocation)1