Search in sources :

Example 1 with FeatureStoreHttp

use of org.ff4j.web.jersey1.store.FeatureStoreHttp in project ff4j by ff4j.

the class FeatureStoreHttpTest method testInitClient.

/**
 * TDD.
 */
@Test
public void testInitClient() {
    FeatureStoreHttp httpStore = new FeatureStoreHttp();
    httpStore.setUrl(null);
    Assert.assertNull(httpStore.getUrl());
    httpStore = new FeatureStoreHttp("a", "b", "c");
    httpStore = new FeatureStoreHttp(null, "Key");
}
Also used : FeatureStoreHttp(org.ff4j.web.jersey1.store.FeatureStoreHttp) Test(org.junit.Test) JerseyTest(com.sun.jersey.test.framework.JerseyTest)

Example 2 with FeatureStoreHttp

use of org.ff4j.web.jersey1.store.FeatureStoreHttp in project ff4j by ff4j.

the class FeatureStoreHttpSecured method testReadFeature.

@Test
public void testReadFeature() {
    String targetRestApiURL = "http://localhost:8080/api/ff4j/";
    String userName = "user";
    String userPassword = "userPass";
    // Init FF4j as HTTP CLIENT
    FF4j ff4j = new FF4j();
    ff4j.setFeatureStore(new FeatureStoreHttp(targetRestApiURL, userName, userPassword));
    ff4j.setPropertiesStore(new PropertyStoreHttp(targetRestApiURL, userName, userPassword));
    Feature f1 = ff4j.getFeatureStore().read("f1");
    System.out.println(f1);
}
Also used : FeatureStoreHttp(org.ff4j.web.jersey2.store.FeatureStoreHttp) PropertyStoreHttp(org.ff4j.web.jersey2.store.PropertyStoreHttp) FF4j(org.ff4j.FF4j) Feature(org.ff4j.core.Feature) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 JerseyTest (com.sun.jersey.test.framework.JerseyTest)1 FF4j (org.ff4j.FF4j)1 Feature (org.ff4j.core.Feature)1 FeatureStoreHttp (org.ff4j.web.jersey1.store.FeatureStoreHttp)1 FeatureStoreHttp (org.ff4j.web.jersey2.store.FeatureStoreHttp)1 PropertyStoreHttp (org.ff4j.web.jersey2.store.PropertyStoreHttp)1