use of org.apache.camel.example.cxf.jaxrs.resources.BookNotFoundFault in project camel by apache.
the class JAXRSClientServerTest method testJAXWSClient.
@Test
public void testJAXWSClient() throws BookNotFoundFault {
JAXWSClient jaxwsClient = new JAXWSClient();
BookStore bookStore = jaxwsClient.getBookStore();
bookStore.addBook(new Book("Camel User Guide", 123L));
Book book = bookStore.getBook(123L);
assertNotNull("We should find the book here", book);
try {
book = bookStore.getBook(124L);
fail("We should not have this book");
} catch (Exception exception) {
assertTrue("The exception should be BookNotFoundFault", exception instanceof BookNotFoundFault);
}
}
use of org.apache.camel.example.cxf.jaxrs.resources.BookNotFoundFault in project camel by apache.
the class JAXRSClientServerTest method testJAXRSClient.
@Test
public void testJAXRSClient() throws BookNotFoundFault {
// JAXRSClient invocation
JAXRSClient jaxrsClient = new JAXRSClient();
BookStore bookStore = jaxrsClient.getBookStore();
bookStore.addBook(new Book("Camel User Guide", 124L));
Book book = bookStore.getBook(124L);
assertNotNull("We should find the book here", book);
try {
book = bookStore.getBook(126L);
fail("We should not have this book");
} catch (Exception exception) {
assertTrue("The exception should be BookNotFoundFault", exception instanceof BookNotFoundFault);
}
}
Aggregations