@Test void getNoSqlTables() { CloudNoSqlTables noSqlTables = new CloudNoSqlTables(); PlatformResourceRequest platformResourceRequest = new PlatformResourceRequest(); PlatformNoSqlTablesResponse response = new PlatformNoSqlTablesResponse(); when(platformParameterService.getPlatformResourceRequest(any(), any(), any(), any(), any(), any())).thenReturn(platformResourceRequest); when(platformParameterService.getNoSqlTables(any(PlatformResourceRequest.class))).thenReturn(noSqlTables); when(convertersionService.convert(noSqlTables, PlatformNoSqlTablesResponse.class)).thenReturn(response); doNothing().when(commonPermissionCheckingUtils).checkPermissionForUserOnResource(any(), any(), any()); PlatformNoSqlTablesResponse result = ThreadBasedUserCrnProvider.doAs(USER_CRN, () -> underTest.getNoSqlTables(null, "crn", "region", "aws", "az")); verify(platformParameterService).getNoSqlTables(platformResourceRequest); verify(convertersionService).convert(noSqlTables, PlatformNoSqlTablesResponse.class); assertEquals(response, result); }
@Override @CustomPermissionCheck public PlatformNoSqlTablesResponse getNoSqlTables( String credentialName, String credentialCrn, String region, String platformVariant, String availabilityZone) { customPermissionCheckByCredential(credentialName, credentialCrn); String accountId = getAccountId(); PlatformResourceRequest request = platformParameterService.getPlatformResourceRequest( accountId, credentialName, credentialCrn, region, platformVariant, availabilityZone); LOGGER.info("Get /platform_resources/nosql_tables, request: {}", request); CloudNoSqlTables noSqlTables = platformParameterService.getNoSqlTables(request); PlatformNoSqlTablesResponse response = convertersionService.convert(noSqlTables, PlatformNoSqlTablesResponse.class); LOGGER.info("Resp /platform_resources/nosql_tables, request: {}, noSqlTables: {}, response: {}", request, noSqlTables, response); return response; }
CredentialPlatformResourceController implements CredentialPlatformResourceEndpoint { @Override @CustomPermissionCheck public PlatformNoSqlTablesResponse getNoSqlTables( String credentialName, String credentialCrn, String region, String platformVariant, String availabilityZone) { customPermissionCheckByCredential(credentialName, credentialCrn); String accountId = getAccountId(); PlatformResourceRequest request = platformParameterService.getPlatformResourceRequest( accountId, credentialName, credentialCrn, region, platformVariant, availabilityZone); LOGGER.info("Get /platform_resources/nosql_tables, request: {}", request); CloudNoSqlTables noSqlTables = platformParameterService.getNoSqlTables(request); PlatformNoSqlTablesResponse response = convertersionService.convert(noSqlTables, PlatformNoSqlTablesResponse.class); LOGGER.info("Resp /platform_resources/nosql_tables, request: {}, noSqlTables: {}, response: {}", request, noSqlTables, response); return response; } }
CredentialPlatformResourceController implements CredentialPlatformResourceEndpoint { @Override @CustomPermissionCheck public PlatformNoSqlTablesResponse getNoSqlTables( String credentialName, String credentialCrn, String region, String platformVariant, String availabilityZone) { customPermissionCheckByCredential(credentialName, credentialCrn); String accountId = getAccountId(); PlatformResourceRequest request = platformParameterService.getPlatformResourceRequest( accountId, credentialName, credentialCrn, region, platformVariant, availabilityZone); LOGGER.info("Get /platform_resources/nosql_tables, request: {}", request); CloudNoSqlTables noSqlTables = platformParameterService.getNoSqlTables(request); PlatformNoSqlTablesResponse response = convertersionService.convert(noSqlTables, PlatformNoSqlTablesResponse.class); LOGGER.info("Resp /platform_resources/nosql_tables, request: {}, noSqlTables: {}, response: {}", request, noSqlTables, response); return response; }  }
CredentialPlatformResourceController implements CredentialPlatformResourceEndpoint { @Override @CustomPermissionCheck public PlatformNoSqlTablesResponse getNoSqlTables( String credentialName, String credentialCrn, String region, String platformVariant, String availabilityZone) { customPermissionCheckByCredential(credentialName, credentialCrn); String accountId = getAccountId(); PlatformResourceRequest request = platformParameterService.getPlatformResourceRequest( accountId, credentialName, credentialCrn, region, platformVariant, availabilityZone); LOGGER.info("Get /platform_resources/nosql_tables, request: {}", request); CloudNoSqlTables noSqlTables = platformParameterService.getNoSqlTables(request); PlatformNoSqlTablesResponse response = convertersionService.convert(noSqlTables, PlatformNoSqlTablesResponse.class); LOGGER.info("Resp /platform_resources/nosql_tables, request: {}, noSqlTables: {}, response: {}", request, noSqlTables, response); return response; }  @Override @CustomPermissionCheck PlatformVmtypesResponse getVmTypesByCredential(
            String credentialName,
            String credentialCrn,
            String region,
            String platformVariant,
            String availabilityZone,
            CdpResourceType cdpResourceType); @Override @CustomPermissionCheck RegionResponse getRegionsByCredential(
            String credentialName,
            String credentialCrn,
            String region,
            String platformVariant,
            String availabilityZone,
            boolean availabilityZonesNeeded); @Override @DisableCheckPermissions PlatformDisksResponse getDisktypes(); @Override @CustomPermissionCheck PlatformNetworksResponse getCloudNetworks(
            String credentialName,
            String credentialCrn,
            String region,
            String platformVariant,
            String availabilityZone); @Override @CustomPermissionCheck PlatformIpPoolsResponse getIpPoolsCredentialId(
            String credentialName,
            String credentialCrn,
            String region,
            String platformVariant,
            String availabilityZone); @Override @CustomPermissionCheck PlatformGatewaysResponse getGatewaysCredentialId(
            String credentialName,
            String credentialCrn,
            String region,
            String platformVariant,
            String availabilityZone); @Override @CustomPermissionCheck PlatformEncryptionKeysResponse getEncryptionKeys(
            String credentialName,
            String credentialCrn,
            String region,
            String platformVariant,
            String availabilityZone); @Override @CustomPermissionCheck PlatformSecurityGroupsResponse getSecurityGroups(
            String credentialName,
            String credentialCrn,
            String region,
            String platformVariant,
            String availabilityZone); @Override @CustomPermissionCheck PlatformSshKeysResponse getCloudSshKeys(
            String credentialName,
            String credentialCrn,
            String region,
            String platformVariant,
            String availabilityZone); @Override @CustomPermissionCheck PlatformAccessConfigsResponse getAccessConfigs(
            String credentialName,
            String credentialCrn,
            String region,
            String platformVariant,
            String availabilityZone,
            AccessConfigTypeQueryParam accessConfigType); @Override @DisableCheckPermissions TagSpecificationsResponse getTagSpecifications(); @Override @CustomPermissionCheck PlatformNoSqlTablesResponse getNoSqlTables(
            String credentialName,
            String credentialCrn,
            String region,
            String platformVariant,
            String availabilityZone); @Override @CustomPermissionCheck PlatformResourceGroupsResponse getResourceGroups(
            String credentialName,
            String credentialCrn,
            String region,
            String platformVariant,
            String availabilityZone); }
