Skip to content

Commit

Permalink
Fixup force delete action documentation
Browse files Browse the repository at this point in the history
This was doing a GET request and didn't even specify
the action ID.

Signed-off-by: Stefan Schake <[email protected]>
  • Loading branch information
stschake committed Jan 11, 2021
1 parent 6df3a04 commit 645145f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,13 +308,17 @@ public void deleteActionFromTarget() throws Exception {
}

@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))));
}

Expand Down

0 comments on commit 645145f

Please sign in to comment.