use of org.apache.http.client.methods.HttpDelete in project Activiti by Activiti.
the class DeploymentResourceTest method testDeleteDeployment.
/**
* Test deleting a single deployment.
* DELETE repository/deployments/{deploymentId}
*/
@org.activiti.engine.test.Deployment(resources = { "org/activiti/rest/service/api/repository/oneTaskProcess.bpmn20.xml" })
public void testDeleteDeployment() throws Exception {
Deployment existingDeployment = repositoryService.createDeploymentQuery().singleResult();
assertNotNull(existingDeployment);
// Delete the deployment
HttpDelete httpDelete = new HttpDelete(SERVER_URL_PREFIX + RestUrls.createRelativeResourceUrl(RestUrls.URL_DEPLOYMENT, existingDeployment.getId()));
CloseableHttpResponse response = executeRequest(httpDelete, HttpStatus.SC_NO_CONTENT);
closeResponse(response);
existingDeployment = repositoryService.createDeploymentQuery().singleResult();
assertNull(existingDeployment);
}
use of org.apache.http.client.methods.HttpDelete in project Activiti by Activiti.
the class DeploymentResourceTest method testDeleteUnexistingDeployment.
/**
* Test deleting an unexisting deployment.
* DELETE repository/deployments/{deploymentId}
*/
public void testDeleteUnexistingDeployment() throws Exception {
HttpDelete httpDelete = new HttpDelete(SERVER_URL_PREFIX + RestUrls.createRelativeResourceUrl(RestUrls.URL_DEPLOYMENT, "unexisting"));
CloseableHttpResponse response = executeRequest(httpDelete, HttpStatus.SC_NOT_FOUND);
closeResponse(response);
}
use of org.apache.http.client.methods.HttpDelete in project Activiti by Activiti.
the class ProcessDefinitionIdentityLinksResourceTest method testDeleteCandidateStarterFromUnexistingProcessDefinition.
public void testDeleteCandidateStarterFromUnexistingProcessDefinition() throws Exception {
HttpDelete httpDelete = new HttpDelete(SERVER_URL_PREFIX + RestUrls.createRelativeResourceUrl(RestUrls.URL_PROCESS_DEFINITION_IDENTITYLINK, "unexisting", "groups", "admin"));
CloseableHttpResponse response = executeRequest(httpDelete, HttpStatus.SC_NOT_FOUND);
closeResponse(response);
}
use of org.apache.http.client.methods.HttpDelete in project Activiti by Activiti.
the class GroupMembershipResourceTest method testDeleteMemberfromUnexistingGroup.
/**
* Test deleting member from an unexisting group.
*/
public void testDeleteMemberfromUnexistingGroup() throws Exception {
HttpDelete httpDelete = new HttpDelete(SERVER_URL_PREFIX + RestUrls.createRelativeResourceUrl(RestUrls.URL_GROUP_MEMBERSHIP, "unexisting", "kermit"));
closeResponse(executeRequest(httpDelete, HttpStatus.SC_NOT_FOUND));
}
use of org.apache.http.client.methods.HttpDelete in project Activiti by Activiti.
the class GroupMembershipResourceTest method testDeleteMembershipNoMember.
/**
* Test delete membership that is no member in the group.
*/
public void testDeleteMembershipNoMember() throws Exception {
try {
Group testGroup = identityService.newGroup("testgroup");
testGroup.setName("Test group");
testGroup.setType("Test type");
identityService.saveGroup(testGroup);
User testUser = identityService.newUser("testuser");
identityService.saveUser(testUser);
HttpDelete httpDelete = new HttpDelete(SERVER_URL_PREFIX + RestUrls.createRelativeResourceUrl(RestUrls.URL_GROUP_MEMBERSHIP, "testgroup", "testuser"));
closeResponse(executeRequest(httpDelete, HttpStatus.SC_NOT_FOUND));
} finally {
try {
identityService.deleteGroup("testgroup");
} catch (Throwable ignore) {
// Ignore, since the group may not have been created in the test
// or already deleted
}
try {
identityService.deleteUser("testuser");
} catch (Throwable ignore) {
// Ignore, since the group may not have been created in the test
// or already deleted
}
}
}
Aggregations