add method to get a single action by externalRef (#942)

* add method to get a single action by externalRef
* adding junit test for ControllerManagement::getActionByExternalRef
* fixing sonarQube findings
* improve assert statement

Signed-off-by: Ravindranath Sandeep <Sandeep.Ravindranath@bosch-si.com>
This commit is contained in:
Sandeep Ravindranath
2020-03-19 10:16:30 +01:00
committed by GitHub
parent 46ce3b632a
commit cf7add7aaa
4 changed files with 48 additions and 0 deletions

View File

@@ -481,6 +481,16 @@ public interface ControllerManagement {
@PreAuthorize(SpringEvalExpressions.IS_CONTROLLER)
List<Action> getActiveActionsByExternalRef(@NotNull List<String> externalRefs);
/**
* Retrieves an {@link Action} using {@link Action#getExternalRef()}
*
* @param externalRef
* of the action. See {@link Action#getExternalRef()}
* @return {@link Action} or {@code null} if it does not exist
*/
@PreAuthorize(SpringEvalExpressions.IS_CONTROLLER)
Optional<Action> getActionByExternalRef(@NotEmpty String externalRef);
/**
* Delete a single target.
*