### Question:
ErrorToActionStatusMapper { public ActionStatus mapActionStatusError(MessageErrorCode error, boolean withBalance, TypeAccess access) { ActionStatus actionStatus = ActionStatus.FAILURE_ACCOUNT; if (error == MessageErrorCode.ACCESS_EXCEEDED) { actionStatus = ActionStatus.CONSENT_LIMIT_EXCEEDED; } else if (error == MessageErrorCode.CONSENT_EXPIRED) { actionStatus = ActionStatus.CONSENT_INVALID_STATUS; } else if (error.getName().equals(MessageErrorCode.CONSENT_UNKNOWN_400.getName()) && error.getCode() == MessageErrorCode.CONSENT_UNKNOWN_400.getCode()) { actionStatus = ActionStatus.CONSENT_NOT_FOUND; } else if (error.getName().equals(MessageErrorCode.CONSENT_INVALID.getName())) { if (access == TypeAccess.TRANSACTION) { actionStatus = ActionStatus.FAILURE_TRANSACTION; } else if (access == TypeAccess.BALANCE || withBalance) { actionStatus = ActionStatus.FAILURE_BALANCE; } } return actionStatus; }  ActionStatus mapActionStatusError(MessageErrorCode error, boolean withBalance, TypeAccess access);  }### Answer:
@Test void mapActionStatusError() { assertEquals(ActionStatus.CONSENT_LIMIT_EXCEEDED, mapper.mapActionStatusError(MessageErrorCode.ACCESS_EXCEEDED, false, null)); assertEquals(ActionStatus.CONSENT_INVALID_STATUS, mapper.mapActionStatusError(MessageErrorCode.CONSENT_EXPIRED, false, null)); assertEquals(ActionStatus.CONSENT_NOT_FOUND, mapper.mapActionStatusError(MessageErrorCode.CONSENT_UNKNOWN_400, false, null)); assertEquals(ActionStatus.FAILURE_TRANSACTION, mapper.mapActionStatusError(MessageErrorCode.CONSENT_INVALID, false, TypeAccess.TRANSACTION)); assertEquals(ActionStatus.FAILURE_TRANSACTION, mapper.mapActionStatusError(MessageErrorCode.CONSENT_INVALID, true, TypeAccess.TRANSACTION)); assertEquals(ActionStatus.FAILURE_BALANCE, mapper.mapActionStatusError(MessageErrorCode.CONSENT_INVALID, true, TypeAccess.BALANCE)); assertEquals(ActionStatus.FAILURE_BALANCE, mapper.mapActionStatusError(MessageErrorCode.CONSENT_INVALID, false, TypeAccess.BALANCE)); assertEquals(ActionStatus.FAILURE_BALANCE, mapper.mapActionStatusError(MessageErrorCode.CONSENT_INVALID, true, null)); }