CredentialPlatformResourceController implements CredentialPlatformResourceEndpoint { @Override @CustomPermissionCheck public PlatformNoSqlTablesResponse getNoSqlTables( String credentialName, String credentialCrn, String region, String platformVariant, String availabilityZone) { customPermissionCheckByCredential(credentialName, credentialCrn); String accountId = getAccountId(); PlatformResourceRequest request = platformParameterService.getPlatformResourceRequest( accountId, credentialName, credentialCrn, region, platformVariant, availabilityZone); LOGGER.info("Get /platform_resources/nosql_tables, request: {}", request); CloudNoSqlTables noSqlTables = platformParameterService.getNoSqlTables(request); PlatformNoSqlTablesResponse response = convertersionService.convert(noSqlTables, PlatformNoSqlTablesResponse.class); LOGGER.info("Resp /platform_resources/nosql_tables, request: {}, noSqlTables: {}, response: {}", request, noSqlTables, response); return response; }  @Override @CustomPermissionCheck PlatformVmtypesResponse getVmTypesByCredential(
            String credentialName,
            String credentialCrn,
            String region,
            String platformVariant,
            String availabilityZone,
            CdpResourceType cdpResourceType); @Override @CustomPermissionCheck RegionResponse getRegionsByCredential(
            String credentialName,
            String credentialCrn,
            String region,
            String platformVariant,
            String availabilityZone,
            boolean availabilityZonesNeeded); @Override @DisableCheckPermissions PlatformDisksResponse getDisktypes(); @Override @CustomPermissionCheck PlatformNetworksResponse getCloudNetworks(
            String credentialName,
            String credentialCrn,
            String region,
            String platformVariant,
            String availabilityZone); @Override @CustomPermissionCheck PlatformIpPoolsResponse getIpPoolsCredentialId(
            String credentialName,
            String credentialCrn,
            String region,
            String platformVariant,
            String availabilityZone); @Override @CustomPermissionCheck PlatformGatewaysResponse getGatewaysCredentialId(
            String credentialName,
            String credentialCrn,
            String region,
            String platformVariant,
            String availabilityZone); @Override @CustomPermissionCheck PlatformEncryptionKeysResponse getEncryptionKeys(
            String credentialName,
            String credentialCrn,
            String region,
            String platformVariant,
            String availabilityZone); @Override @CustomPermissionCheck PlatformSecurityGroupsResponse getSecurityGroups(
            String credentialName,
            String credentialCrn,
            String region,
            String platformVariant,
            String availabilityZone); @Override @CustomPermissionCheck PlatformSshKeysResponse getCloudSshKeys(
            String credentialName,
            String credentialCrn,
            String region,
            String platformVariant,
            String availabilityZone); @Override @CustomPermissionCheck PlatformAccessConfigsResponse getAccessConfigs(
            String credentialName,
            String credentialCrn,
            String region,
            String platformVariant,
            String availabilityZone,
            AccessConfigTypeQueryParam accessConfigType); @Override @DisableCheckPermissions TagSpecificationsResponse getTagSpecifications(); @Override @CustomPermissionCheck PlatformNoSqlTablesResponse getNoSqlTables(
            String credentialName,
            String credentialCrn,
            String region,
            String platformVariant,
            String availabilityZone); @Override @CustomPermissionCheck PlatformResourceGroupsResponse getResourceGroups(
            String credentialName,
            String credentialCrn,
            String region,
            String platformVariant,
            String availabilityZone);  }