@Test void testGetPrerequisitesForCloudPlatform() { CredentialPrerequisitesResponse credentialPrerequisitesResponse = mock(CredentialPrerequisitesResponse.class); when(credentialService.getPrerequisites(PLATFORM, DEPLOYMENT_ADDRESS, USER_CRN, CredentialType.AUDIT)) .thenReturn(credentialPrerequisitesResponse); CredentialPrerequisitesResponse response = ThreadBasedUserCrnProvider.doAs(USER_CRN, () -> underTest.getPrerequisitesForCloudPlatform(PLATFORM, DEPLOYMENT_ADDRESS)); assertThat(response).isEqualTo(credentialPrerequisitesResponse); }
@Override @CheckPermissionByAccount(action = AuthorizationResourceAction.CREATE_AUDIT_CREDENTIAL) public CredentialPrerequisitesResponse getPrerequisitesForCloudPlatform(String platform, String deploymentAddress) { String userCrn = ThreadBasedUserCrnProvider.getUserCrn(); return credentialService.getPrerequisites(platform, deploymentAddress, userCrn, AUDIT); }
AuditCredentialV1Controller extends NotificationController implements AuditCredentialEndpoint { @Override @CheckPermissionByAccount(action = AuthorizationResourceAction.CREATE_AUDIT_CREDENTIAL) public CredentialPrerequisitesResponse getPrerequisitesForCloudPlatform(String platform, String deploymentAddress) { String userCrn = ThreadBasedUserCrnProvider.getUserCrn(); return credentialService.getPrerequisites(platform, deploymentAddress, userCrn, AUDIT); } }
AuditCredentialV1Controller extends NotificationController implements AuditCredentialEndpoint { @Override @CheckPermissionByAccount(action = AuthorizationResourceAction.CREATE_AUDIT_CREDENTIAL) public CredentialPrerequisitesResponse getPrerequisitesForCloudPlatform(String platform, String deploymentAddress) { String userCrn = ThreadBasedUserCrnProvider.getUserCrn(); return credentialService.getPrerequisites(platform, deploymentAddress, userCrn, AUDIT); } AuditCredentialV1Controller(
            CredentialService credentialService,
            CredentialToCredentialV1ResponseConverter credentialConverter,
            CredentialDeleteService credentialDeleteService); }
AuditCredentialV1Controller extends NotificationController implements AuditCredentialEndpoint { @Override @CheckPermissionByAccount(action = AuthorizationResourceAction.CREATE_AUDIT_CREDENTIAL) public CredentialPrerequisitesResponse getPrerequisitesForCloudPlatform(String platform, String deploymentAddress) { String userCrn = ThreadBasedUserCrnProvider.getUserCrn(); return credentialService.getPrerequisites(platform, deploymentAddress, userCrn, AUDIT); } AuditCredentialV1Controller(
            CredentialService credentialService,
            CredentialToCredentialV1ResponseConverter credentialConverter,
            CredentialDeleteService credentialDeleteService); @Override @CheckPermissionByAccount(action = AuthorizationResourceAction.DESCRIBE_AUDIT_CREDENTIAL) CredentialResponses list(); @Override @CheckPermissionByAccount(action = AuthorizationResourceAction.DESCRIBE_AUDIT_CREDENTIAL) CredentialResponse getByResourceCrn(@TenantAwareParam String credentialCrn); @Override @CheckPermissionByAccount(action = AuthorizationResourceAction.DESCRIBE_AUDIT_CREDENTIAL) CredentialResponse getByResourceName(String credentialName, @AccountId String accountId); @Override @CheckPermissionByAccount(action = AuthorizationResourceAction.CREATE_AUDIT_CREDENTIAL) CredentialResponse post(@Valid CredentialRequest request); @Override @CheckPermissionByAccount(action = AuthorizationResourceAction.MODIFY_AUDIT_CREDENTIAL) CredentialResponse put(@Valid CredentialRequest credentialRequest); @Override @CheckPermissionByAccount(action = AuthorizationResourceAction.CREATE_AUDIT_CREDENTIAL) CredentialPrerequisitesResponse getPrerequisitesForCloudPlatform(String platform, String deploymentAddress); @Override @CheckPermissionByAccount(action = AuthorizationResourceAction.CREATE_AUDIT_CREDENTIAL) CredentialResponse deleteByName(String name); @Override @CheckPermissionByAccount(action = AuthorizationResourceAction.CREATE_AUDIT_CREDENTIAL) CredentialResponse deleteByResourceCrn(String crn); }
AuditCredentialV1Controller extends NotificationController implements AuditCredentialEndpoint { @Override @CheckPermissionByAccount(action = AuthorizationResourceAction.CREATE_AUDIT_CREDENTIAL) public CredentialPrerequisitesResponse getPrerequisitesForCloudPlatform(String platform, String deploymentAddress) { String userCrn = ThreadBasedUserCrnProvider.getUserCrn(); return credentialService.getPrerequisites(platform, deploymentAddress, userCrn, AUDIT); } AuditCredentialV1Controller(
            CredentialService credentialService,
            CredentialToCredentialV1ResponseConverter credentialConverter,
            CredentialDeleteService credentialDeleteService); @Override @CheckPermissionByAccount(action = AuthorizationResourceAction.DESCRIBE_AUDIT_CREDENTIAL) CredentialResponses list(); @Override @CheckPermissionByAccount(action = AuthorizationResourceAction.DESCRIBE_AUDIT_CREDENTIAL) CredentialResponse getByResourceCrn(@TenantAwareParam String credentialCrn); @Override @CheckPermissionByAccount(action = AuthorizationResourceAction.DESCRIBE_AUDIT_CREDENTIAL) CredentialResponse getByResourceName(String credentialName, @AccountId String accountId); @Override @CheckPermissionByAccount(action = AuthorizationResourceAction.CREATE_AUDIT_CREDENTIAL) CredentialResponse post(@Valid CredentialRequest request); @Override @CheckPermissionByAccount(action = AuthorizationResourceAction.MODIFY_AUDIT_CREDENTIAL) CredentialResponse put(@Valid CredentialRequest credentialRequest); @Override @CheckPermissionByAccount(action = AuthorizationResourceAction.CREATE_AUDIT_CREDENTIAL) CredentialPrerequisitesResponse getPrerequisitesForCloudPlatform(String platform, String deploymentAddress); @Override @CheckPermissionByAccount(action = AuthorizationResourceAction.CREATE_AUDIT_CREDENTIAL) CredentialResponse deleteByName(String name); @Override @CheckPermissionByAccount(action = AuthorizationResourceAction.CREATE_AUDIT_CREDENTIAL) CredentialResponse deleteByResourceCrn(String crn);  }