### Question:
OperationsApiServiceImpl implements OperationsApiService { @Override public ResponseEntity<Void> executeOperationAction(HttpServletRequest request, String spaceGuid, String operationId, String actionId) { Operation operation = getOperation(operationId); List<String> availableOperations = getAvailableActions(operation); if (!availableOperations.contains(actionId)) { throw new IllegalArgumentException(MessageFormat.format(Messages.ACTION_0_CANNOT_BE_EXECUTED_OVER_OPERATION_1_IN_STATE_2, actionId, operationId, operation.getState())); } ProcessAction action = processActionRegistry.getAction(Action.fromString(actionId)); action.execute(getAuthenticatedUser(request), operationId); AuditLoggingProvider.getFacade() .logAboutToStart(MessageFormat.format("{0} over operation with id {1}", action, operation.getProcessId())); return ResponseEntity.accepted() .header("Location", getLocationHeader(operationId, spaceGuid)) .build(); }  @Override ResponseEntity<List<Operation>> getOperations(String spaceGuid, String mtaId, List<String> stateStrings, Integer last); @Override ResponseEntity<Void> executeOperationAction(HttpServletRequest request, String spaceGuid, String operationId, String actionId); @Override ResponseEntity<List<Log>> getOperationLogs(String spaceGuid, String operationId); @Override ResponseEntity<String> getOperationLogContent(String spaceGuid, String operationId, String logId); @Override ResponseEntity<Operation> startOperation(HttpServletRequest request, String spaceGuid, Operation operation); @Override ResponseEntity<Operation> getOperation(String spaceGuid, String operationId, String embed); @Override ResponseEntity<List<String>> getOperationActions(String spaceGuid, String operationId);  }### Answer:
@Test void testExecuteOperationAction() { String processId = RUNNING_PROCESS; testedClass.executeOperationAction(mockHttpServletRequest(EXAMPLE_USER), SPACE_GUID, processId, Action.ABORT.getActionId()); Mockito.verify(processAction) .execute(Mockito.eq(EXAMPLE_USER), Mockito.eq(processId)); }
@Test void testExecuteOperationActionMissingProcess() { Assertions.assertThrows(NotFoundException.class, () -> testedClass.executeOperationAction(mockHttpServletRequest(EXAMPLE_USER), SPACE_GUID, "notavalidpprocess", Action.ABORT.getActionId())); }
@Test void testExecuteOperationActionInvalidAction() { assertThrows(IllegalArgumentException.class, () -> testedClass.executeOperationAction(mockHttpServletRequest(EXAMPLE_USER), SPACE_GUID, RUNNING_PROCESS, Action.START.getActionId())); }
@Test void testExecuteOperationActionUnauthorized() { Assertions.assertThrows(ResponseStatusException.class, () -> testedClass.executeOperationAction(mockHttpServletRequest(null), SPACE_GUID, RUNNING_PROCESS, Action.ABORT.getActionId())); }