@Test void testListWithCrnSetAndNameIsNull() { distroXV1Controller.list(null, CRN); verify(stackOperations, times(1)).listByEnvironmentCrn(WORKSPACE_ID, CRN, List.of(WORKLOAD)); }
@Override @DisableCheckPermissions public StackViewV4Responses list(String environmentName, String environmentCrn) { StackViewV4Responses stackViewV4Responses; List<StackType> stackTypes = List.of(StackType.WORKLOAD); stackViewV4Responses = Strings.isNullOrEmpty(environmentName) ? stackOperations.listByEnvironmentCrn(workspaceService.getForCurrentUser().getId(), environmentCrn, stackTypes) : stackOperations.listByEnvironmentName(workspaceService.getForCurrentUser().getId(), environmentName, stackTypes); return stackViewV4Responses; }
DistroXV1Controller implements DistroXV1Endpoint { @Override @DisableCheckPermissions public StackViewV4Responses list(String environmentName, String environmentCrn) { StackViewV4Responses stackViewV4Responses; List<StackType> stackTypes = List.of(StackType.WORKLOAD); stackViewV4Responses = Strings.isNullOrEmpty(environmentName) ? stackOperations.listByEnvironmentCrn(workspaceService.getForCurrentUser().getId(), environmentCrn, stackTypes) : stackOperations.listByEnvironmentName(workspaceService.getForCurrentUser().getId(), environmentName, stackTypes); return stackViewV4Responses; } }
DistroXV1Controller implements DistroXV1Endpoint { @Override @DisableCheckPermissions public StackViewV4Responses list(String environmentName, String environmentCrn) { StackViewV4Responses stackViewV4Responses; List<StackType> stackTypes = List.of(StackType.WORKLOAD); stackViewV4Responses = Strings.isNullOrEmpty(environmentName) ? stackOperations.listByEnvironmentCrn(workspaceService.getForCurrentUser().getId(), environmentCrn, stackTypes) : stackOperations.listByEnvironmentName(workspaceService.getForCurrentUser().getId(), environmentName, stackTypes); return stackViewV4Responses; }  }
DistroXV1Controller implements DistroXV1Endpoint { @Override @DisableCheckPermissions public StackViewV4Responses list(String environmentName, String environmentCrn) { StackViewV4Responses stackViewV4Responses; List<StackType> stackTypes = List.of(StackType.WORKLOAD); stackViewV4Responses = Strings.isNullOrEmpty(environmentName) ? stackOperations.listByEnvironmentCrn(workspaceService.getForCurrentUser().getId(), environmentCrn, stackTypes) : stackOperations.listByEnvironmentName(workspaceService.getForCurrentUser().getId(), environmentName, stackTypes); return stackViewV4Responses; }  @Override @DisableCheckPermissions StackViewV4Responses list(String environmentName, String environmentCrn); @Override @CheckPermissionByResourceObject(deepSearchNeeded = true) StackV4Response post(@Valid @ResourceObject DistroXV1Request request); @Override @CheckPermissionByResourceName(action = AuthorizationResourceAction.DESCRIBE_DATAHUB) StackV4Response getByName(@ResourceName String name, Set<String> entries); @Override @CheckPermissionByResourceCrn(action = AuthorizationResourceAction.DESCRIBE_DATAHUB) StackV4Response getByCrn(@ResourceCrn @TenantAwareParam String crn, Set<String> entries); @Override @CheckPermissionByResourceName(action = AuthorizationResourceAction.DELETE_DATAHUB) void deleteByName(@ResourceName String name, Boolean forced); @Override @CheckPermissionByResourceCrn(action = AuthorizationResourceAction.DELETE_DATAHUB) void deleteByCrn(@ResourceCrn String crn, Boolean forced); @Override @CheckPermissionByResourceObject void deleteMultiple(@ResourceObject DistroXMultiDeleteV1Request multiDeleteRequest, Boolean forced); @Override @CheckPermissionByResourceName(action = AuthorizationResourceAction.SYNC_DATAHUB) void syncByName(@ResourceName String name); @Override @CheckPermissionByResourceCrn(action = AuthorizationResourceAction.SYNC_DATAHUB) void syncByCrn(@ResourceCrn String crn); @Override @CheckPermissionByResourceName(action = AuthorizationResourceAction.RETRY_DATAHUB_OPERATION) void retryByName(@ResourceName String name); @Override @CheckPermissionByResourceName(action = AuthorizationResourceAction.DESCRIBE_RETRYABLE_DATAHUB_OPERATION) List<RetryableFlowResponse> listRetryableFlows(@ResourceName String name); @Override @CheckPermissionByResourceCrn(action = AuthorizationResourceAction.RETRY_DATAHUB_OPERATION) void retryByCrn(@ResourceCrn String crn); @Override @CheckPermissionByResourceName(action = AuthorizationResourceAction.STOP_DATAHUB) FlowIdentifier putStopByName(@ResourceName String name); @Override @CheckPermissionByResourceCrn(action = AuthorizationResourceAction.STOP_DATAHUB) FlowIdentifier putStopByCrn(@ResourceCrn String crn); @Override @CheckPermissionByResourceNameList(action = AuthorizationResourceAction.STOP_DATAHUB) void putStopByNames(@ResourceNameList List<String> names); @Override @CheckPermissionByResourceCrnList(action = AuthorizationResourceAction.STOP_DATAHUB) void putStopByCrns(@ResourceCrnList List<String> crns); @Override @CheckPermissionByResourceName(action = AuthorizationResourceAction.START_DATAHUB) FlowIdentifier putStartByName(@ResourceName String name); @Override @CheckPermissionByResourceCrn(action = AuthorizationResourceAction.START_DATAHUB) FlowIdentifier putStartByCrn(@ResourceCrn String crn); @Override @CheckPermissionByResourceNameList(action = AuthorizationResourceAction.START_DATAHUB) void putStartByNames(@ResourceNameList List<String> names); @Override @CheckPermissionByResourceCrnList(action = AuthorizationResourceAction.START_DATAHUB) void putStartByCrns(@ResourceCrnList List<String> crns); @Override @CheckPermissionByResourceName(action = AuthorizationResourceAction.SCALE_DATAHUB) FlowIdentifier putScalingByName(@ResourceName String name, @Valid DistroXScaleV1Request updateRequest); @Override @CheckPermissionByResourceCrn(action = AuthorizationResourceAction.SCALE_DATAHUB) void putScalingByCrn(@ResourceCrn String crn, @Valid DistroXScaleV1Request updateRequest); @Override @CheckPermissionByResourceName(action = AuthorizationResourceAction.REPAIR_DATAHUB) void repairClusterByName(@ResourceName String name, @Valid DistroXRepairV1Request clusterRepairRequest); @Override @CheckPermissionByResourceCrn(action = AuthorizationResourceAction.REPAIR_DATALAKE) void repairClusterByCrn(@ResourceCrn String crn, @Valid DistroXRepairV1Request clusterRepairRequest); @Override @DisableCheckPermissions GeneratedBlueprintV4Response postStackForBlueprint(@Valid DistroXV1Request stackRequest); @Override @CheckPermissionByResourceName(action = AuthorizationResourceAction.DESCRIBE_DATAHUB) Object getRequestfromName(@ResourceName String name); @Override @CheckPermissionByResourceCrn(action = AuthorizationResourceAction.DESCRIBE_DATAHUB) Object getRequestfromCrn(@ResourceCrn String crn); @Override @CheckPermissionByResourceName(action = AuthorizationResourceAction.DESCRIBE_DATAHUB) StackStatusV4Response getStatusByName(@ResourceName String name); @Override @CheckPermissionByResourceCrn(action = AuthorizationResourceAction.DESCRIBE_DATAHUB) StackStatusV4Response getStatusByCrn(@ResourceCrn String crn); @Override @CheckPermissionByResourceName(action = AuthorizationResourceAction.DELETE_DATAHUB_INSTANCE) void deleteInstanceByName(@ResourceName String name, Boolean forced, String instanceId); @Override @CheckPermissionByResourceCrn(action = AuthorizationResourceAction.DELETE_DATAHUB_INSTANCE) void deleteInstanceByCrn(@ResourceCrn String crn, Boolean forced, String instanceId); @Override @CheckPermissionByResourceName(action = AuthorizationResourceAction.DELETE_DATAHUB_INSTANCE) void deleteInstancesByName(@ResourceName String name, @NotEmpty List<String> instances, boolean forced); @Override @CheckPermissionByResourceCrn(action = AuthorizationResourceAction.DELETE_DATAHUB_INSTANCE) void deleteInstancesByCrn(@ResourceCrn String crn, @NotEmpty List<String> instances, boolean forced); @Override @CheckPermissionByResourceName(action = AuthorizationResourceAction.SET_DATAHUB_MAINTENANCE_MODE) void setClusterMaintenanceModeByName(@ResourceName String name, @NotNull DistroXMaintenanceModeV1Request maintenanceMode); @Override @CheckPermissionByResourceCrn(action = AuthorizationResourceAction.SET_DATAHUB_MAINTENANCE_MODE) void setClusterMaintenanceModeByCrn(@ResourceCrn String crn, @NotNull DistroXMaintenanceModeV1Request maintenanceMode); @Override @CheckPermissionByResourceName(action = AuthorizationResourceAction.DELETE_DATAHUB) void deleteWithKerberosByName(@ResourceName String name, boolean forced); @Override @CheckPermissionByResourceCrn(action = AuthorizationResourceAction.DELETE_DATAHUB) void deleteWithKerberosByCrn(@ResourceCrn String crn, boolean forced); @Override @CheckPermissionByAccount(action = AuthorizationResourceAction.DATAHUB_READ) Object getCreateAwsClusterForCli(DistroXV1Request request); @Override @CheckPermissionByResourceObject FlowIdentifier collectDiagnostics(@ResourceObject @Valid DiagnosticsCollectionV1Request request); @Override @DisableCheckPermissions VmLogsResponse getVmLogs(); @Override @CheckPermissionByResourceObject FlowIdentifier collectCmDiagnostics(@ResourceObject @Valid CmDiagnosticsCollectionV1Request request); @Override @DisableCheckPermissions List<String> getCmRoles(String stackCrn); }
DistroXV1Controller implements DistroXV1Endpoint { @Override @DisableCheckPermissions public StackViewV4Responses list(String environmentName, String environmentCrn) { StackViewV4Responses stackViewV4Responses; List<StackType> stackTypes = List.of(StackType.WORKLOAD); stackViewV4Responses = Strings.isNullOrEmpty(environmentName) ? stackOperations.listByEnvironmentCrn(workspaceService.getForCurrentUser().getId(), environmentCrn, stackTypes) : stackOperations.listByEnvironmentName(workspaceService.getForCurrentUser().getId(), environmentName, stackTypes); return stackViewV4Responses; }  @Override @DisableCheckPermissions StackViewV4Responses list(String environmentName, String environmentCrn); @Override @CheckPermissionByResourceObject(deepSearchNeeded = true) StackV4Response post(@Valid @ResourceObject DistroXV1Request request); @Override @CheckPermissionByResourceName(action = AuthorizationResourceAction.DESCRIBE_DATAHUB) StackV4Response getByName(@ResourceName String name, Set<String> entries); @Override @CheckPermissionByResourceCrn(action = AuthorizationResourceAction.DESCRIBE_DATAHUB) StackV4Response getByCrn(@ResourceCrn @TenantAwareParam String crn, Set<String> entries); @Override @CheckPermissionByResourceName(action = AuthorizationResourceAction.DELETE_DATAHUB) void deleteByName(@ResourceName String name, Boolean forced); @Override @CheckPermissionByResourceCrn(action = AuthorizationResourceAction.DELETE_DATAHUB) void deleteByCrn(@ResourceCrn String crn, Boolean forced); @Override @CheckPermissionByResourceObject void deleteMultiple(@ResourceObject DistroXMultiDeleteV1Request multiDeleteRequest, Boolean forced); @Override @CheckPermissionByResourceName(action = AuthorizationResourceAction.SYNC_DATAHUB) void syncByName(@ResourceName String name); @Override @CheckPermissionByResourceCrn(action = AuthorizationResourceAction.SYNC_DATAHUB) void syncByCrn(@ResourceCrn String crn); @Override @CheckPermissionByResourceName(action = AuthorizationResourceAction.RETRY_DATAHUB_OPERATION) void retryByName(@ResourceName String name); @Override @CheckPermissionByResourceName(action = AuthorizationResourceAction.DESCRIBE_RETRYABLE_DATAHUB_OPERATION) List<RetryableFlowResponse> listRetryableFlows(@ResourceName String name); @Override @CheckPermissionByResourceCrn(action = AuthorizationResourceAction.RETRY_DATAHUB_OPERATION) void retryByCrn(@ResourceCrn String crn); @Override @CheckPermissionByResourceName(action = AuthorizationResourceAction.STOP_DATAHUB) FlowIdentifier putStopByName(@ResourceName String name); @Override @CheckPermissionByResourceCrn(action = AuthorizationResourceAction.STOP_DATAHUB) FlowIdentifier putStopByCrn(@ResourceCrn String crn); @Override @CheckPermissionByResourceNameList(action = AuthorizationResourceAction.STOP_DATAHUB) void putStopByNames(@ResourceNameList List<String> names); @Override @CheckPermissionByResourceCrnList(action = AuthorizationResourceAction.STOP_DATAHUB) void putStopByCrns(@ResourceCrnList List<String> crns); @Override @CheckPermissionByResourceName(action = AuthorizationResourceAction.START_DATAHUB) FlowIdentifier putStartByName(@ResourceName String name); @Override @CheckPermissionByResourceCrn(action = AuthorizationResourceAction.START_DATAHUB) FlowIdentifier putStartByCrn(@ResourceCrn String crn); @Override @CheckPermissionByResourceNameList(action = AuthorizationResourceAction.START_DATAHUB) void putStartByNames(@ResourceNameList List<String> names); @Override @CheckPermissionByResourceCrnList(action = AuthorizationResourceAction.START_DATAHUB) void putStartByCrns(@ResourceCrnList List<String> crns); @Override @CheckPermissionByResourceName(action = AuthorizationResourceAction.SCALE_DATAHUB) FlowIdentifier putScalingByName(@ResourceName String name, @Valid DistroXScaleV1Request updateRequest); @Override @CheckPermissionByResourceCrn(action = AuthorizationResourceAction.SCALE_DATAHUB) void putScalingByCrn(@ResourceCrn String crn, @Valid DistroXScaleV1Request updateRequest); @Override @CheckPermissionByResourceName(action = AuthorizationResourceAction.REPAIR_DATAHUB) void repairClusterByName(@ResourceName String name, @Valid DistroXRepairV1Request clusterRepairRequest); @Override @CheckPermissionByResourceCrn(action = AuthorizationResourceAction.REPAIR_DATALAKE) void repairClusterByCrn(@ResourceCrn String crn, @Valid DistroXRepairV1Request clusterRepairRequest); @Override @DisableCheckPermissions GeneratedBlueprintV4Response postStackForBlueprint(@Valid DistroXV1Request stackRequest); @Override @CheckPermissionByResourceName(action = AuthorizationResourceAction.DESCRIBE_DATAHUB) Object getRequestfromName(@ResourceName String name); @Override @CheckPermissionByResourceCrn(action = AuthorizationResourceAction.DESCRIBE_DATAHUB) Object getRequestfromCrn(@ResourceCrn String crn); @Override @CheckPermissionByResourceName(action = AuthorizationResourceAction.DESCRIBE_DATAHUB) StackStatusV4Response getStatusByName(@ResourceName String name); @Override @CheckPermissionByResourceCrn(action = AuthorizationResourceAction.DESCRIBE_DATAHUB) StackStatusV4Response getStatusByCrn(@ResourceCrn String crn); @Override @CheckPermissionByResourceName(action = AuthorizationResourceAction.DELETE_DATAHUB_INSTANCE) void deleteInstanceByName(@ResourceName String name, Boolean forced, String instanceId); @Override @CheckPermissionByResourceCrn(action = AuthorizationResourceAction.DELETE_DATAHUB_INSTANCE) void deleteInstanceByCrn(@ResourceCrn String crn, Boolean forced, String instanceId); @Override @CheckPermissionByResourceName(action = AuthorizationResourceAction.DELETE_DATAHUB_INSTANCE) void deleteInstancesByName(@ResourceName String name, @NotEmpty List<String> instances, boolean forced); @Override @CheckPermissionByResourceCrn(action = AuthorizationResourceAction.DELETE_DATAHUB_INSTANCE) void deleteInstancesByCrn(@ResourceCrn String crn, @NotEmpty List<String> instances, boolean forced); @Override @CheckPermissionByResourceName(action = AuthorizationResourceAction.SET_DATAHUB_MAINTENANCE_MODE) void setClusterMaintenanceModeByName(@ResourceName String name, @NotNull DistroXMaintenanceModeV1Request maintenanceMode); @Override @CheckPermissionByResourceCrn(action = AuthorizationResourceAction.SET_DATAHUB_MAINTENANCE_MODE) void setClusterMaintenanceModeByCrn(@ResourceCrn String crn, @NotNull DistroXMaintenanceModeV1Request maintenanceMode); @Override @CheckPermissionByResourceName(action = AuthorizationResourceAction.DELETE_DATAHUB) void deleteWithKerberosByName(@ResourceName String name, boolean forced); @Override @CheckPermissionByResourceCrn(action = AuthorizationResourceAction.DELETE_DATAHUB) void deleteWithKerberosByCrn(@ResourceCrn String crn, boolean forced); @Override @CheckPermissionByAccount(action = AuthorizationResourceAction.DATAHUB_READ) Object getCreateAwsClusterForCli(DistroXV1Request request); @Override @CheckPermissionByResourceObject FlowIdentifier collectDiagnostics(@ResourceObject @Valid DiagnosticsCollectionV1Request request); @Override @DisableCheckPermissions VmLogsResponse getVmLogs(); @Override @CheckPermissionByResourceObject FlowIdentifier collectCmDiagnostics(@ResourceObject @Valid CmDiagnosticsCollectionV1Request request); @Override @DisableCheckPermissions List<String> getCmRoles(String stackCrn);  }