Fixup force delete action documentation (#1042)

This was doing a GET request and didn't even specify
the action ID.

Signed-off-by: Stefan Schake <stefan.schake@devolo.de>
This commit is contained in:
Stefan Schake
2021-01-14 15:52:39 +01:00
committed by GitHub
parent ba81ae6fb4
commit 70ee9472bf
2 changed files with 13 additions and 9 deletions

View File

@@ -373,11 +373,11 @@ include::{snippets}/targets/delete-action-from-target/path-parameters.adoc[]
==== Request query parameter
include::{snippets}/targets/delete-actions-from-target-with-parameters/request-parameters.adoc[]
include::{snippets}/targets/delete-action-from-target-with-parameters/request-parameters.adoc[]
==== Request parameter example
include::{snippets}/targets/delete-actions-from-target-with-parameters/http-request.adoc[]
include::{snippets}/targets/delete-action-from-target-with-parameters/http-request.adoc[]
=== Response (Status 204)

View File

@@ -308,13 +308,17 @@ public class TargetResourceDocumentationTest extends AbstractApiRestDocumentatio
}
@Test
@Description("Handles the GET request of retrieving all targets within SP based by parameter. Required Permission: READ_TARGET.")
public void deleteActionsFromTargetWithParameters() throws Exception {
generateActionForTarget(targetId);
mockMvc.perform(get(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/" + targetId + "/"
+ MgmtRestConstants.TARGET_V1_ACTIONS + "?force=true")).andExpect(status().isOk())
.andDo(MockMvcResultPrinter.print()).andDo(this.document.document(
@Description("Optionally force quits an active action, only active actions can be deleted. Required Permission: UPDATE_TARGET.")
public void deleteActionFromTargetWithParameters() throws Exception {
final Action action = generateActionForTarget(targetId, false);
deploymentManagement.cancelAction(action.getId());
mockMvc.perform(delete(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/"
+ MgmtRestConstants.TARGET_V1_ACTIONS + "/{actionId}?force=true", targetId, action.getId()))
.andExpect(status().isNoContent()).andDo(MockMvcResultPrinter.print())
.andDo(this.document.document(
pathParameters(parameterWithName("targetId").description(ApiModelPropertiesGeneric.ITEM_ID),
parameterWithName("actionId").description(ApiModelPropertiesGeneric.ITEM_ID)),
requestParameters(parameterWithName("force").description(MgmtApiModelProperties.FORCE))));
}