07-06-2015 05:29 AM
import org.apache.cxf.jaxrs.client.WebClient;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class TestInvoke {
private ApplicationContext context;
@Test
public void test() throws Exception {
context = new ClassPathXmlApplicationContext("spring-cxf.config.xml");
WebClient client = context.getBean("rsWebClient", WebClient.class);
assertNotNull(WebClient.fromClient(client)
.header("Authorization", setUser()).accept("application/json")
.type("application/json").path("/service").path("/runtime")
.path("/process-instances").get());
}
private String setUser() {
String username = "kermit";
String password = "kermit";
return "Basic "
+ org.apache.cxf.common.util.Base64Utility.encode((username
+ ":" + password).getBytes());
}
}
public class Message{
Collection data;
private String id;
private String url;
private String businessKey;
private boolean suspended;
private boolean ended;
private String processDefinitionId;
private String processDefinitionUrl;
private String activityId;
private String tenantId;
private boolean completed;
}
07-06-2015 09:44 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.