As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
WebClient client = WebClient.create( "http://localhost:8080/activiti-rest/service/process-definition/myTest:1:401" , userName, passwd, null); System.out.println(client.getBaseURI()); System.out.println(client.getCurrentURI());
/**<br> * Get a request attribute value, decoded. <br> */<br> protected String getAttribute(String name) {<br> return decode((String) getRequest().getAttributes().get(name));<br> }<br><br> protected String decode(String string) {<br> if(string != null) {<br> try {<br> return URLDecoder.decode(string, "UTF-8");<br> } catch (UnsupportedEncodingException uee) {<br> throw new IllegalStateException("JVM does not support UTF-8 encoding.", uee);<br> }<br> }<br> return null;<br> }<br>
<br> /**<br> * Test getting a single process definition.<br> * GET repository/process-definitions/{processDefinitionResource}<br> */<br> @Deployment(resources={"org/activiti/rest/api/repository/oneTaskProcess.bpmn20.xml"})<br> public void testGetProcessDefinition() throws Exception {<br><br> ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().singleResult();<br> <br> ClientResource client = getAuthenticatedClient(RestUrls.createRelativeResourceUrl(RestUrls.URL_PROCESS_DEFINITION, encode(processDefinition.getId())));<br> Representation response = client.get();<br> <br> // Check "OK" status<br> assertEquals(Status.SUCCESS_OK, client.getResponse().getStatus());<br>