Search in sources :

Example 1 with FeatureContext

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

the class JAXRSClientIT method clientConfiguredTest.

/*
   * @testName: clientConfiguredTest
   * 
   * @assertion_ids: JAXRS:SPEC:73;
   * 
   * @test_Strategy: This interface supports configuration of: Features,
   * Properties, Providers
   */
@Test
public void clientConfiguredTest() throws Fault {
    Client client = ClientBuilder.newClient();
    client.register(new StringBeanEntityProvider());
    checkConfig(client, 1 + registeredProviderCnt, registeredPropertyCnt);
    client = ClientBuilder.newClient();
    client.property(getClass().getName(), getClass().getName());
    checkConfig(client, registeredProviderCnt, 1 + registeredPropertyCnt);
    client = ClientBuilder.newClient();
    client.register(new Feature() {

        @Override
        public boolean configure(FeatureContext context) {
            return true;
        }
    });
    checkConfig(client, 1 + registeredProviderCnt, registeredPropertyCnt);
}
Also used : JAXRSCommonClient(ee.jakarta.tck.ws.rs.common.JAXRSCommonClient) Client(jakarta.ws.rs.client.Client) StringBeanEntityProvider(ee.jakarta.tck.ws.rs.common.provider.StringBeanEntityProvider) Feature(jakarta.ws.rs.core.Feature) FeatureContext(jakarta.ws.rs.core.FeatureContext) Test(org.junit.jupiter.api.Test)

Aggregations

JAXRSCommonClient (ee.jakarta.tck.ws.rs.common.JAXRSCommonClient)1 StringBeanEntityProvider (ee.jakarta.tck.ws.rs.common.provider.StringBeanEntityProvider)1 Client (jakarta.ws.rs.client.Client)1 Feature (jakarta.ws.rs.core.Feature)1 FeatureContext (jakarta.ws.rs.core.FeatureContext)1 Test (org.junit.jupiter.api.Test)1