Java Code Examples for org.apache.cxf.jaxrs.client.WebClient#back()

The following examples show how to use org.apache.cxf.jaxrs.client.WebClient#back() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SampleRestApplicationTest.java    From cxf with Apache License 2.0 6 votes vote down vote up
@Test
public void testHelloRequest() throws Exception {
    WebClient wc = WebClient.create("http://localhost:" + port + "/services/helloservice");
    wc.accept("text/plain");
    
    // HelloServiceImpl1
    wc.path("sayHello").path("ApacheCxfUser");
    String greeting = wc.get(String.class);
    Assert.assertEquals("Hello ApacheCxfUser, Welcome to CXF RS Spring Boot World!!!", greeting); 
 
    // Reverse to the starting URI
    wc.back(true);

    // HelloServiceImpl2
    wc.path("sayHello2").path("ApacheCxfUser");
    greeting = wc.get(String.class);
    Assert.assertEquals("Hello2 ApacheCxfUser, Welcome to CXF RS Spring Boot World!!!", greeting); 
}
 
Example 2
Source File: SampleRestApplicationTest.java    From cxf with Apache License 2.0 6 votes vote down vote up
@Test
public void testHelloRequest() throws Exception {
    WebClient wc = WebClient.create("http://localhost:" + port + "/services/helloservice");
    wc.accept("text/plain");
    
    // HelloServiceImpl1
    wc.path("sayHello").path("ApacheCxfUser");
    String greeting = wc.get(String.class);
    Assert.assertEquals("Hello ApacheCxfUser, Welcome to CXF RS Spring Boot World!!!", greeting); 
 
    // Reverse to the starting URI
    wc.back(true);

    // HelloServiceImpl2
    wc.path("sayHello2").path("ApacheCxfUser");
    greeting = wc.get(String.class);
    Assert.assertEquals("Hello2 ApacheCxfUser, Welcome to CXF RS Spring Boot World!!!", greeting); 
}
 
Example 3
Source File: JAXRSHttpsBookTest.java    From cxf with Apache License 2.0 5 votes vote down vote up
@Test
public void testGetBook123WebClientToProxy() throws Exception {

    WebClient wc = WebClient.create("https://localhost:" + PORT, CLIENT_CONFIG_FILE1);
    wc.path("/bookstore/securebooks/123").accept(MediaType.APPLICATION_XML_TYPE);
    Book b = wc.get(Book.class);
    assertEquals(123, b.getId());

    wc.back(true);

    BookStore bs = JAXRSClientFactory.fromClient(wc, BookStore.class);
    Book b2 = bs.getSecureBook("123");
    assertEquals(b2.getId(), 123);

}
 
Example 4
Source File: PeopleSteps.java    From attic-rave with Apache License 2.0 4 votes vote down vote up
private WebClient getClient() {
    WebClient client = (WebClient) getState().get(CommonSteps.KEY_WEB_CLIENT);
    client.back(true);
    client.resetQuery();
    return client;
}