Search in sources :

Example 1 with BookInterface

use of org.apache.cxf.jaxrs.resources.BookInterface in project cxf by apache.

the class JAXRSClientFactoryBeanTest method testInvokePathEmpty.

@Test(expected = IllegalArgumentException.class)
public void testInvokePathEmpty() throws Exception {
    JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();
    bean.setAddress("http://bar");
    bean.setResourceClass(BookInterface.class);
    BookInterface store = bean.create(BookInterface.class);
    store.getBook("");
}
Also used : BookInterface(org.apache.cxf.jaxrs.resources.BookInterface) Test(org.junit.Test)

Example 2 with BookInterface

use of org.apache.cxf.jaxrs.resources.BookInterface in project cxf by apache.

the class WebClientTest method testProxyConfiguration.

@Test
public void testProxyConfiguration() {
    // interface
    BookInterface proxy = JAXRSClientFactory.create("http://foo", BookInterface.class);
    assertNotNull(WebClient.getConfig(proxy) != null);
    // cglib
    BookStore proxy2 = JAXRSClientFactory.create("http://foo", BookStore.class);
    assertNotNull(WebClient.getConfig(proxy2) != null);
}
Also used : BookInterface(org.apache.cxf.jaxrs.resources.BookInterface) BookStore(org.apache.cxf.jaxrs.resources.BookStore) Test(org.junit.Test)

Example 3 with BookInterface

use of org.apache.cxf.jaxrs.resources.BookInterface in project cxf by apache.

the class WebClientTest method testProxyNull.

@Test(expected = IllegalArgumentException.class)
public void testProxyNull() {
    // interface
    BookInterface proxy = JAXRSClientFactory.create("http://foo", BookInterface.class);
    proxy.getBook(null);
}
Also used : BookInterface(org.apache.cxf.jaxrs.resources.BookInterface) Test(org.junit.Test)

Example 4 with BookInterface

use of org.apache.cxf.jaxrs.resources.BookInterface in project cxf by apache.

the class JAXRSClientFactoryBeanTest method testInvokePathNull.

@Test(expected = IllegalArgumentException.class)
public void testInvokePathNull() throws Exception {
    JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();
    bean.setAddress("http://bar");
    bean.setResourceClass(BookInterface.class);
    BookInterface store = bean.create(BookInterface.class);
    store.getBook(null);
}
Also used : BookInterface(org.apache.cxf.jaxrs.resources.BookInterface) Test(org.junit.Test)

Example 5 with BookInterface

use of org.apache.cxf.jaxrs.resources.BookInterface in project cxf by apache.

the class JAXRSClientFactoryBeanTest method testInvokePathEmptyAllowed.

@Test
public void testInvokePathEmptyAllowed() throws Exception {
    Bus bus = BusFactory.newInstance().createBus();
    bus.setProperty("allow.empty.path.template.value", true);
    JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();
    bean.setBus(bus);
    bean.setAddress("http://bar");
    bean.setResourceClass(BookInterface.class);
    BookInterface store = bean.create(BookInterface.class);
    assertNotNull(store.getBook(""));
}
Also used : Bus(org.apache.cxf.Bus) BookInterface(org.apache.cxf.jaxrs.resources.BookInterface) Test(org.junit.Test)

Aggregations

BookInterface (org.apache.cxf.jaxrs.resources.BookInterface)5 Test (org.junit.Test)5 Bus (org.apache.cxf.Bus)1 BookStore (org.apache.cxf.jaxrs.resources.BookStore)1