From 69e9c77e1572baeeb7ca520179f9afc52c1c3572 Mon Sep 17 00:00:00 2001 From: Ben Buchanan Date: Thu, 13 Mar 2025 10:03:28 -0400 Subject: [PATCH 1/2] fix(GlobalCatalog): regen after api def fixes Signed-off-by: Ben Buchanan --- .../v1/GlobalCatalogExamples.java | 47 +- .../global_catalog/v1/GlobalCatalog.java | 52 +- .../v1/model/AliasMetaData.java | 10 +- .../global_catalog/v1/model/Amount.java | 14 +- .../global_catalog/v1/model/Artifact.java | 5 +- .../global_catalog/v1/model/Artifacts.java | 5 +- .../v1/model/AuditSearchResult.java | 5 +- .../global_catalog/v1/model/Broker.java | 10 +- .../global_catalog/v1/model/Bullets.java | 10 +- .../global_catalog/v1/model/CFMetaData.java | 14 +- .../global_catalog/v1/model/Callbacks.java | 10 +- .../global_catalog/v1/model/CatalogEntry.java | 29 +- .../v1/model/CatalogEntryMetadata.java | 5 +- .../model/CatalogEntryMetadataDeployment.java | 5 +- .../v1/model/CatalogEntryMetadataPricing.java | 58 +- .../v1/model/CreateCatalogEntryOptions.java | 40 +- .../global_catalog/v1/model/DRMetaData.java | 10 +- .../v1/model/DeleteArtifactOptions.java | 10 +- .../v1/model/DeleteCatalogEntryOptions.java | 10 +- .../v1/model/DeploymentBase.java | 10 +- .../v1/model/EntrySearchResult.java | 5 +- .../v1/model/GetArtifactOptions.java | 12 +- .../v1/model/GetAuditLogsOptions.java | 10 +- .../v1/model/GetCatalogEntryOptions.java | 16 +- .../v1/model/GetChildObjectsOptions.java | 14 +- .../model/GetPricingDeploymentsOptions.java | 132 ++ .../v1/model/GetPricingOptions.java | 37 +- .../v1/model/GetVisibilityOptions.java | 10 +- .../global_catalog/v1/model/Image.java | 10 +- .../v1/model/ListArtifactsOptions.java | 10 +- .../v1/model/ListCatalogEntriesOptions.java | 14 +- .../global_catalog/v1/model/Message.java | 5 +- .../global_catalog/v1/model/Metrics.java | 9 +- .../v1/model/ObjectMetadataSet.java | 14 +- .../global_catalog/v1/model/Overview.java | 10 +- .../global_catalog/v1/model/PlanMetaData.java | 10 +- .../global_catalog/v1/model/Price.java | 11 +- .../global_catalog/v1/model/PricingGet.java | 58 +- .../v1/model/PricingSearchResult.java | 138 ++ .../global_catalog/v1/model/PricingSet.java | 10 +- .../global_catalog/v1/model/Provider.java | 10 +- .../v1/model/RestoreCatalogEntryOptions.java | 10 +- .../global_catalog/v1/model/SLAMetaData.java | 26 +- .../v1/model/SourceMetaData.java | 10 +- .../v1/model/StartingPrice.java | 14 +- .../global_catalog/v1/model/Strings.java | 18 +- .../v1/model/TemplateMetaData.java | 14 +- .../v1/model/UIMediaSourceMetaData.java | 119 ++ .../global_catalog/v1/model/UIMetaData.java | 16 +- .../global_catalog/v1/model/UIMetaMedia.java | 40 +- .../global_catalog/v1/model/URLS.java | 10 +- .../v1/model/UpdateCatalogEntryOptions.java | 40 +- .../v1/model/UpdateVisibilityOptions.java | 10 +- .../v1/model/UploadArtifactOptions.java | 10 +- .../global_catalog/v1/model/Visibility.java | 10 +- .../v1/model/VisibilityDetail.java | 10 +- .../v1/model/VisibilityDetailAccounts.java | 10 +- .../global_catalog/v1/package-info.java | 5 +- .../global_catalog/v1/GlobalCatalogIT.java | 90 +- .../global_catalog/v1/GlobalCatalogTest.java | 1726 +++++++++-------- .../v1/model/AliasMetaDataTest.java | 2 +- .../global_catalog/v1/model/AmountTest.java | 8 +- .../global_catalog/v1/model/ArtifactTest.java | 2 +- .../v1/model/ArtifactsTest.java | 2 +- .../v1/model/AuditSearchResultTest.java | 2 +- .../global_catalog/v1/model/BrokerTest.java | 2 +- .../global_catalog/v1/model/BulletsTest.java | 2 +- .../v1/model/CFMetaDataTest.java | 12 +- .../v1/model/CallbacksTest.java | 6 +- .../CatalogEntryMetadataDeploymentTest.java | 2 +- .../CatalogEntryMetadataPricingTest.java | 8 +- .../v1/model/CatalogEntryMetadataTest.java | 5 +- .../v1/model/CatalogEntryTest.java | 5 +- .../model/CreateCatalogEntryOptionsTest.java | 90 +- .../v1/model/DRMetaDataTest.java | 2 +- .../v1/model/DeleteArtifactOptionsTest.java | 2 +- .../model/DeleteCatalogEntryOptionsTest.java | 2 +- .../v1/model/DeploymentBaseTest.java | 2 +- .../v1/model/EntrySearchResultTest.java | 5 +- .../v1/model/GetArtifactOptionsTest.java | 2 +- .../v1/model/GetAuditLogsOptionsTest.java | 14 +- .../v1/model/GetCatalogEntryOptionsTest.java | 2 +- .../v1/model/GetChildObjectsOptionsTest.java | 10 +- .../GetPricingDeploymentsOptionsTest.java | 47 + .../v1/model/GetPricingOptionsTest.java | 4 +- .../v1/model/GetVisibilityOptionsTest.java | 2 +- .../global_catalog/v1/model/ImageTest.java | 2 +- .../v1/model/ListArtifactsOptionsTest.java | 2 +- .../model/ListCatalogEntriesOptionsTest.java | 10 +- .../global_catalog/v1/model/MessageTest.java | 2 +- .../global_catalog/v1/model/MetricsTest.java | 4 +- .../v1/model/ObjectMetadataSetTest.java | 81 +- .../global_catalog/v1/model/OverviewTest.java | 2 +- .../v1/model/PlanMetaDataTest.java | 6 +- .../global_catalog/v1/model/PriceTest.java | 2 +- .../v1/model/PricingGetTest.java | 8 +- .../v1/model/PricingSearchResultTest.java | 51 + .../v1/model/PricingSetTest.java | 12 +- .../global_catalog/v1/model/ProviderTest.java | 2 +- .../model/RestoreCatalogEntryOptionsTest.java | 2 +- .../v1/model/SLAMetaDataTest.java | 14 +- .../v1/model/SourceMetaDataTest.java | 2 +- .../v1/model/StartingPriceTest.java | 12 +- .../global_catalog/v1/model/StringsTest.java | 24 +- .../v1/model/TemplateMetaDataTest.java | 12 +- .../v1/model/UIMediaSourceMetaDataTest.java | 48 + .../v1/model/UIMetaDataTest.java | 32 +- .../v1/model/UIMetaMediaTest.java | 23 +- .../global_catalog/v1/model/URLSTest.java | 2 +- .../model/UpdateCatalogEntryOptionsTest.java | 90 +- .../v1/model/UpdateVisibilityOptionsTest.java | 2 +- .../v1/model/UploadArtifactOptionsTest.java | 2 +- .../model/VisibilityDetailAccountsTest.java | 2 +- .../v1/model/VisibilityDetailTest.java | 2 +- .../v1/model/VisibilityTest.java | 2 +- .../v1/utils/TestUtilities.java | 8 +- 116 files changed, 2520 insertions(+), 1277 deletions(-) create mode 100644 modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/GetPricingDeploymentsOptions.java create mode 100644 modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/PricingSearchResult.java create mode 100644 modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/UIMediaSourceMetaData.java create mode 100644 modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/GetPricingDeploymentsOptionsTest.java create mode 100644 modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/PricingSearchResultTest.java create mode 100644 modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/UIMediaSourceMetaDataTest.java diff --git a/modules/examples/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/GlobalCatalogExamples.java b/modules/examples/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/GlobalCatalogExamples.java index 4e7780c7ab..6ab2fb7add 100644 --- a/modules/examples/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/GlobalCatalogExamples.java +++ b/modules/examples/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/GlobalCatalogExamples.java @@ -13,6 +13,17 @@ package com.ibm.cloud.platform_services.global_catalog.v1; +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.nio.charset.StandardCharsets; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + +import org.apache.commons.io.IOUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import com.ibm.cloud.platform_services.global_catalog.v1.model.Artifacts; import com.ibm.cloud.platform_services.global_catalog.v1.model.AuditSearchResult; import com.ibm.cloud.platform_services.global_catalog.v1.model.CatalogEntry; @@ -24,14 +35,12 @@ import com.ibm.cloud.platform_services.global_catalog.v1.model.GetAuditLogsOptions; import com.ibm.cloud.platform_services.global_catalog.v1.model.GetCatalogEntryOptions; import com.ibm.cloud.platform_services.global_catalog.v1.model.GetChildObjectsOptions; -import com.ibm.cloud.platform_services.global_catalog.v1.model.GetPricingOptions; import com.ibm.cloud.platform_services.global_catalog.v1.model.GetVisibilityOptions; import com.ibm.cloud.platform_services.global_catalog.v1.model.Image; import com.ibm.cloud.platform_services.global_catalog.v1.model.ListArtifactsOptions; import com.ibm.cloud.platform_services.global_catalog.v1.model.ListCatalogEntriesOptions; import com.ibm.cloud.platform_services.global_catalog.v1.model.ObjectMetadataSet; import com.ibm.cloud.platform_services.global_catalog.v1.model.Overview; -import com.ibm.cloud.platform_services.global_catalog.v1.model.PricingGet; import com.ibm.cloud.platform_services.global_catalog.v1.model.Provider; import com.ibm.cloud.platform_services.global_catalog.v1.model.RestoreCatalogEntryOptions; import com.ibm.cloud.platform_services.global_catalog.v1.model.UpdateCatalogEntryOptions; @@ -41,17 +50,6 @@ import com.ibm.cloud.sdk.core.http.Response; import com.ibm.cloud.sdk.core.service.exception.ServiceResponseException; -import java.io.ByteArrayInputStream; -import java.io.InputStream; -import java.nio.charset.StandardCharsets; -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; - -import org.apache.commons.io.IOUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - // // This file provides an example of how to use the Global Catalog service. // @@ -80,6 +78,7 @@ public static void main(String[] args) throws Exception { GlobalCatalog service = GlobalCatalog.newInstance(); String catalogEntryId = ""; + CatalogEntry fetchedObject = null; try { System.out.println("createCatalogEntry() result:"); @@ -153,6 +152,7 @@ public static void main(String[] args) throws Exception { Response response = service.getCatalogEntry(getCatalogEntryOptions).execute(); CatalogEntry catalogEntry = response.getResult(); + fetchedObject = catalogEntry; System.out.println(catalogEntry); @@ -208,6 +208,7 @@ public static void main(String[] args) throws Exception { .provider(providerModel) .active(true) .metadata(metadataModel) + .url(fetchedObject.getUrl()) .build(); Response response = service.updateCatalogEntry(updateCatalogEntryOptions).execute(); @@ -324,26 +325,6 @@ public static void main(String[] args) throws Exception { System.out.println("updateVisibility returned the following error: " + e.getMessage()); } - try { - System.out.println("getPricing() result:"); - - // begin-get_pricing - - GetPricingOptions getPricingOptions = new GetPricingOptions.Builder() - .id(catalogEntryId).build(); - - Response response = service.getPricing(getPricingOptions).execute(); - PricingGet pricingGet = response.getResult(); - - System.out.println(pricingGet); - - // end-get_pricing - - } catch (ServiceResponseException e) { - logger.error(String.format("Service returned status code %s: %s\nError details: %s", e.getStatusCode(), - e.getMessage(), e.getDebuggingInfo()), e); - } - try { System.out.println("getAuditLogs() result:"); diff --git a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/GlobalCatalog.java b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/GlobalCatalog.java index b8fbe7e54b..e5939f1978 100644 --- a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/GlobalCatalog.java +++ b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/GlobalCatalog.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -12,7 +12,7 @@ */ /* - * IBM OpenAPI SDK Code Generator Version: 99-SNAPSHOT-4c92c221-20210211-060810 + * IBM OpenAPI SDK Code Generator Version: 3.102.0-615ec964-20250307-203034 */ package com.ibm.cloud.platform_services.global_catalog.v1; @@ -30,11 +30,13 @@ import com.ibm.cloud.platform_services.global_catalog.v1.model.GetAuditLogsOptions; import com.ibm.cloud.platform_services.global_catalog.v1.model.GetCatalogEntryOptions; import com.ibm.cloud.platform_services.global_catalog.v1.model.GetChildObjectsOptions; +import com.ibm.cloud.platform_services.global_catalog.v1.model.GetPricingDeploymentsOptions; import com.ibm.cloud.platform_services.global_catalog.v1.model.GetPricingOptions; import com.ibm.cloud.platform_services.global_catalog.v1.model.GetVisibilityOptions; import com.ibm.cloud.platform_services.global_catalog.v1.model.ListArtifactsOptions; import com.ibm.cloud.platform_services.global_catalog.v1.model.ListCatalogEntriesOptions; import com.ibm.cloud.platform_services.global_catalog.v1.model.PricingGet; +import com.ibm.cloud.platform_services.global_catalog.v1.model.PricingSearchResult; import com.ibm.cloud.platform_services.global_catalog.v1.model.RestoreCatalogEntryOptions; import com.ibm.cloud.platform_services.global_catalog.v1.model.UpdateCatalogEntryOptions; import com.ibm.cloud.platform_services.global_catalog.v1.model.UpdateVisibilityOptions; @@ -60,12 +62,18 @@ * regions, and more. For more information, see the [catalog * documentation](https://cloud.ibm.com/docs/overview/catalog.html#global-catalog-overview). * - * @version v1 + * API Version: 1.0.3 */ public class GlobalCatalog extends BaseService { + /** + * Default service name used when configuring the `GlobalCatalog` client. + */ public static final String DEFAULT_SERVICE_NAME = "global_catalog"; + /** + * Default service endpoint URL. + */ public static final String DEFAULT_SERVICE_URL = "https://globalcatalog.cloud.ibm.com/api/v1"; /** @@ -208,6 +216,9 @@ public ServiceCall createCatalogEntry(CreateCatalogEntryOptions cr if (createCatalogEntryOptions.active() != null) { contentJson.addProperty("active", createCatalogEntryOptions.active()); } + if (createCatalogEntryOptions.url() != null) { + contentJson.addProperty("url", createCatalogEntryOptions.url()); + } if (createCatalogEntryOptions.metadata() != null) { contentJson.add("metadata", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createCatalogEntryOptions.metadata())); } @@ -301,6 +312,9 @@ public ServiceCall updateCatalogEntry(UpdateCatalogEntryOptions up if (updateCatalogEntryOptions.active() != null) { contentJson.addProperty("active", updateCatalogEntryOptions.active()); } + if (updateCatalogEntryOptions.url() != null) { + contentJson.addProperty("url", updateCatalogEntryOptions.url()); + } if (updateCatalogEntryOptions.metadata() != null) { contentJson.add("metadata", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(updateCatalogEntryOptions.metadata())); } @@ -507,11 +521,43 @@ public ServiceCall getPricing(GetPricingOptions getPricingOptions) { if (getPricingOptions.account() != null) { builder.query("account", String.valueOf(getPricingOptions.account())); } + if (getPricingOptions.deploymentRegion() != null) { + builder.query("deployment_region", String.valueOf(getPricingOptions.deploymentRegion())); + } ResponseConverter responseConverter = ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } + /** + * Get the pricing deployments for a plan. + * + * This endpoint returns the deployment pricing for a plan. For a plan it returns a pricing for each visible child + * deployment object. Static pricing is defined in the catalog. Dynamic pricing is stored in IBM Cloud Pricing + * Catalog. This can be used by an unauthenticated user for publicly available services. + * + * @param getPricingDeploymentsOptions the {@link GetPricingDeploymentsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link PricingSearchResult} + */ + public ServiceCall getPricingDeployments(GetPricingDeploymentsOptions getPricingDeploymentsOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getPricingDeploymentsOptions, + "getPricingDeploymentsOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("id", getPricingDeploymentsOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/{id}/pricing/deployment", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("global_catalog", "v1", "getPricingDeployments"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + if (getPricingDeploymentsOptions.account() != null) { + builder.query("account", String.valueOf(getPricingDeploymentsOptions.account())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + /** * Get the audit logs for an object. * diff --git a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/AliasMetaData.java b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/AliasMetaData.java index 6323b3354f..3aaca9a4bb 100644 --- a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/AliasMetaData.java +++ b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/AliasMetaData.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_catalog.v1.model; import com.google.gson.annotations.SerializedName; @@ -31,6 +32,11 @@ public static class Builder { private String type; private String planId; + /** + * Instantiates a new Builder from an existing AliasMetaData instance. + * + * @param aliasMetaData the instance to initialize the Builder with + */ private Builder(AliasMetaData aliasMetaData) { this.type = aliasMetaData.type; this.planId = aliasMetaData.planId; @@ -74,6 +80,8 @@ public Builder planId(String planId) { } } + protected AliasMetaData() { } + protected AliasMetaData(Builder builder) { type = builder.type; planId = builder.planId; diff --git a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/Amount.java b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/Amount.java index a2e594776b..a8cbd568ea 100644 --- a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/Amount.java +++ b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/Amount.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_catalog.v1.model; import java.util.ArrayList; @@ -34,6 +35,11 @@ public static class Builder { private String currency; private List prices; + /** + * Instantiates a new Builder from an existing Amount instance. + * + * @param amount the instance to initialize the Builder with + */ private Builder(Amount amount) { this.country = amount.country; this.currency = amount.currency; @@ -56,9 +62,9 @@ public Amount build() { } /** - * Adds an prices to prices. + * Adds a new element to prices. * - * @param prices the new prices + * @param prices the new element to be added * @return the Amount builder */ public Builder addPrices(Price prices) { @@ -106,6 +112,8 @@ public Builder prices(List prices) { } } + protected Amount() { } + protected Amount(Builder builder) { country = builder.country; currency = builder.currency; diff --git a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/Artifact.java b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/Artifact.java index ef235335f9..892e227a6b 100644 --- a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/Artifact.java +++ b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/Artifact.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_catalog.v1.model; import java.util.Date; @@ -27,6 +28,8 @@ public class Artifact extends GenericModel { protected String etag; protected Long size; + protected Artifact() { } + /** * Gets the name. * diff --git a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/Artifacts.java b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/Artifacts.java index 55ce60edd2..040ff6db00 100644 --- a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/Artifacts.java +++ b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/Artifacts.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_catalog.v1.model; import java.util.List; @@ -24,6 +25,8 @@ public class Artifacts extends GenericModel { protected Long count; protected List resources; + protected Artifacts() { } + /** * Gets the count. * diff --git a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/AuditSearchResult.java b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/AuditSearchResult.java index 9f96775783..5d75a6148e 100644 --- a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/AuditSearchResult.java +++ b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/AuditSearchResult.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_catalog.v1.model; import java.util.List; @@ -33,6 +34,8 @@ public class AuditSearchResult extends GenericModel { protected String next; protected List resources; + protected AuditSearchResult() { } + /** * Gets the offset. * diff --git a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/Broker.java b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/Broker.java index 92fa79fedf..4596e0b63b 100644 --- a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/Broker.java +++ b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/Broker.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_catalog.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; @@ -29,6 +30,11 @@ public static class Builder { private String name; private String guid; + /** + * Instantiates a new Builder from an existing Broker instance. + * + * @param broker the instance to initialize the Builder with + */ private Builder(Broker broker) { this.name = broker.name; this.guid = broker.guid; @@ -72,6 +78,8 @@ public Builder guid(String guid) { } } + protected Broker() { } + protected Broker(Builder builder) { name = builder.name; guid = builder.guid; diff --git a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/Bullets.java b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/Bullets.java index 2a1e7891a0..53144f3781 100644 --- a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/Bullets.java +++ b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/Bullets.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_catalog.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; @@ -33,6 +34,11 @@ public static class Builder { private String icon; private Long quantity; + /** + * Instantiates a new Builder from an existing Bullets instance. + * + * @param bullets the instance to initialize the Builder with + */ private Builder(Bullets bullets) { this.title = bullets.title; this.description = bullets.description; @@ -100,6 +106,8 @@ public Builder quantity(long quantity) { } } + protected Bullets() { } + protected Bullets(Builder builder) { title = builder.title; description = builder.description; diff --git a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/CFMetaData.java b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/CFMetaData.java index 92f5ae4ceb..307b756c26 100644 --- a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/CFMetaData.java +++ b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/CFMetaData.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_catalog.v1.model; import java.util.ArrayList; @@ -67,6 +68,11 @@ public static class Builder { private Boolean serviceKeySupported; private Map cfGuid; + /** + * Instantiates a new Builder from an existing CFMetaData instance. + * + * @param cfMetaData the instance to initialize the Builder with + */ private Builder(CFMetaData cfMetaData) { this.type = cfMetaData.type; this.iamCompatible = cfMetaData.iamCompatible; @@ -100,9 +106,9 @@ public CFMetaData build() { } /** - * Adds an requires to requires. + * Adds a new element to requires. * - * @param requires the new requires + * @param requires the new element to be added * @return the CFMetaData builder */ public Builder addRequires(String requires) { @@ -271,6 +277,8 @@ public Builder cfGuid(Map cfGuid) { } } + protected CFMetaData() { } + protected CFMetaData(Builder builder) { type = builder.type; iamCompatible = builder.iamCompatible; diff --git a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/Callbacks.java b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/Callbacks.java index 0b26c4a818..149279f750 100644 --- a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/Callbacks.java +++ b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/Callbacks.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_catalog.v1.model; import java.util.Map; @@ -58,6 +59,11 @@ public static class Builder { private String serviceMonitorApp; private Map apiEndpoint; + /** + * Instantiates a new Builder from an existing Callbacks instance. + * + * @param callbacks the instance to initialize the Builder with + */ private Builder(Callbacks callbacks) { this.controllerUrl = callbacks.controllerUrl; this.brokerUrl = callbacks.brokerUrl; @@ -197,6 +203,8 @@ public Builder apiEndpoint(Map apiEndpoint) { } } + protected Callbacks() { } + protected Callbacks(Builder builder) { controllerUrl = builder.controllerUrl; brokerUrl = builder.brokerUrl; diff --git a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/CatalogEntry.java b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/CatalogEntry.java index c9b58867b5..732128fb29 100644 --- a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/CatalogEntry.java +++ b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/CatalogEntry.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_catalog.v1.model; import java.util.Date; @@ -49,11 +50,11 @@ public interface Kind { protected Boolean group; protected Provider provider; protected Boolean active; + protected String url; protected CatalogEntryMetadata metadata; protected String id; @SerializedName("catalog_crn") protected String catalogCrn; - protected String url; @SerializedName("children_url") protected String childrenUrl; @SerializedName("geo_tags") @@ -63,6 +64,8 @@ public interface Kind { protected Date created; protected Date updated; + protected CatalogEntry() { } + /** * Gets the name. * @@ -176,6 +179,17 @@ public Boolean isActive() { return active; } + /** + * Gets the url. + * + * URL to get details about this object. + * + * @return the url + */ + public String getUrl() { + return url; + } + /** * Gets the metadata. * @@ -209,17 +223,6 @@ public String getCatalogCrn() { return catalogCrn; } - /** - * Gets the url. - * - * URL to get details about this object. - * - * @return the url - */ - public String getUrl() { - return url; - } - /** * Gets the childrenUrl. * diff --git a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/CatalogEntryMetadata.java b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/CatalogEntryMetadata.java index a9499e49d1..b44ed88b8f 100644 --- a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/CatalogEntryMetadata.java +++ b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/CatalogEntryMetadata.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_catalog.v1.model; import java.util.List; @@ -40,6 +41,8 @@ public class CatalogEntryMetadata extends GenericModel { protected CatalogEntryMetadataPricing pricing; protected CatalogEntryMetadataDeployment deployment; + protected CatalogEntryMetadata() { } + /** * Gets the rcCompatible. * diff --git a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/CatalogEntryMetadataDeployment.java b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/CatalogEntryMetadataDeployment.java index d39b6e99e8..175a3501c5 100644 --- a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/CatalogEntryMetadataDeployment.java +++ b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/CatalogEntryMetadataDeployment.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_catalog.v1.model; import com.google.gson.annotations.SerializedName; @@ -37,6 +38,8 @@ public class CatalogEntryMetadataDeployment extends GenericModel { @SerializedName("target_network") protected String targetNetwork; + protected CatalogEntryMetadataDeployment() { } + /** * Gets the location. * diff --git a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/CatalogEntryMetadataPricing.java b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/CatalogEntryMetadataPricing.java index 9bac3990c5..3852da78b1 100644 --- a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/CatalogEntryMetadataPricing.java +++ b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/CatalogEntryMetadataPricing.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_catalog.v1.model; import java.util.List; @@ -26,7 +27,17 @@ public class CatalogEntryMetadataPricing extends GenericModel { protected String origin; @SerializedName("starting_price") protected StartingPrice startingPrice; + @SerializedName("deployment_id") + protected String deploymentId; + @SerializedName("deployment_location") + protected String deploymentLocation; + @SerializedName("deployment_location_no_price_available") + protected Boolean deploymentLocationNoPriceAvailable; protected List metrics; + @SerializedName("deployment_regions") + protected List deploymentRegions; + + protected CatalogEntryMetadataPricing() { } /** * Gets the type. @@ -61,6 +72,40 @@ public StartingPrice getStartingPrice() { return startingPrice; } + /** + * Gets the deploymentId. + * + * The deployment object id this pricing is from. Only set if object kind is deployment. + * + * @return the deploymentId + */ + public String getDeploymentId() { + return deploymentId; + } + + /** + * Gets the deploymentLocation. + * + * The deployment location this pricing is from. Only set if object kind is deployment. + * + * @return the deploymentLocation + */ + public String getDeploymentLocation() { + return deploymentLocation; + } + + /** + * Gets the deploymentLocationNoPriceAvailable. + * + * Is the location price not available. Only set in api /pricing/deployment and only set if true. This means for the + * given deployment object there was no pricing set in pricing catalog. + * + * @return the deploymentLocationNoPriceAvailable + */ + public Boolean isDeploymentLocationNoPriceAvailable() { + return deploymentLocationNoPriceAvailable; + } + /** * Gets the metrics. * @@ -71,5 +116,16 @@ public StartingPrice getStartingPrice() { public List getMetrics() { return metrics; } + + /** + * Gets the deploymentRegions. + * + * List of regions where region pricing is available. Only set on global deployments if enabled by owner. + * + * @return the deploymentRegions + */ + public List getDeploymentRegions() { + return deploymentRegions; + } } diff --git a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/CreateCatalogEntryOptions.java b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/CreateCatalogEntryOptions.java index 69cac1c03d..e60af364d3 100644 --- a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/CreateCatalogEntryOptions.java +++ b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/CreateCatalogEntryOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_catalog.v1.model; import java.util.ArrayList; @@ -47,6 +48,7 @@ public interface Kind { protected String parentId; protected Boolean group; protected Boolean active; + protected String url; protected ObjectMetadataSet metadata; protected String account; @@ -65,9 +67,15 @@ public static class Builder { private String parentId; private Boolean group; private Boolean active; + private String url; private ObjectMetadataSet metadata; private String account; + /** + * Instantiates a new Builder from an existing CreateCatalogEntryOptions instance. + * + * @param createCatalogEntryOptions the instance to initialize the Builder with + */ private Builder(CreateCatalogEntryOptions createCatalogEntryOptions) { this.name = createCatalogEntryOptions.name; this.kind = createCatalogEntryOptions.kind; @@ -80,6 +88,7 @@ private Builder(CreateCatalogEntryOptions createCatalogEntryOptions) { this.parentId = createCatalogEntryOptions.parentId; this.group = createCatalogEntryOptions.group; this.active = createCatalogEntryOptions.active; + this.url = createCatalogEntryOptions.url; this.metadata = createCatalogEntryOptions.metadata; this.account = createCatalogEntryOptions.account; } @@ -123,9 +132,9 @@ public CreateCatalogEntryOptions build() { } /** - * Adds an tags to tags. + * Adds a new element to tags. * - * @param tags the new tags + * @param tags the new element to be added * @return the CreateCatalogEntryOptions builder */ public Builder addTags(String tags) { @@ -260,6 +269,17 @@ public Builder active(Boolean active) { return this; } + /** + * Set the url. + * + * @param url the url + * @return the CreateCatalogEntryOptions builder + */ + public Builder url(String url) { + this.url = url; + return this; + } + /** * Set the metadata. * @@ -283,6 +303,8 @@ public Builder account(String account) { } } + protected CreateCatalogEntryOptions() { } + protected CreateCatalogEntryOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.name, "name cannot be null"); @@ -311,6 +333,7 @@ protected CreateCatalogEntryOptions(Builder builder) { parentId = builder.parentId; group = builder.group; active = builder.active; + url = builder.url; metadata = builder.metadata; account = builder.account; } @@ -448,6 +471,17 @@ public Boolean active() { return active; } + /** + * Gets the url. + * + * Url of the object. + * + * @return the url + */ + public String url() { + return url; + } + /** * Gets the metadata. * diff --git a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/DRMetaData.java b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/DRMetaData.java index 41a7304dea..ddaf90d166 100644 --- a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/DRMetaData.java +++ b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/DRMetaData.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_catalog.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; @@ -29,6 +30,11 @@ public static class Builder { private Boolean dr; private String description; + /** + * Instantiates a new Builder from an existing DRMetaData instance. + * + * @param drMetaData the instance to initialize the Builder with + */ private Builder(DRMetaData drMetaData) { this.dr = drMetaData.dr; this.description = drMetaData.description; @@ -72,6 +78,8 @@ public Builder description(String description) { } } + protected DRMetaData() { } + protected DRMetaData(Builder builder) { dr = builder.dr; description = builder.description; diff --git a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/DeleteArtifactOptions.java b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/DeleteArtifactOptions.java index 3d76c3c576..3ea6884be5 100644 --- a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/DeleteArtifactOptions.java +++ b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/DeleteArtifactOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_catalog.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; @@ -31,6 +32,11 @@ public static class Builder { private String artifactId; private String account; + /** + * Instantiates a new Builder from an existing DeleteArtifactOptions instance. + * + * @param deleteArtifactOptions the instance to initialize the Builder with + */ private Builder(DeleteArtifactOptions deleteArtifactOptions) { this.objectId = deleteArtifactOptions.objectId; this.artifactId = deleteArtifactOptions.artifactId; @@ -97,6 +103,8 @@ public Builder account(String account) { } } + protected DeleteArtifactOptions() { } + protected DeleteArtifactOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.objectId, "objectId cannot be empty"); diff --git a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/DeleteCatalogEntryOptions.java b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/DeleteCatalogEntryOptions.java index 4277b39041..a21a79f795 100644 --- a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/DeleteCatalogEntryOptions.java +++ b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/DeleteCatalogEntryOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_catalog.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; @@ -31,6 +32,11 @@ public static class Builder { private String account; private Boolean force; + /** + * Instantiates a new Builder from an existing DeleteCatalogEntryOptions instance. + * + * @param deleteCatalogEntryOptions the instance to initialize the Builder with + */ private Builder(DeleteCatalogEntryOptions deleteCatalogEntryOptions) { this.id = deleteCatalogEntryOptions.id; this.account = deleteCatalogEntryOptions.account; @@ -95,6 +101,8 @@ public Builder force(Boolean force) { } } + protected DeleteCatalogEntryOptions() { } + protected DeleteCatalogEntryOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/DeploymentBase.java b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/DeploymentBase.java index edd37286b1..0a32e1fb13 100644 --- a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/DeploymentBase.java +++ b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/DeploymentBase.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_catalog.v1.model; import com.google.gson.annotations.SerializedName; @@ -51,6 +52,11 @@ public static class Builder { private Boolean supportsRcMigration; private String targetNetwork; + /** + * Instantiates a new Builder from an existing DeploymentBase instance. + * + * @param deploymentBase the instance to initialize the Builder with + */ private Builder(DeploymentBase deploymentBase) { this.location = deploymentBase.location; this.locationUrl = deploymentBase.locationUrl; @@ -178,6 +184,8 @@ public Builder targetNetwork(String targetNetwork) { } } + protected DeploymentBase() { } + protected DeploymentBase(Builder builder) { location = builder.location; locationUrl = builder.locationUrl; diff --git a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/EntrySearchResult.java b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/EntrySearchResult.java index 6310378145..de6c0c8b40 100644 --- a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/EntrySearchResult.java +++ b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/EntrySearchResult.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_catalog.v1.model; import java.util.List; @@ -33,6 +34,8 @@ public class EntrySearchResult extends GenericModel { protected String next; protected List resources; + protected EntrySearchResult() { } + /** * Gets the offset. * diff --git a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/GetArtifactOptions.java b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/GetArtifactOptions.java index 8d94e2158c..d06079d2d8 100644 --- a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/GetArtifactOptions.java +++ b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/GetArtifactOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_catalog.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; @@ -33,6 +34,11 @@ public static class Builder { private String accept; private String account; + /** + * Instantiates a new Builder from an existing GetArtifactOptions instance. + * + * @param getArtifactOptions the instance to initialize the Builder with + */ private Builder(GetArtifactOptions getArtifactOptions) { this.objectId = getArtifactOptions.objectId; this.artifactId = getArtifactOptions.artifactId; @@ -111,6 +117,8 @@ public Builder account(String account) { } } + protected GetArtifactOptions() { } + protected GetArtifactOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.objectId, "objectId cannot be empty"); @@ -156,7 +164,7 @@ public String artifactId() { /** * Gets the accept. * - * The type of the response: or *_/_*. + * The type of the response: *_/_*. * * @return the accept */ diff --git a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/GetAuditLogsOptions.java b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/GetAuditLogsOptions.java index 372319fba4..cfd6de4b1e 100644 --- a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/GetAuditLogsOptions.java +++ b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/GetAuditLogsOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_catalog.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; @@ -37,6 +38,11 @@ public static class Builder { private Long offset; private Long limit; + /** + * Instantiates a new Builder from an existing GetAuditLogsOptions instance. + * + * @param getAuditLogsOptions the instance to initialize the Builder with + */ private Builder(GetAuditLogsOptions getAuditLogsOptions) { this.id = getAuditLogsOptions.id; this.account = getAuditLogsOptions.account; @@ -137,6 +143,8 @@ public Builder limit(long limit) { } } + protected GetAuditLogsOptions() { } + protected GetAuditLogsOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/GetCatalogEntryOptions.java b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/GetCatalogEntryOptions.java index 1d4630825e..06861f1a7a 100644 --- a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/GetCatalogEntryOptions.java +++ b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/GetCatalogEntryOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_catalog.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; @@ -37,6 +38,11 @@ public static class Builder { private Boolean complete; private Long depth; + /** + * Instantiates a new Builder from an existing GetCatalogEntryOptions instance. + * + * @param getCatalogEntryOptions the instance to initialize the Builder with + */ private Builder(GetCatalogEntryOptions getCatalogEntryOptions) { this.id = getCatalogEntryOptions.id; this.account = getCatalogEntryOptions.account; @@ -137,6 +143,8 @@ public Builder depth(long depth) { } } + protected GetCatalogEntryOptions() { } + protected GetCatalogEntryOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); @@ -160,7 +168,7 @@ public Builder newBuilder() { /** * Gets the id. * - * The catalog entry's unqiue ID. + * The catalog entry's unique ID. * * @return the id */ @@ -197,8 +205,8 @@ public String include() { /** * Gets the languages. * - * Return the data strings in the specified langauge. By default the strings returned are of the language preferred by - * your browser through the Accept-Langauge header, which allows an override of the header. Languages are specified in + * Return the data strings in the specified language. By default the strings returned are of the language preferred by + * your browser through the Accept-Language header, which allows an override of the header. Languages are specified in * standard form, such as `en-us`. To include all languages use a wildcard (*). * * @return the languages diff --git a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/GetChildObjectsOptions.java b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/GetChildObjectsOptions.java index 9566fed67b..c8fc2a9144 100644 --- a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/GetChildObjectsOptions.java +++ b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/GetChildObjectsOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_catalog.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; @@ -47,6 +48,11 @@ public static class Builder { private Long offset; private Long limit; + /** + * Instantiates a new Builder from an existing GetChildObjectsOptions instance. + * + * @param getChildObjectsOptions the instance to initialize the Builder with + */ private Builder(GetChildObjectsOptions getChildObjectsOptions) { this.id = getChildObjectsOptions.id; this.kind = getChildObjectsOptions.kind; @@ -209,6 +215,8 @@ public Builder limit(long limit) { } } + protected GetChildObjectsOptions() { } + protected GetChildObjectsOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); @@ -322,8 +330,8 @@ public String descending() { /** * Gets the languages. * - * Return the data strings in the specified langauge. By default the strings returned are of the language preferred by - * your browser through the Accept-Langauge header. This allows an override of the header. Languages are specified in + * Return the data strings in the specified language. By default the strings returned are of the language preferred by + * your browser through the Accept-Language header. This allows an override of the header. Languages are specified in * standard form, such as `en-us`. To include all languages use the wildcard (*). * * @return the languages diff --git a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/GetPricingDeploymentsOptions.java b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/GetPricingDeploymentsOptions.java new file mode 100644 index 0000000000..0bceddb72e --- /dev/null +++ b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/GetPricingDeploymentsOptions.java @@ -0,0 +1,132 @@ +/* + * (C) Copyright IBM Corp. 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.platform_services.global_catalog.v1.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The getPricingDeployments options. + */ +public class GetPricingDeploymentsOptions extends GenericModel { + + protected String id; + protected String account; + + /** + * Builder. + */ + public static class Builder { + private String id; + private String account; + + /** + * Instantiates a new Builder from an existing GetPricingDeploymentsOptions instance. + * + * @param getPricingDeploymentsOptions the instance to initialize the Builder with + */ + private Builder(GetPricingDeploymentsOptions getPricingDeploymentsOptions) { + this.id = getPricingDeploymentsOptions.id; + this.account = getPricingDeploymentsOptions.account; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param id the id + */ + public Builder(String id) { + this.id = id; + } + + /** + * Builds a GetPricingDeploymentsOptions. + * + * @return the new GetPricingDeploymentsOptions instance + */ + public GetPricingDeploymentsOptions build() { + return new GetPricingDeploymentsOptions(this); + } + + /** + * Set the id. + * + * @param id the id + * @return the GetPricingDeploymentsOptions builder + */ + public Builder id(String id) { + this.id = id; + return this; + } + + /** + * Set the account. + * + * @param account the account + * @return the GetPricingDeploymentsOptions builder + */ + public Builder account(String account) { + this.account = account; + return this; + } + } + + protected GetPricingDeploymentsOptions() { } + + protected GetPricingDeploymentsOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, + "id cannot be empty"); + id = builder.id; + account = builder.account; + } + + /** + * New builder. + * + * @return a GetPricingDeploymentsOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the id. + * + * The object's unique ID. + * + * @return the id + */ + public String id() { + return id; + } + + /** + * Gets the account. + * + * This changes the scope of the request regardless of the authorization header. Example scopes are `account` and + * `global`. `account=global` is reqired if operating with a service ID that has a global admin policy, for example + * `GET /?account=global`. + * + * @return the account + */ + public String account() { + return account; + } +} + diff --git a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/GetPricingOptions.java b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/GetPricingOptions.java index 98b2c710d1..c46eb39edd 100644 --- a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/GetPricingOptions.java +++ b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/GetPricingOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_catalog.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; @@ -21,6 +22,7 @@ public class GetPricingOptions extends GenericModel { protected String id; protected String account; + protected String deploymentRegion; /** * Builder. @@ -28,10 +30,17 @@ public class GetPricingOptions extends GenericModel { public static class Builder { private String id; private String account; + private String deploymentRegion; + /** + * Instantiates a new Builder from an existing GetPricingOptions instance. + * + * @param getPricingOptions the instance to initialize the Builder with + */ private Builder(GetPricingOptions getPricingOptions) { this.id = getPricingOptions.id; this.account = getPricingOptions.account; + this.deploymentRegion = getPricingOptions.deploymentRegion; } /** @@ -79,13 +88,27 @@ public Builder account(String account) { this.account = account; return this; } + + /** + * Set the deploymentRegion. + * + * @param deploymentRegion the deploymentRegion + * @return the GetPricingOptions builder + */ + public Builder deploymentRegion(String deploymentRegion) { + this.deploymentRegion = deploymentRegion; + return this; + } } + protected GetPricingOptions() { } + protected GetPricingOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); id = builder.id; account = builder.account; + deploymentRegion = builder.deploymentRegion; } /** @@ -120,5 +143,17 @@ public String id() { public String account() { return account; } + + /** + * Gets the deploymentRegion. + * + * Specify a region to retrieve plan pricing for a global deployment. The value must match an entry in the + * `deployment_regions` list. + * + * @return the deploymentRegion + */ + public String deploymentRegion() { + return deploymentRegion; + } } diff --git a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/GetVisibilityOptions.java b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/GetVisibilityOptions.java index 64576819e3..b2aac77b90 100644 --- a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/GetVisibilityOptions.java +++ b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/GetVisibilityOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_catalog.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; @@ -29,6 +30,11 @@ public static class Builder { private String id; private String account; + /** + * Instantiates a new Builder from an existing GetVisibilityOptions instance. + * + * @param getVisibilityOptions the instance to initialize the Builder with + */ private Builder(GetVisibilityOptions getVisibilityOptions) { this.id = getVisibilityOptions.id; this.account = getVisibilityOptions.account; @@ -81,6 +87,8 @@ public Builder account(String account) { } } + protected GetVisibilityOptions() { } + protected GetVisibilityOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/Image.java b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/Image.java index d3aad320f7..ec16c4f769 100644 --- a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/Image.java +++ b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/Image.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_catalog.v1.model; import com.google.gson.annotations.SerializedName; @@ -37,6 +38,11 @@ public static class Builder { private String mediumImage; private String featureImage; + /** + * Instantiates a new Builder from an existing Image instance. + * + * @param image the instance to initialize the Builder with + */ private Builder(Image image) { this.image = image.image; this.smallImage = image.smallImage; @@ -113,6 +119,8 @@ public Builder featureImage(String featureImage) { } } + protected Image() { } + protected Image(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.image, "image cannot be null"); diff --git a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/ListArtifactsOptions.java b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/ListArtifactsOptions.java index c7efffe7d8..fd01df7790 100644 --- a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/ListArtifactsOptions.java +++ b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/ListArtifactsOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_catalog.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; @@ -29,6 +30,11 @@ public static class Builder { private String objectId; private String account; + /** + * Instantiates a new Builder from an existing ListArtifactsOptions instance. + * + * @param listArtifactsOptions the instance to initialize the Builder with + */ private Builder(ListArtifactsOptions listArtifactsOptions) { this.objectId = listArtifactsOptions.objectId; this.account = listArtifactsOptions.account; @@ -81,6 +87,8 @@ public Builder account(String account) { } } + protected ListArtifactsOptions() { } + protected ListArtifactsOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.objectId, "objectId cannot be empty"); diff --git a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/ListCatalogEntriesOptions.java b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/ListCatalogEntriesOptions.java index a11d7402f8..86d8f47f8a 100644 --- a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/ListCatalogEntriesOptions.java +++ b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/ListCatalogEntriesOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_catalog.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; @@ -45,6 +46,11 @@ public static class Builder { private Long offset; private Long limit; + /** + * Instantiates a new Builder from an existing ListCatalogEntriesOptions instance. + * + * @param listCatalogEntriesOptions the instance to initialize the Builder with + */ private Builder(ListCatalogEntriesOptions listCatalogEntriesOptions) { this.account = listCatalogEntriesOptions.account; this.include = listCatalogEntriesOptions.include; @@ -184,6 +190,8 @@ public Builder limit(long limit) { } } + protected ListCatalogEntriesOptions() { } + protected ListCatalogEntriesOptions(Builder builder) { account = builder.account; include = builder.include; @@ -274,8 +282,8 @@ public String descending() { /** * Gets the languages. * - * Return the data strings in a specified langauge. By default, the strings returned are of the language preferred by - * your browser through the Accept-Langauge header, which allows an override of the header. Languages are specified in + * Return the data strings in a specified language. By default, the strings returned are of the language preferred by + * your browser through the Accept-Language header, which allows an override of the header. Languages are specified in * standard form, such as `en-us`. To include all languages use a wildcard (*). * * @return the languages diff --git a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/Message.java b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/Message.java index 09722902bc..5c60b54266 100644 --- a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/Message.java +++ b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/Message.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_catalog.v1.model; import java.util.Date; @@ -38,6 +39,8 @@ public class Message extends GenericModel { protected String message; protected Map data; + protected Message() { } + /** * Gets the id. * diff --git a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/Metrics.java b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/Metrics.java index 7affef5065..d2cc25538a 100644 --- a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/Metrics.java +++ b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/Metrics.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_catalog.v1.model; import java.util.Date; @@ -34,7 +35,7 @@ public class Metrics extends GenericModel { @SerializedName("charge_unit_name") protected String chargeUnitName; @SerializedName("charge_unit_quantity") - protected String chargeUnitQuantity; + protected Long chargeUnitQuantity; @SerializedName("resource_display_name") protected String resourceDisplayName; @SerializedName("charge_unit_display_name") @@ -49,6 +50,8 @@ public class Metrics extends GenericModel { protected Date effectiveUntil; protected List amounts; + protected Metrics() { } + /** * Gets the partRef. * @@ -111,7 +114,7 @@ public String getChargeUnitName() { * * @return the chargeUnitQuantity */ - public String getChargeUnitQuantity() { + public Long getChargeUnitQuantity() { return chargeUnitQuantity; } diff --git a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/ObjectMetadataSet.java b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/ObjectMetadataSet.java index 90f2d3b27d..baffd32b40 100644 --- a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/ObjectMetadataSet.java +++ b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/ObjectMetadataSet.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_catalog.v1.model; import java.util.ArrayList; @@ -60,6 +61,11 @@ public static class Builder { private PricingSet pricing; private DeploymentBase deployment; + /** + * Instantiates a new Builder from an existing ObjectMetadataSet instance. + * + * @param objectMetadataSet the instance to initialize the Builder with + */ private Builder(ObjectMetadataSet objectMetadataSet) { this.rcCompatible = objectMetadataSet.rcCompatible; this.service = objectMetadataSet.service; @@ -93,9 +99,9 @@ public ObjectMetadataSet build() { } /** - * Adds an compliance to compliance. + * Adds a new element to compliance. * - * @param compliance the new compliance + * @param compliance the new element to be added * @return the ObjectMetadataSet builder */ public Builder addCompliance(String compliance) { @@ -264,6 +270,8 @@ public Builder deployment(DeploymentBase deployment) { } } + protected ObjectMetadataSet() { } + protected ObjectMetadataSet(Builder builder) { rcCompatible = builder.rcCompatible; service = builder.service; diff --git a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/Overview.java b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/Overview.java index 36c39cc5e2..482276d1e8 100644 --- a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/Overview.java +++ b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/Overview.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_catalog.v1.model; import com.google.gson.annotations.SerializedName; @@ -37,6 +38,11 @@ public static class Builder { private String description; private String featuredDescription; + /** + * Instantiates a new Builder from an existing Overview instance. + * + * @param overview the instance to initialize the Builder with + */ private Builder(Overview overview) { this.displayName = overview.displayName; this.longDescription = overview.longDescription; @@ -117,6 +123,8 @@ public Builder featuredDescription(String featuredDescription) { } } + protected Overview() { } + protected Overview(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.displayName, "displayName cannot be null"); diff --git a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/PlanMetaData.java b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/PlanMetaData.java index 48ee47fc4a..b9993f7af0 100644 --- a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/PlanMetaData.java +++ b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/PlanMetaData.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_catalog.v1.model; import java.util.Map; @@ -53,6 +54,11 @@ public static class Builder { private Boolean serviceCheckEnabled; private Map cfGuid; + /** + * Instantiates a new Builder from an existing PlanMetaData instance. + * + * @param planMetaData the instance to initialize the Builder with + */ private Builder(PlanMetaData planMetaData) { this.bindable = planMetaData.bindable; this.reservable = planMetaData.reservable; @@ -180,6 +186,8 @@ public Builder cfGuid(Map cfGuid) { } } + protected PlanMetaData() { } + protected PlanMetaData(Builder builder) { bindable = builder.bindable; reservable = builder.reservable; diff --git a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/Price.java b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/Price.java index 2f671397af..fe786249f2 100644 --- a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/Price.java +++ b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/Price.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_catalog.v1.model; import com.google.gson.annotations.SerializedName; @@ -22,7 +23,6 @@ public class Price extends GenericModel { @SerializedName("quantity_tier") protected Long quantityTier; - @SerializedName("Price") protected Double price; /** @@ -32,6 +32,11 @@ public static class Builder { private Long quantityTier; private Double price; + /** + * Instantiates a new Builder from an existing Price instance. + * + * @param price the instance to initialize the Builder with + */ private Builder(Price price) { this.quantityTier = price.quantityTier; this.price = price.price; @@ -75,6 +80,8 @@ public Builder price(Double price) { } } + protected Price() { } + protected Price(Builder builder) { quantityTier = builder.quantityTier; price = builder.price; diff --git a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/PricingGet.java b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/PricingGet.java index 26f0cc7594..b52bfd42ef 100644 --- a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/PricingGet.java +++ b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/PricingGet.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_catalog.v1.model; import java.util.List; @@ -22,11 +23,55 @@ */ public class PricingGet extends GenericModel { + @SerializedName("deployment_id") + protected String deploymentId; + @SerializedName("deployment_location") + protected String deploymentLocation; + @SerializedName("deployment_location_no_price_available") + protected Boolean deploymentLocationNoPriceAvailable; protected String type; protected String origin; @SerializedName("starting_price") protected StartingPrice startingPrice; protected List metrics; + @SerializedName("deployment_regions") + protected List deploymentRegions; + + protected PricingGet() { } + + /** + * Gets the deploymentId. + * + * The deployment object id this pricing is from. Only set if object kind is deployment. + * + * @return the deploymentId + */ + public String getDeploymentId() { + return deploymentId; + } + + /** + * Gets the deploymentLocation. + * + * The deployment location this pricing is from. Only set if object kind is deployment. + * + * @return the deploymentLocation + */ + public String getDeploymentLocation() { + return deploymentLocation; + } + + /** + * Gets the deploymentLocationNoPriceAvailable. + * + * Is the location price not available. Only set in api /pricing/deployment and only set if true. This means for the + * given deployment object there was no pricing set in pricing catalog. + * + * @return the deploymentLocationNoPriceAvailable + */ + public Boolean isDeploymentLocationNoPriceAvailable() { + return deploymentLocationNoPriceAvailable; + } /** * Gets the type. @@ -71,5 +116,16 @@ public StartingPrice getStartingPrice() { public List getMetrics() { return metrics; } + + /** + * Gets the deploymentRegions. + * + * List of regions where region pricing is available. Only set on global deployments if enabled by owner. + * + * @return the deploymentRegions + */ + public List getDeploymentRegions() { + return deploymentRegions; + } } diff --git a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/PricingSearchResult.java b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/PricingSearchResult.java new file mode 100644 index 0000000000..01105f216e --- /dev/null +++ b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/PricingSearchResult.java @@ -0,0 +1,138 @@ +/* + * (C) Copyright IBM Corp. 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.platform_services.global_catalog.v1.model; + +import java.util.List; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * A paginated result containing pricing entries. + */ +public class PricingSearchResult extends GenericModel { + + protected Long offset; + protected Long limit; + protected Long count; + @SerializedName("resource_count") + protected Long resourceCount; + protected String first; + protected String last; + protected String prev; + protected String next; + protected List resources; + + protected PricingSearchResult() { } + + /** + * Gets the offset. + * + * The offset (origin 0) of the first resource in this page of search results. + * + * @return the offset + */ + public Long getOffset() { + return offset; + } + + /** + * Gets the limit. + * + * The maximum number of resources returned in each page of search results. + * + * @return the limit + */ + public Long getLimit() { + return limit; + } + + /** + * Gets the count. + * + * The overall total number of resources in the search result set. + * + * @return the count + */ + public Long getCount() { + return count; + } + + /** + * Gets the resourceCount. + * + * The number of resources returned in this page of search results. + * + * @return the resourceCount + */ + public Long getResourceCount() { + return resourceCount; + } + + /** + * Gets the first. + * + * A URL for retrieving the first page of search results. + * + * @return the first + */ + public String getFirst() { + return first; + } + + /** + * Gets the last. + * + * A URL for retrieving the last page of search results. + * + * @return the last + */ + public String getLast() { + return last; + } + + /** + * Gets the prev. + * + * A URL for retrieving the previous page of search results. + * + * @return the prev + */ + public String getPrev() { + return prev; + } + + /** + * Gets the next. + * + * A URL for retrieving the next page of search results. + * + * @return the next + */ + public String getNext() { + return next; + } + + /** + * Gets the resources. + * + * The resources (prices) contained in this page of search results. + * + * @return the resources + */ + public List getResources() { + return resources; + } +} + diff --git a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/PricingSet.java b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/PricingSet.java index c33ff91612..3839d27a4e 100644 --- a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/PricingSet.java +++ b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/PricingSet.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_catalog.v1.model; import com.google.gson.annotations.SerializedName; @@ -33,6 +34,11 @@ public static class Builder { private String origin; private StartingPrice startingPrice; + /** + * Instantiates a new Builder from an existing PricingSet instance. + * + * @param pricingSet the instance to initialize the Builder with + */ private Builder(PricingSet pricingSet) { this.type = pricingSet.type; this.origin = pricingSet.origin; @@ -88,6 +94,8 @@ public Builder startingPrice(StartingPrice startingPrice) { } } + protected PricingSet() { } + protected PricingSet(Builder builder) { type = builder.type; origin = builder.origin; diff --git a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/Provider.java b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/Provider.java index 2402563f10..4f76d2f43f 100644 --- a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/Provider.java +++ b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/Provider.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_catalog.v1.model; import com.google.gson.annotations.SerializedName; @@ -37,6 +38,11 @@ public static class Builder { private String supportEmail; private String phone; + /** + * Instantiates a new Builder from an existing Provider instance. + * + * @param provider the instance to initialize the Builder with + */ private Builder(Provider provider) { this.email = provider.email; this.name = provider.name; @@ -127,6 +133,8 @@ public Builder phone(String phone) { } } + protected Provider() { } + protected Provider(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.email, "email cannot be null"); diff --git a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/RestoreCatalogEntryOptions.java b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/RestoreCatalogEntryOptions.java index e66bea1550..2acdb1330d 100644 --- a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/RestoreCatalogEntryOptions.java +++ b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/RestoreCatalogEntryOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_catalog.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; @@ -29,6 +30,11 @@ public static class Builder { private String id; private String account; + /** + * Instantiates a new Builder from an existing RestoreCatalogEntryOptions instance. + * + * @param restoreCatalogEntryOptions the instance to initialize the Builder with + */ private Builder(RestoreCatalogEntryOptions restoreCatalogEntryOptions) { this.id = restoreCatalogEntryOptions.id; this.account = restoreCatalogEntryOptions.account; @@ -81,6 +87,8 @@ public Builder account(String account) { } } + protected RestoreCatalogEntryOptions() { } + protected RestoreCatalogEntryOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/SLAMetaData.java b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/SLAMetaData.java index bdfc53ced7..13021453c0 100644 --- a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/SLAMetaData.java +++ b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/SLAMetaData.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_catalog.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; @@ -21,8 +22,8 @@ public class SLAMetaData extends GenericModel { protected String terms; protected String tenancy; - protected String provisioning; - protected String responsiveness; + protected Double provisioning; + protected Double responsiveness; protected DRMetaData dr; /** @@ -31,10 +32,15 @@ public class SLAMetaData extends GenericModel { public static class Builder { private String terms; private String tenancy; - private String provisioning; - private String responsiveness; + private Double provisioning; + private Double responsiveness; private DRMetaData dr; + /** + * Instantiates a new Builder from an existing SLAMetaData instance. + * + * @param slaMetaData the instance to initialize the Builder with + */ private Builder(SLAMetaData slaMetaData) { this.terms = slaMetaData.terms; this.tenancy = slaMetaData.tenancy; @@ -86,7 +92,7 @@ public Builder tenancy(String tenancy) { * @param provisioning the provisioning * @return the SLAMetaData builder */ - public Builder provisioning(String provisioning) { + public Builder provisioning(Double provisioning) { this.provisioning = provisioning; return this; } @@ -97,7 +103,7 @@ public Builder provisioning(String provisioning) { * @param responsiveness the responsiveness * @return the SLAMetaData builder */ - public Builder responsiveness(String responsiveness) { + public Builder responsiveness(Double responsiveness) { this.responsiveness = responsiveness; return this; } @@ -114,6 +120,8 @@ public Builder dr(DRMetaData dr) { } } + protected SLAMetaData() { } + protected SLAMetaData(Builder builder) { terms = builder.terms; tenancy = builder.tenancy; @@ -161,7 +169,7 @@ public String tenancy() { * * @return the provisioning */ - public String provisioning() { + public Double provisioning() { return provisioning; } @@ -172,7 +180,7 @@ public String provisioning() { * * @return the responsiveness */ - public String responsiveness() { + public Double responsiveness() { return responsiveness; } diff --git a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/SourceMetaData.java b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/SourceMetaData.java index aaa0262ba4..3d73b11582 100644 --- a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/SourceMetaData.java +++ b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/SourceMetaData.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_catalog.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; @@ -31,6 +32,11 @@ public static class Builder { private String type; private String url; + /** + * Instantiates a new Builder from an existing SourceMetaData instance. + * + * @param sourceMetaData the instance to initialize the Builder with + */ private Builder(SourceMetaData sourceMetaData) { this.path = sourceMetaData.path; this.type = sourceMetaData.type; @@ -86,6 +92,8 @@ public Builder url(String url) { } } + protected SourceMetaData() { } + protected SourceMetaData(Builder builder) { path = builder.path; type = builder.type; diff --git a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/StartingPrice.java b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/StartingPrice.java index 5605ed7e36..7270dd5040 100644 --- a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/StartingPrice.java +++ b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/StartingPrice.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_catalog.v1.model; import java.util.ArrayList; @@ -39,6 +40,11 @@ public static class Builder { private String unit; private List amount; + /** + * Instantiates a new Builder from an existing StartingPrice instance. + * + * @param startingPrice the instance to initialize the Builder with + */ private Builder(StartingPrice startingPrice) { this.planId = startingPrice.planId; this.deploymentId = startingPrice.deploymentId; @@ -62,9 +68,9 @@ public StartingPrice build() { } /** - * Adds an amount to amount. + * Adds a new element to amount. * - * @param amount the new amount + * @param amount the new element to be added * @return the StartingPrice builder */ public Builder addAmount(Amount amount) { @@ -123,6 +129,8 @@ public Builder amount(List amount) { } } + protected StartingPrice() { } + protected StartingPrice(Builder builder) { planId = builder.planId; deploymentId = builder.deploymentId; diff --git a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/Strings.java b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/Strings.java index 94946fac62..35b34de60a 100644 --- a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/Strings.java +++ b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/Strings.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_catalog.v1.model; import java.util.ArrayList; @@ -47,6 +48,11 @@ public static class Builder { private String popupWarningMessage; private String instruction; + /** + * Instantiates a new Builder from an existing Strings instance. + * + * @param strings the instance to initialize the Builder with + */ private Builder(Strings strings) { this.bullets = strings.bullets; this.media = strings.media; @@ -73,9 +79,9 @@ public Strings build() { } /** - * Adds an bullets to bullets. + * Adds a new element to bullets. * - * @param bullets the new bullets + * @param bullets the new element to be added * @return the Strings builder */ public Builder addBullets(Bullets bullets) { @@ -89,9 +95,9 @@ public Builder addBullets(Bullets bullets) { } /** - * Adds an media to media. + * Adds a new element to media. * - * @param media the new media + * @param media the new element to be added * @return the Strings builder */ public Builder addMedia(UIMetaMedia media) { @@ -184,6 +190,8 @@ public Builder instruction(String instruction) { } } + protected Strings() { } + protected Strings(Builder builder) { bullets = builder.bullets; media = builder.media; diff --git a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/TemplateMetaData.java b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/TemplateMetaData.java index e897ba6b5e..95bfce8a53 100644 --- a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/TemplateMetaData.java +++ b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/TemplateMetaData.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_catalog.v1.model; import java.util.ArrayList; @@ -57,6 +58,11 @@ public static class Builder { private String buildpack; private Map environmentVariables; + /** + * Instantiates a new Builder from an existing TemplateMetaData instance. + * + * @param templateMetaData the instance to initialize the Builder with + */ private Builder(TemplateMetaData templateMetaData) { this.services = templateMetaData.services; this.defaultMemory = templateMetaData.defaultMemory; @@ -86,9 +92,9 @@ public TemplateMetaData build() { } /** - * Adds an services to services. + * Adds a new element to services. * - * @param services the new services + * @param services the new element to be added * @return the TemplateMetaData builder */ public Builder addServices(String services) { @@ -213,6 +219,8 @@ public Builder environmentVariables(Map environmentVariables) { } } + protected TemplateMetaData() { } + protected TemplateMetaData(Builder builder) { services = builder.services; defaultMemory = builder.defaultMemory; diff --git a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/UIMediaSourceMetaData.java b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/UIMediaSourceMetaData.java new file mode 100644 index 0000000000..9e947d651d --- /dev/null +++ b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/UIMediaSourceMetaData.java @@ -0,0 +1,119 @@ +/* + * (C) Copyright IBM Corp. 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.platform_services.global_catalog.v1.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * Location of your applications media source files. + */ +public class UIMediaSourceMetaData extends GenericModel { + + protected String type; + protected String url; + + /** + * Builder. + */ + public static class Builder { + private String type; + private String url; + + /** + * Instantiates a new Builder from an existing UIMediaSourceMetaData instance. + * + * @param uiMediaSourceMetaData the instance to initialize the Builder with + */ + private Builder(UIMediaSourceMetaData uiMediaSourceMetaData) { + this.type = uiMediaSourceMetaData.type; + this.url = uiMediaSourceMetaData.url; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Builds a UIMediaSourceMetaData. + * + * @return the new UIMediaSourceMetaData instance + */ + public UIMediaSourceMetaData build() { + return new UIMediaSourceMetaData(this); + } + + /** + * Set the type. + * + * @param type the type + * @return the UIMediaSourceMetaData builder + */ + public Builder type(String type) { + this.type = type; + return this; + } + + /** + * Set the url. + * + * @param url the url + * @return the UIMediaSourceMetaData builder + */ + public Builder url(String url) { + this.url = url; + return this; + } + } + + protected UIMediaSourceMetaData() { } + + protected UIMediaSourceMetaData(Builder builder) { + type = builder.type; + url = builder.url; + } + + /** + * New builder. + * + * @return a UIMediaSourceMetaData builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the type. + * + * Type of source, for example, git. + * + * @return the type + */ + public String type() { + return type; + } + + /** + * Gets the url. + * + * URL to source. + * + * @return the url + */ + public String url() { + return url; + } +} + diff --git a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/UIMetaData.java b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/UIMetaData.java index c67d3a9763..37cd6accb6 100644 --- a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/UIMetaData.java +++ b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/UIMetaData.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_catalog.v1.model; import java.util.ArrayList; @@ -67,6 +68,11 @@ public static class Builder { private Boolean hideLiteMetering; private Boolean noUpgradeNextStep; + /** + * Instantiates a new Builder from an existing UIMetaData instance. + * + * @param uiMetaData the instance to initialize the Builder with + */ private Builder(UIMetaData uiMetaData) { this.strings = uiMetaData.strings; this.urls = uiMetaData.urls; @@ -99,9 +105,9 @@ public UIMetaData build() { } /** - * Adds an navigationOrder to navigationOrder. + * Adds a new element to navigationOrder. * - * @param navigationOrder the new navigationOrder + * @param navigationOrder the new element to be added * @return the UIMetaData builder */ public Builder addNavigationOrder(String navigationOrder) { @@ -259,6 +265,8 @@ public Builder noUpgradeNextStep(Boolean noUpgradeNextStep) { } } + protected UIMetaData() { } + protected UIMetaData(Builder builder) { strings = builder.strings; urls = builder.urls; @@ -419,7 +427,7 @@ public Boolean hideLiteMetering() { /** * Gets the noUpgradeNextStep. * - * Denotes whether an upgrade should occurr. + * Denotes whether an upgrade should occur. * * @return the noUpgradeNextStep */ diff --git a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/UIMetaMedia.java b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/UIMetaMedia.java index 271ff0bb89..6483d316e5 100644 --- a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/UIMetaMedia.java +++ b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/UIMetaMedia.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,8 +10,12 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_catalog.v1.model; +import java.util.ArrayList; +import java.util.List; + import com.google.gson.annotations.SerializedName; import com.ibm.cloud.sdk.core.service.model.GenericModel; @@ -26,7 +30,7 @@ public class UIMetaMedia extends GenericModel { protected String type; @SerializedName("URL") protected String url; - protected Bullets source; + protected List source; /** * Builder. @@ -36,8 +40,13 @@ public static class Builder { private String thumbnailUrl; private String type; private String url; - private Bullets source; + private List source; + /** + * Instantiates a new Builder from an existing UIMetaMedia instance. + * + * @param uiMetaMedia the instance to initialize the Builder with + */ private Builder(UIMetaMedia uiMetaMedia) { this.caption = uiMetaMedia.caption; this.thumbnailUrl = uiMetaMedia.thumbnailUrl; @@ -61,6 +70,22 @@ public UIMetaMedia build() { return new UIMetaMedia(this); } + /** + * Adds a new element to source. + * + * @param source the new element to be added + * @return the UIMetaMedia builder + */ + public Builder addSource(UIMediaSourceMetaData source) { + com.ibm.cloud.sdk.core.util.Validator.notNull(source, + "source cannot be null"); + if (this.source == null) { + this.source = new ArrayList(); + } + this.source.add(source); + return this; + } + /** * Set the caption. * @@ -107,16 +132,19 @@ public Builder url(String url) { /** * Set the source. + * Existing source will be replaced. * * @param source the source * @return the UIMetaMedia builder */ - public Builder source(Bullets source) { + public Builder source(List source) { this.source = source; return this; } } + protected UIMetaMedia() { } + protected UIMetaMedia(Builder builder) { caption = builder.caption; thumbnailUrl = builder.thumbnailUrl; @@ -181,11 +209,11 @@ public String url() { /** * Gets the source. * - * Information related to list delimiters. + * UI media source data for for UI media data. * * @return the source */ - public Bullets source() { + public List source() { return source; } } diff --git a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/URLS.java b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/URLS.java index 83afe5163e..fe1207b776 100644 --- a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/URLS.java +++ b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/URLS.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_catalog.v1.model; import com.google.gson.annotations.SerializedName; @@ -61,6 +62,11 @@ public static class Builder { private String registrationUrl; private String apidocsurl; + /** + * Instantiates a new Builder from an existing URLS instance. + * + * @param urls the instance to initialize the Builder with + */ private Builder(URLS urls) { this.docUrl = urls.docUrl; this.instructionsUrl = urls.instructionsUrl; @@ -224,6 +230,8 @@ public Builder apidocsurl(String apidocsurl) { } } + protected URLS() { } + protected URLS(Builder builder) { docUrl = builder.docUrl; instructionsUrl = builder.instructionsUrl; diff --git a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/UpdateCatalogEntryOptions.java b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/UpdateCatalogEntryOptions.java index bd4ebb80ca..a3317a670a 100644 --- a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/UpdateCatalogEntryOptions.java +++ b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/UpdateCatalogEntryOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_catalog.v1.model; import java.util.ArrayList; @@ -47,6 +48,7 @@ public interface Kind { protected String parentId; protected Boolean group; protected Boolean active; + protected String url; protected ObjectMetadataSet metadata; protected String account; protected String move; @@ -66,10 +68,16 @@ public static class Builder { private String parentId; private Boolean group; private Boolean active; + private String url; private ObjectMetadataSet metadata; private String account; private String move; + /** + * Instantiates a new Builder from an existing UpdateCatalogEntryOptions instance. + * + * @param updateCatalogEntryOptions the instance to initialize the Builder with + */ private Builder(UpdateCatalogEntryOptions updateCatalogEntryOptions) { this.id = updateCatalogEntryOptions.id; this.name = updateCatalogEntryOptions.name; @@ -82,6 +90,7 @@ private Builder(UpdateCatalogEntryOptions updateCatalogEntryOptions) { this.parentId = updateCatalogEntryOptions.parentId; this.group = updateCatalogEntryOptions.group; this.active = updateCatalogEntryOptions.active; + this.url = updateCatalogEntryOptions.url; this.metadata = updateCatalogEntryOptions.metadata; this.account = updateCatalogEntryOptions.account; this.move = updateCatalogEntryOptions.move; @@ -126,9 +135,9 @@ public UpdateCatalogEntryOptions build() { } /** - * Adds an tags to tags. + * Adds a new element to tags. * - * @param tags the new tags + * @param tags the new element to be added * @return the UpdateCatalogEntryOptions builder */ public Builder addTags(String tags) { @@ -263,6 +272,17 @@ public Builder active(Boolean active) { return this; } + /** + * Set the url. + * + * @param url the url + * @return the UpdateCatalogEntryOptions builder + */ + public Builder url(String url) { + this.url = url; + return this; + } + /** * Set the metadata. * @@ -297,6 +317,8 @@ public Builder move(String move) { } } + protected UpdateCatalogEntryOptions() { } + protected UpdateCatalogEntryOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); @@ -325,6 +347,7 @@ protected UpdateCatalogEntryOptions(Builder builder) { parentId = builder.parentId; group = builder.group; active = builder.active; + url = builder.url; metadata = builder.metadata; account = builder.account; move = builder.move; @@ -463,6 +486,17 @@ public Boolean active() { return active; } + /** + * Gets the url. + * + * Url of the object. + * + * @return the url + */ + public String url() { + return url; + } + /** * Gets the metadata. * diff --git a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/UpdateVisibilityOptions.java b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/UpdateVisibilityOptions.java index 71ae5f812e..17dc672214 100644 --- a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/UpdateVisibilityOptions.java +++ b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/UpdateVisibilityOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_catalog.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; @@ -35,6 +36,11 @@ public static class Builder { private VisibilityDetail exclude; private String account; + /** + * Instantiates a new Builder from an existing UpdateVisibilityOptions instance. + * + * @param updateVisibilityOptions the instance to initialize the Builder with + */ private Builder(UpdateVisibilityOptions updateVisibilityOptions) { this.id = updateVisibilityOptions.id; this.extendable = updateVisibilityOptions.extendable; @@ -136,6 +142,8 @@ public Builder visibility(Visibility visibility) { } } + protected UpdateVisibilityOptions() { } + protected UpdateVisibilityOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); diff --git a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/UploadArtifactOptions.java b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/UploadArtifactOptions.java index 37ada182c5..951099df4c 100644 --- a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/UploadArtifactOptions.java +++ b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/UploadArtifactOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_catalog.v1.model; import java.io.File; @@ -40,6 +41,11 @@ public static class Builder { private String contentType; private String account; + /** + * Instantiates a new Builder from an existing UploadArtifactOptions instance. + * + * @param uploadArtifactOptions the instance to initialize the Builder with + */ private Builder(UploadArtifactOptions uploadArtifactOptions) { this.objectId = uploadArtifactOptions.objectId; this.artifactId = uploadArtifactOptions.artifactId; @@ -143,6 +149,8 @@ public Builder artifact(File artifact) throws FileNotFoundException { } } + protected UploadArtifactOptions() { } + protected UploadArtifactOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.objectId, "objectId cannot be empty"); diff --git a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/Visibility.java b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/Visibility.java index a5dd94d731..13fc0b6ec3 100644 --- a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/Visibility.java +++ b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/Visibility.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_catalog.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; @@ -34,6 +35,11 @@ public static class Builder { private VisibilityDetail include; private VisibilityDetail exclude; + /** + * Instantiates a new Builder from an existing Visibility instance. + * + * @param visibility the instance to initialize the Builder with + */ private Builder(Visibility visibility) { this.extendable = visibility.extendable; this.include = visibility.include; @@ -89,6 +95,8 @@ public Builder exclude(VisibilityDetail exclude) { } } + protected Visibility() { } + protected Visibility(Builder builder) { extendable = builder.extendable; include = builder.include; diff --git a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/VisibilityDetail.java b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/VisibilityDetail.java index 12347bea52..d49461600a 100644 --- a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/VisibilityDetail.java +++ b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/VisibilityDetail.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_catalog.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; @@ -27,6 +28,11 @@ public class VisibilityDetail extends GenericModel { public static class Builder { private VisibilityDetailAccounts accounts; + /** + * Instantiates a new Builder from an existing VisibilityDetail instance. + * + * @param visibilityDetail the instance to initialize the Builder with + */ private Builder(VisibilityDetail visibilityDetail) { this.accounts = visibilityDetail.accounts; } @@ -67,6 +73,8 @@ public Builder accounts(VisibilityDetailAccounts accounts) { } } + protected VisibilityDetail() { } + protected VisibilityDetail(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.accounts, "accounts cannot be null"); diff --git a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/VisibilityDetailAccounts.java b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/VisibilityDetailAccounts.java index fc327a2531..8cffdafe63 100644 --- a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/VisibilityDetailAccounts.java +++ b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/model/VisibilityDetailAccounts.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,6 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_catalog.v1.model; import com.google.gson.annotations.SerializedName; @@ -29,6 +30,11 @@ public class VisibilityDetailAccounts extends GenericModel { public static class Builder { private String accountid; + /** + * Instantiates a new Builder from an existing VisibilityDetailAccounts instance. + * + * @param visibilityDetailAccounts the instance to initialize the Builder with + */ private Builder(VisibilityDetailAccounts visibilityDetailAccounts) { this.accountid = visibilityDetailAccounts.accountid; } @@ -60,6 +66,8 @@ public Builder accountid(String accountid) { } } + protected VisibilityDetailAccounts() { } + protected VisibilityDetailAccounts(Builder builder) { accountid = builder.accountid; } diff --git a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/package-info.java b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/package-info.java index cc276fdea8..5b1b016e3a 100644 --- a/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/package-info.java +++ b/modules/global-catalog/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/package-info.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,7 +10,8 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + /** - * Catalog API v1. + * Global Catalog API v1. */ package com.ibm.cloud.platform_services.global_catalog.v1; diff --git a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/GlobalCatalogIT.java b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/GlobalCatalogIT.java index d549012e8b..bdbbfa811e 100644 --- a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/GlobalCatalogIT.java +++ b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/GlobalCatalogIT.java @@ -10,14 +10,8 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ - package com.ibm.cloud.platform_services.global_catalog.v1; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; -import static org.testng.Assert.fail; -import static org.testng.AssertJUnit.assertNotNull; - import java.io.ByteArrayInputStream; import java.io.InputStream; import java.util.Arrays; @@ -26,6 +20,10 @@ import java.util.Map; import org.apache.commons.io.IOUtils; +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertTrue; +import static org.testng.Assert.fail; +import static org.testng.AssertJUnit.assertNotNull; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeMethod; @@ -55,13 +53,13 @@ import com.ibm.cloud.platform_services.test.SdkIntegrationTestBase; import com.ibm.cloud.sdk.core.http.Response; import com.ibm.cloud.sdk.core.service.exception.ConflictException; -import com.ibm.cloud.sdk.core.service.exception.ForbiddenException; import com.ibm.cloud.sdk.core.service.exception.NotFoundException; /** * Integration test class for the GlobalCatalog service. */ public class GlobalCatalogIT extends SdkIntegrationTestBase { + GlobalCatalog service = null; private static final long timestamp = System.currentTimeMillis() / 1000L; @@ -97,6 +95,7 @@ public class GlobalCatalogIT extends SdkIntegrationTestBase { UploadArtifactOptions uploadArtifactDelete; GetArtifactOptions getArtifact; DeleteArtifactOptions deleteArtifact; + CatalogEntry fetchedObject; @Override public String getConfigFilename() { @@ -118,37 +117,21 @@ public void constructService() { assertNotNull(service); assertNotNull(service.getServiceUrl()); - List tags = Arrays.asList("a", "b", "c"); - List tagsUpdated = Arrays.asList("x", "y", "z"); + List tags = Arrays.asList("a", "b", "c", "support_ibm"); Overview overviewValueDefault = new Overview.Builder() .displayName("display") .longDescription("long") .description("desc") .build(); - Overview overviewValueUpdated = new Overview.Builder() - .displayName("displayUpdated") - .longDescription("longUpdated") - .description("descUpdated") - .build(); Map overview = new HashMap<>(); - Map overviewUpdated = new HashMap<>(); overview.put("en", overviewValueDefault); - overviewUpdated.put("en", overviewValueUpdated); Image image = new Image.Builder() .image("image") .smallImage("small") .mediumImage("medium") .featureImage("feature") .build(); - Image imageUpdated = new Image.Builder() - .image("imageUpdated") - .smallImage("smallUpdated") - .mediumImage("mediumUpdated") - .featureImage("featureUpdated") - .build(); Provider provider = new Provider.Builder().email("bogus@us.ibm.com").name("someName").build(); - Provider providerUpdated = new Provider.Builder().email("bogus@us.ibm.com").name("someNameUpdated").build(); - defaultCreate = new CreateCatalogEntryOptions.Builder() .id(id) .name(name) @@ -162,18 +145,7 @@ public void constructService() { .build(); defaultDelete = new DeleteCatalogEntryOptions.Builder().id(id).force(false).build(); forceDelete = new DeleteCatalogEntryOptions.Builder().id(id).force(true).build(); - defaultGet = new GetCatalogEntryOptions.Builder().id(id).build(); - defaultUpdate = new UpdateCatalogEntryOptions.Builder() - .id(id) - .name(nameUpdated) - .active(active) - .kind(kind) - .disabled(disabled) - .overviewUi(overviewUpdated) - .images(imageUpdated) - .tags(tagsUpdated) - .provider(providerUpdated) - .build(); + defaultGet = new GetCatalogEntryOptions.Builder().id(id).complete(true).build(); defaultChild = new CreateCatalogEntryOptions.Builder() .id(idChild) .name(nameChild) @@ -261,7 +233,7 @@ public void testCreateCatalogEntry() { log("createCatalogEntry result: " + result.toString()); } - @Test(dependsOnMethods = { "testCreateCatalogEntry" }) + @Test(dependsOnMethods = {"testCreateCatalogEntry"}) public void testGetCatalogEntry() { service.createCatalogEntry(defaultCreate).execute(); Response response = service.getCatalogEntry(defaultGet).execute(); @@ -269,6 +241,7 @@ public void testGetCatalogEntry() { assertEquals(response.getStatusCode(), 200); CatalogEntry result = response.getResult(); + fetchedObject = result; assertNotNull(result); assertEquals(result.getId(), defaultCreate.id()); assertEquals(result.getName(), defaultCreate.name()); @@ -280,9 +253,36 @@ public void testGetCatalogEntry() { log("createCatalogEntry result: " + result.toString()); } - @Test(dependsOnMethods = { "testGetCatalogEntry" }) + @Test(dependsOnMethods = {"testGetCatalogEntry"}) public void testUpdateCatalogEntry() { service.createCatalogEntry(defaultCreate).execute(); + List tagsUpdated = Arrays.asList("x", "y", "z", "support_ibm"); + Overview overviewValueUpdated = new Overview.Builder() + .displayName("displayUpdated") + .longDescription("longUpdated") + .description("descUpdated") + .build(); + Map overviewUpdated = new HashMap<>(); + overviewUpdated.put("en", overviewValueUpdated); + Image imageUpdated = new Image.Builder() + .image("imageUpdated") + .smallImage("smallUpdated") + .mediumImage("mediumUpdated") + .featureImage("featureUpdated") + .build(); + Provider providerUpdated = new Provider.Builder().email("bogus@us.ibm.com").name("someNameUpdated").build(); + defaultUpdate = new UpdateCatalogEntryOptions.Builder() + .id(id) + .name(nameUpdated) + .active(active) + .kind(kind) + .disabled(disabled) + .overviewUi(overviewUpdated) + .images(imageUpdated) + .tags(tagsUpdated) + .provider(providerUpdated) + .url(fetchedObject.getUrl()) + .build(); Response response = service.updateCatalogEntry(defaultUpdate).execute(); assertNotNull(response); assertEquals(response.getStatusCode(), 200); @@ -299,7 +299,7 @@ public void testUpdateCatalogEntry() { log("createCatalogEntry result: " + result.toString()); } - @Test(dependsOnMethods = { "testUpdateCatalogEntry" }) + @Test(dependsOnMethods = {"testUpdateCatalogEntry"}) public void testDeleteCatalogEntry() { service.createCatalogEntry(defaultCreate).execute(); Response response = service.deleteCatalogEntry(forceDelete).execute(); @@ -307,19 +307,19 @@ public void testDeleteCatalogEntry() { assertEquals(response.getStatusCode(), 200); } - @Test(dependsOnMethods = { "testDeleteCatalogEntry" }, expectedExceptions = {NotFoundException.class}) + @Test(dependsOnMethods = {"testDeleteCatalogEntry"}, expectedExceptions = {NotFoundException.class}) public void testGetCatalogEntryAfterDeleteFailure() { service.createCatalogEntry(defaultCreate).execute(); service.deleteCatalogEntry(forceDelete).execute(); service.getCatalogEntry(defaultGet).execute(); } - @Test(dependsOnMethods = { "testDeleteCatalogEntry" }, expectedExceptions = {NotFoundException.class}) + @Test(dependsOnMethods = {"testDeleteCatalogEntry"}, expectedExceptions = {NotFoundException.class}) public void testGetCatalogEntryFailure() { service.getCatalogEntry(defaultGet).execute(); } - @Test(dependsOnMethods = { "testDeleteCatalogEntry" }) + @Test(dependsOnMethods = {"testDeleteCatalogEntry"}) public void testDeleteCatalogEntryFailure() { service.createCatalogEntry(defaultCreate).execute(); Response response = service.deleteCatalogEntry(forceDelete).execute(); @@ -327,12 +327,12 @@ public void testDeleteCatalogEntryFailure() { assertEquals(response.getStatusCode(), 200); } - @Test(dependsOnMethods = { "testUpdateCatalogEntry" }, expectedExceptions = {NotFoundException.class}) + @Test(dependsOnMethods = {"testUpdateCatalogEntry"}, expectedExceptions = {NotFoundException.class}) public void testUpdateCatalogEntryFailure() { service.updateCatalogEntry(defaultUpdate).execute(); } - @Test(dependsOnMethods = { "testUpdateCatalogEntryFailure" }, expectedExceptions = {ConflictException.class}) + @Test(dependsOnMethods = {"testUpdateCatalogEntryFailure"}, expectedExceptions = {ConflictException.class}) public void testCreateCatalogEntryFailure() { service.createCatalogEntry(defaultCreate).execute(); service.createCatalogEntry(defaultCreate).execute(); @@ -423,7 +423,7 @@ public void testGetVisibilityFailure() { service.getVisibility(getVisibility).execute(); } - @Test(expectedExceptions = {ForbiddenException.class}) + @Test public void testUpdateVisibility() { service.createCatalogEntry(defaultCreate).execute(); service.updateVisibility(updateVisibility).execute(); diff --git a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/GlobalCatalogTest.java b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/GlobalCatalogTest.java index 332c27a610..915d00aa46 100644 --- a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/GlobalCatalogTest.java +++ b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/GlobalCatalogTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021, 2023. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,25 +10,13 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package com.ibm.cloud.platform_services.global_catalog.v1; - -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertNull; -import static org.testng.Assert.fail; -import java.io.IOException; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.testng.annotations.AfterMethod; -import org.testng.annotations.BeforeMethod; -import org.testng.annotations.Test; +package com.ibm.cloud.platform_services.global_catalog.v1; +import com.ibm.cloud.platform_services.global_catalog.v1.GlobalCatalog; import com.ibm.cloud.platform_services.global_catalog.v1.model.AliasMetaData; import com.ibm.cloud.platform_services.global_catalog.v1.model.Amount; +import com.ibm.cloud.platform_services.global_catalog.v1.model.Artifact; import com.ibm.cloud.platform_services.global_catalog.v1.model.Artifacts; import com.ibm.cloud.platform_services.global_catalog.v1.model.AuditSearchResult; import com.ibm.cloud.platform_services.global_catalog.v1.model.Broker; @@ -36,6 +24,9 @@ import com.ibm.cloud.platform_services.global_catalog.v1.model.CFMetaData; import com.ibm.cloud.platform_services.global_catalog.v1.model.Callbacks; import com.ibm.cloud.platform_services.global_catalog.v1.model.CatalogEntry; +import com.ibm.cloud.platform_services.global_catalog.v1.model.CatalogEntryMetadata; +import com.ibm.cloud.platform_services.global_catalog.v1.model.CatalogEntryMetadataDeployment; +import com.ibm.cloud.platform_services.global_catalog.v1.model.CatalogEntryMetadataPricing; import com.ibm.cloud.platform_services.global_catalog.v1.model.CreateCatalogEntryOptions; import com.ibm.cloud.platform_services.global_catalog.v1.model.DRMetaData; import com.ibm.cloud.platform_services.global_catalog.v1.model.DeleteArtifactOptions; @@ -46,16 +37,20 @@ import com.ibm.cloud.platform_services.global_catalog.v1.model.GetAuditLogsOptions; import com.ibm.cloud.platform_services.global_catalog.v1.model.GetCatalogEntryOptions; import com.ibm.cloud.platform_services.global_catalog.v1.model.GetChildObjectsOptions; +import com.ibm.cloud.platform_services.global_catalog.v1.model.GetPricingDeploymentsOptions; import com.ibm.cloud.platform_services.global_catalog.v1.model.GetPricingOptions; import com.ibm.cloud.platform_services.global_catalog.v1.model.GetVisibilityOptions; import com.ibm.cloud.platform_services.global_catalog.v1.model.Image; import com.ibm.cloud.platform_services.global_catalog.v1.model.ListArtifactsOptions; import com.ibm.cloud.platform_services.global_catalog.v1.model.ListCatalogEntriesOptions; +import com.ibm.cloud.platform_services.global_catalog.v1.model.Message; +import com.ibm.cloud.platform_services.global_catalog.v1.model.Metrics; import com.ibm.cloud.platform_services.global_catalog.v1.model.ObjectMetadataSet; import com.ibm.cloud.platform_services.global_catalog.v1.model.Overview; import com.ibm.cloud.platform_services.global_catalog.v1.model.PlanMetaData; import com.ibm.cloud.platform_services.global_catalog.v1.model.Price; import com.ibm.cloud.platform_services.global_catalog.v1.model.PricingGet; +import com.ibm.cloud.platform_services.global_catalog.v1.model.PricingSearchResult; import com.ibm.cloud.platform_services.global_catalog.v1.model.PricingSet; import com.ibm.cloud.platform_services.global_catalog.v1.model.Provider; import com.ibm.cloud.platform_services.global_catalog.v1.model.RestoreCatalogEntryOptions; @@ -64,6 +59,7 @@ import com.ibm.cloud.platform_services.global_catalog.v1.model.StartingPrice; import com.ibm.cloud.platform_services.global_catalog.v1.model.Strings; import com.ibm.cloud.platform_services.global_catalog.v1.model.TemplateMetaData; +import com.ibm.cloud.platform_services.global_catalog.v1.model.UIMediaSourceMetaData; import com.ibm.cloud.platform_services.global_catalog.v1.model.UIMetaData; import com.ibm.cloud.platform_services.global_catalog.v1.model.UIMetaMedia; import com.ibm.cloud.platform_services.global_catalog.v1.model.URLS; @@ -75,12 +71,22 @@ import com.ibm.cloud.platform_services.global_catalog.v1.model.VisibilityDetailAccounts; import com.ibm.cloud.platform_services.global_catalog.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.http.Response; +import com.ibm.cloud.sdk.core.security.Authenticator; +import com.ibm.cloud.sdk.core.security.NoAuthAuthenticator; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import com.ibm.cloud.sdk.core.util.DateUtils; - +import java.io.IOException; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import okhttp3.mockwebserver.MockResponse; import okhttp3.mockwebserver.MockWebServer; import okhttp3.mockwebserver.RecordedRequest; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; +import static org.testng.Assert.*; /** * Unit test class for the GlobalCatalog service. @@ -93,67 +99,54 @@ public class GlobalCatalogTest { protected MockWebServer server; protected GlobalCatalog globalCatalogService; - public void constructClientService() throws Throwable { - System.setProperty("TESTSERVICE_AUTH_TYPE", "noAuth"); - final String serviceName = "testService"; - - globalCatalogService = GlobalCatalog.newInstance(serviceName); - String url = server.url("/").toString(); - globalCatalogService.setServiceUrl(url); - } - - /** - * Negative Test - construct the service with a null authenticator. - */ + // Construct the service with a null authenticator (negative test) @Test(expectedExceptions = IllegalArgumentException.class) public void testConstructorWithNullAuthenticator() throws Throwable { final String serviceName = "testService"; - new GlobalCatalog(serviceName, null); } + // Test the listCatalogEntries operation with a valid options model parameter @Test public void testListCatalogEntriesWOptions() throws Throwable { - // Schedule some responses. - String mockResponseBody = "{\"offset\": 6, \"limit\": 5, \"count\": 5, \"resource_count\": 13, \"first\": \"first\", \"last\": \"last\", \"prev\": \"prev\", \"next\": \"next\", \"resources\": [{\"name\": \"name\", \"kind\": \"service\", \"overview_ui\": {\"mapKey\": {\"display_name\": \"displayName\", \"long_description\": \"longDescription\", \"description\": \"description\", \"featured_description\": \"featuredDescription\"}}, \"images\": {\"image\": \"image\", \"small_image\": \"smallImage\", \"medium_image\": \"mediumImage\", \"feature_image\": \"featureImage\"}, \"parent_id\": \"parentId\", \"disabled\": true, \"tags\": [\"tags\"], \"group\": false, \"provider\": {\"email\": \"email\", \"name\": \"name\", \"contact\": \"contact\", \"support_email\": \"supportEmail\", \"phone\": \"phone\"}, \"active\": true, \"metadata\": {\"rc_compatible\": true, \"service\": {\"type\": \"type\", \"iam_compatible\": false, \"unique_api_key\": true, \"provisionable\": false, \"bindable\": true, \"async_provisioning_supported\": true, \"async_unprovisioning_supported\": true, \"requires\": [\"requires\"], \"plan_updateable\": true, \"state\": \"state\", \"service_check_enabled\": false, \"test_check_interval\": 17, \"service_key_supported\": false, \"cf_guid\": {\"mapKey\": \"inner\"}}, \"plan\": {\"bindable\": true, \"reservable\": true, \"allow_internal_users\": true, \"async_provisioning_supported\": true, \"async_unprovisioning_supported\": true, \"test_check_interval\": 17, \"single_scope_instance\": \"singleScopeInstance\", \"service_check_enabled\": false, \"cf_guid\": {\"mapKey\": \"inner\"}}, \"alias\": {\"type\": \"type\", \"plan_id\": \"planId\"}, \"template\": {\"services\": [\"services\"], \"default_memory\": 13, \"start_cmd\": \"startCmd\", \"source\": {\"path\": \"path\", \"type\": \"type\", \"url\": \"url\"}, \"runtime_catalog_id\": \"runtimeCatalogId\", \"cf_runtime_id\": \"cfRuntimeId\", \"template_id\": \"templateId\", \"executable_file\": \"executableFile\", \"buildpack\": \"buildpack\", \"environment_variables\": {\"mapKey\": \"inner\"}}, \"ui\": {\"strings\": {\"mapKey\": {\"bullets\": [{\"title\": \"title\", \"description\": \"description\", \"icon\": \"icon\", \"quantity\": 8}], \"media\": [{\"caption\": \"caption\", \"thumbnail_url\": \"thumbnailUrl\", \"type\": \"type\", \"URL\": \"url\", \"source\": {\"title\": \"title\", \"description\": \"description\", \"icon\": \"icon\", \"quantity\": 8}}], \"not_creatable_msg\": \"notCreatableMsg\", \"not_creatable__robot_msg\": \"notCreatableRobotMsg\", \"deprecation_warning\": \"deprecationWarning\", \"popup_warning_message\": \"popupWarningMessage\", \"instruction\": \"instruction\"}}, \"urls\": {\"doc_url\": \"docUrl\", \"instructions_url\": \"instructionsUrl\", \"api_url\": \"apiUrl\", \"create_url\": \"createUrl\", \"sdk_download_url\": \"sdkDownloadUrl\", \"terms_url\": \"termsUrl\", \"custom_create_page_url\": \"customCreatePageUrl\", \"catalog_details_url\": \"catalogDetailsUrl\", \"deprecation_doc_url\": \"deprecationDocUrl\", \"dashboard_url\": \"dashboardUrl\", \"registration_url\": \"registrationUrl\", \"apidocsurl\": \"apidocsurl\"}, \"embeddable_dashboard\": \"embeddableDashboard\", \"embeddable_dashboard_full_width\": true, \"navigation_order\": [\"navigationOrder\"], \"not_creatable\": true, \"primary_offering_id\": \"primaryOfferingId\", \"accessible_during_provision\": false, \"side_by_side_index\": 15, \"end_of_service_time\": \"2019-01-01T12:00:00.000Z\", \"hidden\": true, \"hide_lite_metering\": true, \"no_upgrade_next_step\": false}, \"compliance\": [\"compliance\"], \"sla\": {\"terms\": \"terms\", \"tenancy\": \"tenancy\", \"provisioning\": \"provisioning\", \"responsiveness\": \"responsiveness\", \"dr\": {\"dr\": true, \"description\": \"description\"}}, \"callbacks\": {\"controller_url\": \"controllerUrl\", \"broker_url\": \"brokerUrl\", \"broker_proxy_url\": \"brokerProxyUrl\", \"dashboard_url\": \"dashboardUrl\", \"dashboard_data_url\": \"dashboardDataUrl\", \"dashboard_detail_tab_url\": \"dashboardDetailTabUrl\", \"dashboard_detail_tab_ext_url\": \"dashboardDetailTabExtUrl\", \"service_monitor_api\": \"serviceMonitorApi\", \"service_monitor_app\": \"serviceMonitorApp\", \"api_endpoint\": {\"mapKey\": \"inner\"}}, \"original_name\": \"originalName\", \"version\": \"version\", \"other\": {\"mapKey\": \"anyValue\"}, \"pricing\": {\"type\": \"type\", \"origin\": \"origin\", \"starting_price\": {\"plan_id\": \"planId\", \"deployment_id\": \"deploymentId\", \"unit\": \"unit\", \"amount\": [{\"country\": \"country\", \"currency\": \"currency\", \"prices\": [{\"quantity_tier\": 12, \"Price\": 5}]}]}, \"metrics\": [{\"part_ref\": \"partRef\", \"metric_id\": \"metricId\", \"tier_model\": \"tierModel\", \"charge_unit\": \"chargeUnit\", \"charge_unit_name\": \"chargeUnitName\", \"charge_unit_quantity\": \"chargeUnitQuantity\", \"resource_display_name\": \"resourceDisplayName\", \"charge_unit_display_name\": \"chargeUnitDisplayName\", \"usage_cap_qty\": 11, \"display_cap\": 10, \"effective_from\": \"2019-01-01T12:00:00.000Z\", \"effective_until\": \"2019-01-01T12:00:00.000Z\", \"amounts\": [{\"country\": \"country\", \"currency\": \"currency\", \"prices\": [{\"quantity_tier\": 12, \"Price\": 5}]}]}]}, \"deployment\": {\"location\": \"location\", \"location_url\": \"locationUrl\", \"original_location\": \"originalLocation\", \"target_crn\": \"targetCrn\", \"service_crn\": \"serviceCrn\", \"mccp_id\": \"mccpId\", \"broker\": {\"name\": \"name\", \"guid\": \"guid\"}, \"supports_rc_migration\": false, \"target_network\": \"targetNetwork\"}}, \"id\": \"id\", \"catalog_crn\": \"catalogCrn\", \"url\": \"url\", \"children_url\": \"childrenUrl\", \"geo_tags\": [\"geoTags\"], \"pricing_tags\": [\"pricingTags\"], \"created\": \"2019-01-01T12:00:00.000Z\", \"updated\": \"2019-01-01T12:00:00.000Z\"}]}"; + // Register a mock response + String mockResponseBody = "{\"offset\": 6, \"limit\": 5, \"count\": 5, \"resource_count\": 13, \"first\": \"first\", \"last\": \"last\", \"prev\": \"prev\", \"next\": \"next\", \"resources\": [{\"name\": \"name\", \"kind\": \"service\", \"overview_ui\": {\"mapKey\": {\"display_name\": \"displayName\", \"long_description\": \"longDescription\", \"description\": \"description\", \"featured_description\": \"featuredDescription\"}}, \"images\": {\"image\": \"image\", \"small_image\": \"smallImage\", \"medium_image\": \"mediumImage\", \"feature_image\": \"featureImage\"}, \"parent_id\": \"parentId\", \"disabled\": true, \"tags\": [\"tags\"], \"group\": false, \"provider\": {\"email\": \"email\", \"name\": \"name\", \"contact\": \"contact\", \"support_email\": \"supportEmail\", \"phone\": \"phone\"}, \"active\": true, \"url\": \"url\", \"metadata\": {\"rc_compatible\": true, \"service\": {\"type\": \"type\", \"iam_compatible\": false, \"unique_api_key\": true, \"provisionable\": false, \"bindable\": true, \"async_provisioning_supported\": true, \"async_unprovisioning_supported\": true, \"requires\": [\"requires\"], \"plan_updateable\": true, \"state\": \"state\", \"service_check_enabled\": false, \"test_check_interval\": 17, \"service_key_supported\": false, \"cf_guid\": {\"mapKey\": \"inner\"}}, \"plan\": {\"bindable\": true, \"reservable\": true, \"allow_internal_users\": true, \"async_provisioning_supported\": true, \"async_unprovisioning_supported\": true, \"test_check_interval\": 17, \"single_scope_instance\": \"singleScopeInstance\", \"service_check_enabled\": false, \"cf_guid\": {\"mapKey\": \"inner\"}}, \"alias\": {\"type\": \"type\", \"plan_id\": \"planId\"}, \"template\": {\"services\": [\"services\"], \"default_memory\": 13, \"start_cmd\": \"startCmd\", \"source\": {\"path\": \"path\", \"type\": \"type\", \"url\": \"url\"}, \"runtime_catalog_id\": \"runtimeCatalogId\", \"cf_runtime_id\": \"cfRuntimeId\", \"template_id\": \"templateId\", \"executable_file\": \"executableFile\", \"buildpack\": \"buildpack\", \"environment_variables\": {\"mapKey\": \"inner\"}}, \"ui\": {\"strings\": {\"mapKey\": {\"bullets\": [{\"title\": \"title\", \"description\": \"description\", \"icon\": \"icon\", \"quantity\": 8}], \"media\": [{\"caption\": \"caption\", \"thumbnail_url\": \"thumbnailUrl\", \"type\": \"type\", \"URL\": \"url\", \"source\": [{\"type\": \"type\", \"url\": \"url\"}]}], \"not_creatable_msg\": \"notCreatableMsg\", \"not_creatable__robot_msg\": \"notCreatableRobotMsg\", \"deprecation_warning\": \"deprecationWarning\", \"popup_warning_message\": \"popupWarningMessage\", \"instruction\": \"instruction\"}}, \"urls\": {\"doc_url\": \"docUrl\", \"instructions_url\": \"instructionsUrl\", \"api_url\": \"apiUrl\", \"create_url\": \"createUrl\", \"sdk_download_url\": \"sdkDownloadUrl\", \"terms_url\": \"termsUrl\", \"custom_create_page_url\": \"customCreatePageUrl\", \"catalog_details_url\": \"catalogDetailsUrl\", \"deprecation_doc_url\": \"deprecationDocUrl\", \"dashboard_url\": \"dashboardUrl\", \"registration_url\": \"registrationUrl\", \"apidocsurl\": \"apidocsurl\"}, \"embeddable_dashboard\": \"embeddableDashboard\", \"embeddable_dashboard_full_width\": true, \"navigation_order\": [\"navigationOrder\"], \"not_creatable\": true, \"primary_offering_id\": \"primaryOfferingId\", \"accessible_during_provision\": false, \"side_by_side_index\": 15, \"end_of_service_time\": \"2019-01-01T12:00:00.000Z\", \"hidden\": true, \"hide_lite_metering\": true, \"no_upgrade_next_step\": false}, \"compliance\": [\"compliance\"], \"sla\": {\"terms\": \"terms\", \"tenancy\": \"tenancy\", \"provisioning\": 12, \"responsiveness\": 14, \"dr\": {\"dr\": true, \"description\": \"description\"}}, \"callbacks\": {\"controller_url\": \"controllerUrl\", \"broker_url\": \"brokerUrl\", \"broker_proxy_url\": \"brokerProxyUrl\", \"dashboard_url\": \"dashboardUrl\", \"dashboard_data_url\": \"dashboardDataUrl\", \"dashboard_detail_tab_url\": \"dashboardDetailTabUrl\", \"dashboard_detail_tab_ext_url\": \"dashboardDetailTabExtUrl\", \"service_monitor_api\": \"serviceMonitorApi\", \"service_monitor_app\": \"serviceMonitorApp\", \"api_endpoint\": {\"mapKey\": \"inner\"}}, \"original_name\": \"originalName\", \"version\": \"version\", \"other\": {\"anyKey\": \"anyValue\"}, \"pricing\": {\"type\": \"type\", \"origin\": \"origin\", \"starting_price\": {\"plan_id\": \"planId\", \"deployment_id\": \"deploymentId\", \"unit\": \"unit\", \"amount\": [{\"country\": \"country\", \"currency\": \"currency\", \"prices\": [{\"quantity_tier\": 12, \"price\": 5}]}]}, \"deployment_id\": \"deploymentId\", \"deployment_location\": \"deploymentLocation\", \"deployment_location_no_price_available\": true, \"metrics\": [{\"part_ref\": \"partRef\", \"metric_id\": \"metricId\", \"tier_model\": \"tierModel\", \"charge_unit\": \"chargeUnit\", \"charge_unit_name\": \"chargeUnitName\", \"charge_unit_quantity\": 18, \"resource_display_name\": \"resourceDisplayName\", \"charge_unit_display_name\": \"chargeUnitDisplayName\", \"usage_cap_qty\": 11, \"display_cap\": 10, \"effective_from\": \"2019-01-01T12:00:00.000Z\", \"effective_until\": \"2019-01-01T12:00:00.000Z\", \"amounts\": [{\"country\": \"country\", \"currency\": \"currency\", \"prices\": [{\"quantity_tier\": 12, \"price\": 5}]}]}], \"deployment_regions\": [\"deploymentRegions\"]}, \"deployment\": {\"location\": \"location\", \"location_url\": \"locationUrl\", \"original_location\": \"originalLocation\", \"target_crn\": \"targetCrn\", \"service_crn\": \"serviceCrn\", \"mccp_id\": \"mccpId\", \"broker\": {\"name\": \"name\", \"guid\": \"guid\"}, \"supports_rc_migration\": false, \"target_network\": \"targetNetwork\"}}, \"id\": \"id\", \"catalog_crn\": \"catalogCrn\", \"children_url\": \"childrenUrl\", \"geo_tags\": [\"geoTags\"], \"pricing_tags\": [\"pricingTags\"], \"created\": \"2019-01-01T12:00:00.000Z\", \"updated\": \"2019-01-01T12:00:00.000Z\"}]}"; String listCatalogEntriesPath = "/"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - constructClientService(); + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); // Construct an instance of the ListCatalogEntriesOptions model ListCatalogEntriesOptions listCatalogEntriesOptionsModel = new ListCatalogEntriesOptions.Builder() - .account("testString") - .include("testString") - .q("testString") - .sortBy("testString") - .descending("testString") - .languages("testString") - .catalog(true) - .complete(true) - .offset(Long.valueOf("26")) - .limit(Long.valueOf("200")) - .build(); - - // Invoke operation with valid options model (positive test) + .account("testString") + .include("testString") + .q("testString") + .sortBy("testString") + .descending("testString") + .languages("testString") + .catalog(true) + .complete(true) + .offset(Long.valueOf("0")) + .limit(Long.valueOf("50")) + .build(); + + // Invoke listCatalogEntries() with a valid options model and verify the result Response response = globalCatalogService.listCatalogEntries(listCatalogEntriesOptionsModel).execute(); assertNotNull(response); EntrySearchResult responseObj = response.getResult(); assertNotNull(responseObj); - // Verify the contents of the request + // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); assertEquals(request.getMethod(), "GET"); - - // Check query + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, listCatalogEntriesPath); + // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - // Get query params assertEquals(query.get("account"), "testString"); assertEquals(query.get("include"), "testString"); assertEquals(query.get("q"), "testString"); @@ -162,774 +155,797 @@ public void testListCatalogEntriesWOptions() throws Throwable { assertEquals(query.get("languages"), "testString"); assertEquals(Boolean.valueOf(query.get("catalog")), Boolean.valueOf(true)); assertEquals(Boolean.valueOf(query.get("complete")), Boolean.valueOf(true)); - assertEquals(Long.valueOf(query.get("_offset")), Long.valueOf("26")); - assertEquals(Long.valueOf(query.get("_limit")), Long.valueOf("200")); - // Check request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listCatalogEntriesPath); + assertEquals(Long.valueOf(query.get("_offset")), Long.valueOf("0")); + assertEquals(Long.valueOf(query.get("_limit")), Long.valueOf("50")); } + // Test the listCatalogEntries operation with and without retries enabled + @Test + public void testListCatalogEntriesWRetries() throws Throwable { + globalCatalogService.enableRetries(4, 30); + testListCatalogEntriesWOptions(); + + globalCatalogService.disableRetries(); + testListCatalogEntriesWOptions(); + } + + // Test the createCatalogEntry operation with a valid options model parameter @Test public void testCreateCatalogEntryWOptions() throws Throwable { - // Schedule some responses. - String mockResponseBody = "{\"name\": \"name\", \"kind\": \"service\", \"overview_ui\": {\"mapKey\": {\"display_name\": \"displayName\", \"long_description\": \"longDescription\", \"description\": \"description\", \"featured_description\": \"featuredDescription\"}}, \"images\": {\"image\": \"image\", \"small_image\": \"smallImage\", \"medium_image\": \"mediumImage\", \"feature_image\": \"featureImage\"}, \"parent_id\": \"parentId\", \"disabled\": true, \"tags\": [\"tags\"], \"group\": false, \"provider\": {\"email\": \"email\", \"name\": \"name\", \"contact\": \"contact\", \"support_email\": \"supportEmail\", \"phone\": \"phone\"}, \"active\": true, \"metadata\": {\"rc_compatible\": true, \"service\": {\"type\": \"type\", \"iam_compatible\": false, \"unique_api_key\": true, \"provisionable\": false, \"bindable\": true, \"async_provisioning_supported\": true, \"async_unprovisioning_supported\": true, \"requires\": [\"requires\"], \"plan_updateable\": true, \"state\": \"state\", \"service_check_enabled\": false, \"test_check_interval\": 17, \"service_key_supported\": false, \"cf_guid\": {\"mapKey\": \"inner\"}}, \"plan\": {\"bindable\": true, \"reservable\": true, \"allow_internal_users\": true, \"async_provisioning_supported\": true, \"async_unprovisioning_supported\": true, \"test_check_interval\": 17, \"single_scope_instance\": \"singleScopeInstance\", \"service_check_enabled\": false, \"cf_guid\": {\"mapKey\": \"inner\"}}, \"alias\": {\"type\": \"type\", \"plan_id\": \"planId\"}, \"template\": {\"services\": [\"services\"], \"default_memory\": 13, \"start_cmd\": \"startCmd\", \"source\": {\"path\": \"path\", \"type\": \"type\", \"url\": \"url\"}, \"runtime_catalog_id\": \"runtimeCatalogId\", \"cf_runtime_id\": \"cfRuntimeId\", \"template_id\": \"templateId\", \"executable_file\": \"executableFile\", \"buildpack\": \"buildpack\", \"environment_variables\": {\"mapKey\": \"inner\"}}, \"ui\": {\"strings\": {\"mapKey\": {\"bullets\": [{\"title\": \"title\", \"description\": \"description\", \"icon\": \"icon\", \"quantity\": 8}], \"media\": [{\"caption\": \"caption\", \"thumbnail_url\": \"thumbnailUrl\", \"type\": \"type\", \"URL\": \"url\", \"source\": {\"title\": \"title\", \"description\": \"description\", \"icon\": \"icon\", \"quantity\": 8}}], \"not_creatable_msg\": \"notCreatableMsg\", \"not_creatable__robot_msg\": \"notCreatableRobotMsg\", \"deprecation_warning\": \"deprecationWarning\", \"popup_warning_message\": \"popupWarningMessage\", \"instruction\": \"instruction\"}}, \"urls\": {\"doc_url\": \"docUrl\", \"instructions_url\": \"instructionsUrl\", \"api_url\": \"apiUrl\", \"create_url\": \"createUrl\", \"sdk_download_url\": \"sdkDownloadUrl\", \"terms_url\": \"termsUrl\", \"custom_create_page_url\": \"customCreatePageUrl\", \"catalog_details_url\": \"catalogDetailsUrl\", \"deprecation_doc_url\": \"deprecationDocUrl\", \"dashboard_url\": \"dashboardUrl\", \"registration_url\": \"registrationUrl\", \"apidocsurl\": \"apidocsurl\"}, \"embeddable_dashboard\": \"embeddableDashboard\", \"embeddable_dashboard_full_width\": true, \"navigation_order\": [\"navigationOrder\"], \"not_creatable\": true, \"primary_offering_id\": \"primaryOfferingId\", \"accessible_during_provision\": false, \"side_by_side_index\": 15, \"end_of_service_time\": \"2019-01-01T12:00:00.000Z\", \"hidden\": true, \"hide_lite_metering\": true, \"no_upgrade_next_step\": false}, \"compliance\": [\"compliance\"], \"sla\": {\"terms\": \"terms\", \"tenancy\": \"tenancy\", \"provisioning\": \"provisioning\", \"responsiveness\": \"responsiveness\", \"dr\": {\"dr\": true, \"description\": \"description\"}}, \"callbacks\": {\"controller_url\": \"controllerUrl\", \"broker_url\": \"brokerUrl\", \"broker_proxy_url\": \"brokerProxyUrl\", \"dashboard_url\": \"dashboardUrl\", \"dashboard_data_url\": \"dashboardDataUrl\", \"dashboard_detail_tab_url\": \"dashboardDetailTabUrl\", \"dashboard_detail_tab_ext_url\": \"dashboardDetailTabExtUrl\", \"service_monitor_api\": \"serviceMonitorApi\", \"service_monitor_app\": \"serviceMonitorApp\", \"api_endpoint\": {\"mapKey\": \"inner\"}}, \"original_name\": \"originalName\", \"version\": \"version\", \"other\": {\"mapKey\": \"anyValue\"}, \"pricing\": {\"type\": \"type\", \"origin\": \"origin\", \"starting_price\": {\"plan_id\": \"planId\", \"deployment_id\": \"deploymentId\", \"unit\": \"unit\", \"amount\": [{\"country\": \"country\", \"currency\": \"currency\", \"prices\": [{\"quantity_tier\": 12, \"Price\": 5}]}]}, \"metrics\": [{\"part_ref\": \"partRef\", \"metric_id\": \"metricId\", \"tier_model\": \"tierModel\", \"charge_unit\": \"chargeUnit\", \"charge_unit_name\": \"chargeUnitName\", \"charge_unit_quantity\": \"chargeUnitQuantity\", \"resource_display_name\": \"resourceDisplayName\", \"charge_unit_display_name\": \"chargeUnitDisplayName\", \"usage_cap_qty\": 11, \"display_cap\": 10, \"effective_from\": \"2019-01-01T12:00:00.000Z\", \"effective_until\": \"2019-01-01T12:00:00.000Z\", \"amounts\": [{\"country\": \"country\", \"currency\": \"currency\", \"prices\": [{\"quantity_tier\": 12, \"Price\": 5}]}]}]}, \"deployment\": {\"location\": \"location\", \"location_url\": \"locationUrl\", \"original_location\": \"originalLocation\", \"target_crn\": \"targetCrn\", \"service_crn\": \"serviceCrn\", \"mccp_id\": \"mccpId\", \"broker\": {\"name\": \"name\", \"guid\": \"guid\"}, \"supports_rc_migration\": false, \"target_network\": \"targetNetwork\"}}, \"id\": \"id\", \"catalog_crn\": \"catalogCrn\", \"url\": \"url\", \"children_url\": \"childrenUrl\", \"geo_tags\": [\"geoTags\"], \"pricing_tags\": [\"pricingTags\"], \"created\": \"2019-01-01T12:00:00.000Z\", \"updated\": \"2019-01-01T12:00:00.000Z\"}"; + // Register a mock response + String mockResponseBody = "{\"name\": \"name\", \"kind\": \"service\", \"overview_ui\": {\"mapKey\": {\"display_name\": \"displayName\", \"long_description\": \"longDescription\", \"description\": \"description\", \"featured_description\": \"featuredDescription\"}}, \"images\": {\"image\": \"image\", \"small_image\": \"smallImage\", \"medium_image\": \"mediumImage\", \"feature_image\": \"featureImage\"}, \"parent_id\": \"parentId\", \"disabled\": true, \"tags\": [\"tags\"], \"group\": false, \"provider\": {\"email\": \"email\", \"name\": \"name\", \"contact\": \"contact\", \"support_email\": \"supportEmail\", \"phone\": \"phone\"}, \"active\": true, \"url\": \"url\", \"metadata\": {\"rc_compatible\": true, \"service\": {\"type\": \"type\", \"iam_compatible\": false, \"unique_api_key\": true, \"provisionable\": false, \"bindable\": true, \"async_provisioning_supported\": true, \"async_unprovisioning_supported\": true, \"requires\": [\"requires\"], \"plan_updateable\": true, \"state\": \"state\", \"service_check_enabled\": false, \"test_check_interval\": 17, \"service_key_supported\": false, \"cf_guid\": {\"mapKey\": \"inner\"}}, \"plan\": {\"bindable\": true, \"reservable\": true, \"allow_internal_users\": true, \"async_provisioning_supported\": true, \"async_unprovisioning_supported\": true, \"test_check_interval\": 17, \"single_scope_instance\": \"singleScopeInstance\", \"service_check_enabled\": false, \"cf_guid\": {\"mapKey\": \"inner\"}}, \"alias\": {\"type\": \"type\", \"plan_id\": \"planId\"}, \"template\": {\"services\": [\"services\"], \"default_memory\": 13, \"start_cmd\": \"startCmd\", \"source\": {\"path\": \"path\", \"type\": \"type\", \"url\": \"url\"}, \"runtime_catalog_id\": \"runtimeCatalogId\", \"cf_runtime_id\": \"cfRuntimeId\", \"template_id\": \"templateId\", \"executable_file\": \"executableFile\", \"buildpack\": \"buildpack\", \"environment_variables\": {\"mapKey\": \"inner\"}}, \"ui\": {\"strings\": {\"mapKey\": {\"bullets\": [{\"title\": \"title\", \"description\": \"description\", \"icon\": \"icon\", \"quantity\": 8}], \"media\": [{\"caption\": \"caption\", \"thumbnail_url\": \"thumbnailUrl\", \"type\": \"type\", \"URL\": \"url\", \"source\": [{\"type\": \"type\", \"url\": \"url\"}]}], \"not_creatable_msg\": \"notCreatableMsg\", \"not_creatable__robot_msg\": \"notCreatableRobotMsg\", \"deprecation_warning\": \"deprecationWarning\", \"popup_warning_message\": \"popupWarningMessage\", \"instruction\": \"instruction\"}}, \"urls\": {\"doc_url\": \"docUrl\", \"instructions_url\": \"instructionsUrl\", \"api_url\": \"apiUrl\", \"create_url\": \"createUrl\", \"sdk_download_url\": \"sdkDownloadUrl\", \"terms_url\": \"termsUrl\", \"custom_create_page_url\": \"customCreatePageUrl\", \"catalog_details_url\": \"catalogDetailsUrl\", \"deprecation_doc_url\": \"deprecationDocUrl\", \"dashboard_url\": \"dashboardUrl\", \"registration_url\": \"registrationUrl\", \"apidocsurl\": \"apidocsurl\"}, \"embeddable_dashboard\": \"embeddableDashboard\", \"embeddable_dashboard_full_width\": true, \"navigation_order\": [\"navigationOrder\"], \"not_creatable\": true, \"primary_offering_id\": \"primaryOfferingId\", \"accessible_during_provision\": false, \"side_by_side_index\": 15, \"end_of_service_time\": \"2019-01-01T12:00:00.000Z\", \"hidden\": true, \"hide_lite_metering\": true, \"no_upgrade_next_step\": false}, \"compliance\": [\"compliance\"], \"sla\": {\"terms\": \"terms\", \"tenancy\": \"tenancy\", \"provisioning\": 12, \"responsiveness\": 14, \"dr\": {\"dr\": true, \"description\": \"description\"}}, \"callbacks\": {\"controller_url\": \"controllerUrl\", \"broker_url\": \"brokerUrl\", \"broker_proxy_url\": \"brokerProxyUrl\", \"dashboard_url\": \"dashboardUrl\", \"dashboard_data_url\": \"dashboardDataUrl\", \"dashboard_detail_tab_url\": \"dashboardDetailTabUrl\", \"dashboard_detail_tab_ext_url\": \"dashboardDetailTabExtUrl\", \"service_monitor_api\": \"serviceMonitorApi\", \"service_monitor_app\": \"serviceMonitorApp\", \"api_endpoint\": {\"mapKey\": \"inner\"}}, \"original_name\": \"originalName\", \"version\": \"version\", \"other\": {\"anyKey\": \"anyValue\"}, \"pricing\": {\"type\": \"type\", \"origin\": \"origin\", \"starting_price\": {\"plan_id\": \"planId\", \"deployment_id\": \"deploymentId\", \"unit\": \"unit\", \"amount\": [{\"country\": \"country\", \"currency\": \"currency\", \"prices\": [{\"quantity_tier\": 12, \"price\": 5}]}]}, \"deployment_id\": \"deploymentId\", \"deployment_location\": \"deploymentLocation\", \"deployment_location_no_price_available\": true, \"metrics\": [{\"part_ref\": \"partRef\", \"metric_id\": \"metricId\", \"tier_model\": \"tierModel\", \"charge_unit\": \"chargeUnit\", \"charge_unit_name\": \"chargeUnitName\", \"charge_unit_quantity\": 18, \"resource_display_name\": \"resourceDisplayName\", \"charge_unit_display_name\": \"chargeUnitDisplayName\", \"usage_cap_qty\": 11, \"display_cap\": 10, \"effective_from\": \"2019-01-01T12:00:00.000Z\", \"effective_until\": \"2019-01-01T12:00:00.000Z\", \"amounts\": [{\"country\": \"country\", \"currency\": \"currency\", \"prices\": [{\"quantity_tier\": 12, \"price\": 5}]}]}], \"deployment_regions\": [\"deploymentRegions\"]}, \"deployment\": {\"location\": \"location\", \"location_url\": \"locationUrl\", \"original_location\": \"originalLocation\", \"target_crn\": \"targetCrn\", \"service_crn\": \"serviceCrn\", \"mccp_id\": \"mccpId\", \"broker\": {\"name\": \"name\", \"guid\": \"guid\"}, \"supports_rc_migration\": false, \"target_network\": \"targetNetwork\"}}, \"id\": \"id\", \"catalog_crn\": \"catalogCrn\", \"children_url\": \"childrenUrl\", \"geo_tags\": [\"geoTags\"], \"pricing_tags\": [\"pricingTags\"], \"created\": \"2019-01-01T12:00:00.000Z\", \"updated\": \"2019-01-01T12:00:00.000Z\"}"; String createCatalogEntryPath = "/"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(201) - .setBody(mockResponseBody)); - - constructClientService(); + .setHeader("Content-type", "application/json") + .setResponseCode(201) + .setBody(mockResponseBody)); // Construct an instance of the Overview model Overview overviewModel = new Overview.Builder() - .displayName("testString") - .longDescription("testString") - .description("testString") - .featuredDescription("testString") - .build(); + .displayName("testString") + .longDescription("testString") + .description("testString") + .featuredDescription("testString") + .build(); // Construct an instance of the Image model Image imageModel = new Image.Builder() - .image("testString") - .smallImage("testString") - .mediumImage("testString") - .featureImage("testString") - .build(); + .image("testString") + .smallImage("testString") + .mediumImage("testString") + .featureImage("testString") + .build(); // Construct an instance of the Provider model Provider providerModel = new Provider.Builder() - .email("testString") - .name("testString") - .contact("testString") - .supportEmail("testString") - .phone("testString") - .build(); + .email("testString") + .name("testString") + .contact("testString") + .supportEmail("testString") + .phone("testString") + .build(); // Construct an instance of the CFMetaData model CFMetaData cfMetaDataModel = new CFMetaData.Builder() - .type("testString") - .iamCompatible(true) - .uniqueApiKey(true) - .provisionable(true) - .bindable(true) - .asyncProvisioningSupported(true) - .asyncUnprovisioningSupported(true) - .requires(new java.util.ArrayList(java.util.Arrays.asList("testString"))) - .planUpdateable(true) - .state("testString") - .serviceCheckEnabled(true) - .testCheckInterval(Long.valueOf("26")) - .serviceKeySupported(true) - .cfGuid(new java.util.HashMap() { { put("foo", "testString"); } }) - .build(); + .type("testString") + .iamCompatible(true) + .uniqueApiKey(true) + .provisionable(true) + .bindable(true) + .asyncProvisioningSupported(true) + .asyncUnprovisioningSupported(true) + .requires(java.util.Arrays.asList("testString")) + .planUpdateable(true) + .state("testString") + .serviceCheckEnabled(true) + .testCheckInterval(Long.valueOf("26")) + .serviceKeySupported(true) + .cfGuid(java.util.Collections.singletonMap("key1", "testString")) + .build(); // Construct an instance of the PlanMetaData model PlanMetaData planMetaDataModel = new PlanMetaData.Builder() - .bindable(true) - .reservable(true) - .allowInternalUsers(true) - .asyncProvisioningSupported(true) - .asyncUnprovisioningSupported(true) - .testCheckInterval(Long.valueOf("26")) - .singleScopeInstance("testString") - .serviceCheckEnabled(true) - .cfGuid(new java.util.HashMap() { { put("foo", "testString"); } }) - .build(); + .bindable(true) + .reservable(true) + .allowInternalUsers(true) + .asyncProvisioningSupported(true) + .asyncUnprovisioningSupported(true) + .testCheckInterval(Long.valueOf("26")) + .singleScopeInstance("testString") + .serviceCheckEnabled(true) + .cfGuid(java.util.Collections.singletonMap("key1", "testString")) + .build(); // Construct an instance of the AliasMetaData model AliasMetaData aliasMetaDataModel = new AliasMetaData.Builder() - .type("testString") - .planId("testString") - .build(); + .type("testString") + .planId("testString") + .build(); // Construct an instance of the SourceMetaData model SourceMetaData sourceMetaDataModel = new SourceMetaData.Builder() - .path("testString") - .type("testString") - .url("testString") - .build(); + .path("testString") + .type("testString") + .url("testString") + .build(); // Construct an instance of the TemplateMetaData model TemplateMetaData templateMetaDataModel = new TemplateMetaData.Builder() - .services(new java.util.ArrayList(java.util.Arrays.asList("testString"))) - .defaultMemory(Long.valueOf("26")) - .startCmd("testString") - .source(sourceMetaDataModel) - .runtimeCatalogId("testString") - .cfRuntimeId("testString") - .templateId("testString") - .executableFile("testString") - .buildpack("testString") - .environmentVariables(new java.util.HashMap() { { put("foo", "testString"); } }) - .build(); + .services(java.util.Arrays.asList("testString")) + .defaultMemory(Long.valueOf("26")) + .startCmd("testString") + .source(sourceMetaDataModel) + .runtimeCatalogId("testString") + .cfRuntimeId("testString") + .templateId("testString") + .executableFile("testString") + .buildpack("testString") + .environmentVariables(java.util.Collections.singletonMap("key1", "testString")) + .build(); // Construct an instance of the Bullets model Bullets bulletsModel = new Bullets.Builder() - .title("testString") - .description("testString") - .icon("testString") - .quantity(Long.valueOf("26")) - .build(); + .title("testString") + .description("testString") + .icon("testString") + .quantity(Long.valueOf("26")) + .build(); + + // Construct an instance of the UIMediaSourceMetaData model + UIMediaSourceMetaData uiMediaSourceMetaDataModel = new UIMediaSourceMetaData.Builder() + .type("testString") + .url("testString") + .build(); // Construct an instance of the UIMetaMedia model UIMetaMedia uiMetaMediaModel = new UIMetaMedia.Builder() - .caption("testString") - .thumbnailUrl("testString") - .type("testString") - .url("testString") - .source(bulletsModel) - .build(); + .caption("testString") + .thumbnailUrl("testString") + .type("testString") + .url("testString") + .source(java.util.Arrays.asList(uiMediaSourceMetaDataModel)) + .build(); // Construct an instance of the Strings model Strings stringsModel = new Strings.Builder() - .bullets(new java.util.ArrayList(java.util.Arrays.asList(bulletsModel))) - .media(new java.util.ArrayList(java.util.Arrays.asList(uiMetaMediaModel))) - .notCreatableMsg("testString") - .notCreatableRobotMsg("testString") - .deprecationWarning("testString") - .popupWarningMessage("testString") - .instruction("testString") - .build(); + .bullets(java.util.Arrays.asList(bulletsModel)) + .media(java.util.Arrays.asList(uiMetaMediaModel)) + .notCreatableMsg("testString") + .notCreatableRobotMsg("testString") + .deprecationWarning("testString") + .popupWarningMessage("testString") + .instruction("testString") + .build(); // Construct an instance of the URLS model URLS urlsModel = new URLS.Builder() - .docUrl("testString") - .instructionsUrl("testString") - .apiUrl("testString") - .createUrl("testString") - .sdkDownloadUrl("testString") - .termsUrl("testString") - .customCreatePageUrl("testString") - .catalogDetailsUrl("testString") - .deprecationDocUrl("testString") - .dashboardUrl("testString") - .registrationUrl("testString") - .apidocsurl("testString") - .build(); + .docUrl("testString") + .instructionsUrl("testString") + .apiUrl("testString") + .createUrl("testString") + .sdkDownloadUrl("testString") + .termsUrl("testString") + .customCreatePageUrl("testString") + .catalogDetailsUrl("testString") + .deprecationDocUrl("testString") + .dashboardUrl("testString") + .registrationUrl("testString") + .apidocsurl("testString") + .build(); // Construct an instance of the UIMetaData model UIMetaData uiMetaDataModel = new UIMetaData.Builder() - .strings(new java.util.HashMap() { { put("foo", stringsModel); } }) - .urls(urlsModel) - .embeddableDashboard("testString") - .embeddableDashboardFullWidth(true) - .navigationOrder(new java.util.ArrayList(java.util.Arrays.asList("testString"))) - .notCreatable(true) - .primaryOfferingId("testString") - .accessibleDuringProvision(true) - .sideBySideIndex(Long.valueOf("26")) - .endOfServiceTime(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) - .hidden(true) - .hideLiteMetering(true) - .noUpgradeNextStep(true) - .build(); + .strings(java.util.Collections.singletonMap("key1", stringsModel)) + .urls(urlsModel) + .embeddableDashboard("testString") + .embeddableDashboardFullWidth(true) + .navigationOrder(java.util.Arrays.asList("testString")) + .notCreatable(true) + .primaryOfferingId("testString") + .accessibleDuringProvision(true) + .sideBySideIndex(Long.valueOf("26")) + .endOfServiceTime(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) + .hidden(true) + .hideLiteMetering(true) + .noUpgradeNextStep(true) + .build(); // Construct an instance of the DRMetaData model DRMetaData drMetaDataModel = new DRMetaData.Builder() - .dr(true) - .description("testString") - .build(); + .dr(true) + .description("testString") + .build(); // Construct an instance of the SLAMetaData model SLAMetaData slaMetaDataModel = new SLAMetaData.Builder() - .terms("testString") - .tenancy("testString") - .provisioning("testString") - .responsiveness("testString") - .dr(drMetaDataModel) - .build(); + .terms("testString") + .tenancy("testString") + .provisioning(Double.valueOf("72.5")) + .responsiveness(Double.valueOf("72.5")) + .dr(drMetaDataModel) + .build(); // Construct an instance of the Callbacks model Callbacks callbacksModel = new Callbacks.Builder() - .controllerUrl("testString") - .brokerUrl("testString") - .brokerProxyUrl("testString") - .dashboardUrl("testString") - .dashboardDataUrl("testString") - .dashboardDetailTabUrl("testString") - .dashboardDetailTabExtUrl("testString") - .serviceMonitorApi("testString") - .serviceMonitorApp("testString") - .apiEndpoint(new java.util.HashMap() { { put("foo", "testString"); } }) - .build(); + .controllerUrl("testString") + .brokerUrl("testString") + .brokerProxyUrl("testString") + .dashboardUrl("testString") + .dashboardDataUrl("testString") + .dashboardDetailTabUrl("testString") + .dashboardDetailTabExtUrl("testString") + .serviceMonitorApi("testString") + .serviceMonitorApp("testString") + .apiEndpoint(java.util.Collections.singletonMap("key1", "testString")) + .build(); // Construct an instance of the Price model Price priceModel = new Price.Builder() - .quantityTier(Long.valueOf("26")) - .price(Double.valueOf("72.5")) - .build(); + .quantityTier(Long.valueOf("26")) + .price(Double.valueOf("72.5")) + .build(); // Construct an instance of the Amount model Amount amountModel = new Amount.Builder() - .country("testString") - .currency("testString") - .prices(new java.util.ArrayList(java.util.Arrays.asList(priceModel))) - .build(); + .country("testString") + .currency("testString") + .prices(java.util.Arrays.asList(priceModel)) + .build(); // Construct an instance of the StartingPrice model StartingPrice startingPriceModel = new StartingPrice.Builder() - .planId("testString") - .deploymentId("testString") - .unit("testString") - .amount(new java.util.ArrayList(java.util.Arrays.asList(amountModel))) - .build(); + .planId("testString") + .deploymentId("testString") + .unit("testString") + .amount(java.util.Arrays.asList(amountModel)) + .build(); // Construct an instance of the PricingSet model PricingSet pricingSetModel = new PricingSet.Builder() - .type("testString") - .origin("testString") - .startingPrice(startingPriceModel) - .build(); + .type("testString") + .origin("testString") + .startingPrice(startingPriceModel) + .build(); // Construct an instance of the Broker model Broker brokerModel = new Broker.Builder() - .name("testString") - .guid("testString") - .build(); + .name("testString") + .guid("testString") + .build(); // Construct an instance of the DeploymentBase model DeploymentBase deploymentBaseModel = new DeploymentBase.Builder() - .location("testString") - .locationUrl("testString") - .originalLocation("testString") - .targetCrn("testString") - .serviceCrn("testString") - .mccpId("testString") - .broker(brokerModel) - .supportsRcMigration(true) - .targetNetwork("testString") - .build(); + .location("testString") + .locationUrl("testString") + .originalLocation("testString") + .targetCrn("testString") + .serviceCrn("testString") + .mccpId("testString") + .broker(brokerModel) + .supportsRcMigration(true) + .targetNetwork("testString") + .build(); // Construct an instance of the ObjectMetadataSet model ObjectMetadataSet objectMetadataSetModel = new ObjectMetadataSet.Builder() - .rcCompatible(true) - .service(cfMetaDataModel) - .plan(planMetaDataModel) - .alias(aliasMetaDataModel) - .template(templateMetaDataModel) - .ui(uiMetaDataModel) - .compliance(new java.util.ArrayList(java.util.Arrays.asList("testString"))) - .sla(slaMetaDataModel) - .callbacks(callbacksModel) - .originalName("testString") - .version("testString") - .other(new java.util.HashMap() { { put("foo", "testString"); } }) - .pricing(pricingSetModel) - .deployment(deploymentBaseModel) - .build(); + .rcCompatible(true) + .service(cfMetaDataModel) + .plan(planMetaDataModel) + .alias(aliasMetaDataModel) + .template(templateMetaDataModel) + .ui(uiMetaDataModel) + .compliance(java.util.Arrays.asList("testString")) + .sla(slaMetaDataModel) + .callbacks(callbacksModel) + .originalName("testString") + .version("testString") + .other(java.util.Collections.singletonMap("anyKey", "anyValue")) + .pricing(pricingSetModel) + .deployment(deploymentBaseModel) + .build(); // Construct an instance of the CreateCatalogEntryOptions model CreateCatalogEntryOptions createCatalogEntryOptionsModel = new CreateCatalogEntryOptions.Builder() - .name("testString") - .kind("service") - .overviewUi(new java.util.HashMap() { { put("foo", overviewModel); } }) - .images(imageModel) - .disabled(true) - .tags(new java.util.ArrayList(java.util.Arrays.asList("testString"))) - .provider(providerModel) - .id("testString") - .parentId("testString") - .group(true) - .active(true) - .metadata(objectMetadataSetModel) - .account("testString") - .build(); - - // Invoke operation with valid options model (positive test) + .name("testString") + .kind("service") + .overviewUi(java.util.Collections.singletonMap("key1", overviewModel)) + .images(imageModel) + .disabled(true) + .tags(java.util.Arrays.asList("testString")) + .provider(providerModel) + .id("testString") + .parentId("testString") + .group(true) + .active(true) + .url("testString") + .metadata(objectMetadataSetModel) + .account("testString") + .build(); + + // Invoke createCatalogEntry() with a valid options model and verify the result Response response = globalCatalogService.createCatalogEntry(createCatalogEntryOptionsModel).execute(); assertNotNull(response); CatalogEntry responseObj = response.getResult(); assertNotNull(responseObj); - // Verify the contents of the request + // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); assertEquals(request.getMethod(), "POST"); - - // Check query + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, createCatalogEntryPath); + // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - // Get query params assertEquals(query.get("account"), "testString"); - // Check request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createCatalogEntryPath); } - // Test the createCatalogEntry operation with null options model parameter + // Test the createCatalogEntry operation with and without retries enabled + @Test + public void testCreateCatalogEntryWRetries() throws Throwable { + globalCatalogService.enableRetries(4, 30); + testCreateCatalogEntryWOptions(); + + globalCatalogService.disableRetries(); + testCreateCatalogEntryWOptions(); + } + + // Test the createCatalogEntry operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) public void testCreateCatalogEntryNoOptions() throws Throwable { - // construct the service - constructClientService(); - server.enqueue(new MockResponse()); - - // Invoke operation with null options model (negative test) globalCatalogService.createCatalogEntry(null).execute(); } + // Test the getCatalogEntry operation with a valid options model parameter @Test public void testGetCatalogEntryWOptions() throws Throwable { - // Schedule some responses. - String mockResponseBody = "{\"name\": \"name\", \"kind\": \"service\", \"overview_ui\": {\"mapKey\": {\"display_name\": \"displayName\", \"long_description\": \"longDescription\", \"description\": \"description\", \"featured_description\": \"featuredDescription\"}}, \"images\": {\"image\": \"image\", \"small_image\": \"smallImage\", \"medium_image\": \"mediumImage\", \"feature_image\": \"featureImage\"}, \"parent_id\": \"parentId\", \"disabled\": true, \"tags\": [\"tags\"], \"group\": false, \"provider\": {\"email\": \"email\", \"name\": \"name\", \"contact\": \"contact\", \"support_email\": \"supportEmail\", \"phone\": \"phone\"}, \"active\": true, \"metadata\": {\"rc_compatible\": true, \"service\": {\"type\": \"type\", \"iam_compatible\": false, \"unique_api_key\": true, \"provisionable\": false, \"bindable\": true, \"async_provisioning_supported\": true, \"async_unprovisioning_supported\": true, \"requires\": [\"requires\"], \"plan_updateable\": true, \"state\": \"state\", \"service_check_enabled\": false, \"test_check_interval\": 17, \"service_key_supported\": false, \"cf_guid\": {\"mapKey\": \"inner\"}}, \"plan\": {\"bindable\": true, \"reservable\": true, \"allow_internal_users\": true, \"async_provisioning_supported\": true, \"async_unprovisioning_supported\": true, \"test_check_interval\": 17, \"single_scope_instance\": \"singleScopeInstance\", \"service_check_enabled\": false, \"cf_guid\": {\"mapKey\": \"inner\"}}, \"alias\": {\"type\": \"type\", \"plan_id\": \"planId\"}, \"template\": {\"services\": [\"services\"], \"default_memory\": 13, \"start_cmd\": \"startCmd\", \"source\": {\"path\": \"path\", \"type\": \"type\", \"url\": \"url\"}, \"runtime_catalog_id\": \"runtimeCatalogId\", \"cf_runtime_id\": \"cfRuntimeId\", \"template_id\": \"templateId\", \"executable_file\": \"executableFile\", \"buildpack\": \"buildpack\", \"environment_variables\": {\"mapKey\": \"inner\"}}, \"ui\": {\"strings\": {\"mapKey\": {\"bullets\": [{\"title\": \"title\", \"description\": \"description\", \"icon\": \"icon\", \"quantity\": 8}], \"media\": [{\"caption\": \"caption\", \"thumbnail_url\": \"thumbnailUrl\", \"type\": \"type\", \"URL\": \"url\", \"source\": {\"title\": \"title\", \"description\": \"description\", \"icon\": \"icon\", \"quantity\": 8}}], \"not_creatable_msg\": \"notCreatableMsg\", \"not_creatable__robot_msg\": \"notCreatableRobotMsg\", \"deprecation_warning\": \"deprecationWarning\", \"popup_warning_message\": \"popupWarningMessage\", \"instruction\": \"instruction\"}}, \"urls\": {\"doc_url\": \"docUrl\", \"instructions_url\": \"instructionsUrl\", \"api_url\": \"apiUrl\", \"create_url\": \"createUrl\", \"sdk_download_url\": \"sdkDownloadUrl\", \"terms_url\": \"termsUrl\", \"custom_create_page_url\": \"customCreatePageUrl\", \"catalog_details_url\": \"catalogDetailsUrl\", \"deprecation_doc_url\": \"deprecationDocUrl\", \"dashboard_url\": \"dashboardUrl\", \"registration_url\": \"registrationUrl\", \"apidocsurl\": \"apidocsurl\"}, \"embeddable_dashboard\": \"embeddableDashboard\", \"embeddable_dashboard_full_width\": true, \"navigation_order\": [\"navigationOrder\"], \"not_creatable\": true, \"primary_offering_id\": \"primaryOfferingId\", \"accessible_during_provision\": false, \"side_by_side_index\": 15, \"end_of_service_time\": \"2019-01-01T12:00:00.000Z\", \"hidden\": true, \"hide_lite_metering\": true, \"no_upgrade_next_step\": false}, \"compliance\": [\"compliance\"], \"sla\": {\"terms\": \"terms\", \"tenancy\": \"tenancy\", \"provisioning\": \"provisioning\", \"responsiveness\": \"responsiveness\", \"dr\": {\"dr\": true, \"description\": \"description\"}}, \"callbacks\": {\"controller_url\": \"controllerUrl\", \"broker_url\": \"brokerUrl\", \"broker_proxy_url\": \"brokerProxyUrl\", \"dashboard_url\": \"dashboardUrl\", \"dashboard_data_url\": \"dashboardDataUrl\", \"dashboard_detail_tab_url\": \"dashboardDetailTabUrl\", \"dashboard_detail_tab_ext_url\": \"dashboardDetailTabExtUrl\", \"service_monitor_api\": \"serviceMonitorApi\", \"service_monitor_app\": \"serviceMonitorApp\", \"api_endpoint\": {\"mapKey\": \"inner\"}}, \"original_name\": \"originalName\", \"version\": \"version\", \"other\": {\"mapKey\": \"anyValue\"}, \"pricing\": {\"type\": \"type\", \"origin\": \"origin\", \"starting_price\": {\"plan_id\": \"planId\", \"deployment_id\": \"deploymentId\", \"unit\": \"unit\", \"amount\": [{\"country\": \"country\", \"currency\": \"currency\", \"prices\": [{\"quantity_tier\": 12, \"Price\": 5}]}]}, \"metrics\": [{\"part_ref\": \"partRef\", \"metric_id\": \"metricId\", \"tier_model\": \"tierModel\", \"charge_unit\": \"chargeUnit\", \"charge_unit_name\": \"chargeUnitName\", \"charge_unit_quantity\": \"chargeUnitQuantity\", \"resource_display_name\": \"resourceDisplayName\", \"charge_unit_display_name\": \"chargeUnitDisplayName\", \"usage_cap_qty\": 11, \"display_cap\": 10, \"effective_from\": \"2019-01-01T12:00:00.000Z\", \"effective_until\": \"2019-01-01T12:00:00.000Z\", \"amounts\": [{\"country\": \"country\", \"currency\": \"currency\", \"prices\": [{\"quantity_tier\": 12, \"Price\": 5}]}]}]}, \"deployment\": {\"location\": \"location\", \"location_url\": \"locationUrl\", \"original_location\": \"originalLocation\", \"target_crn\": \"targetCrn\", \"service_crn\": \"serviceCrn\", \"mccp_id\": \"mccpId\", \"broker\": {\"name\": \"name\", \"guid\": \"guid\"}, \"supports_rc_migration\": false, \"target_network\": \"targetNetwork\"}}, \"id\": \"id\", \"catalog_crn\": \"catalogCrn\", \"url\": \"url\", \"children_url\": \"childrenUrl\", \"geo_tags\": [\"geoTags\"], \"pricing_tags\": [\"pricingTags\"], \"created\": \"2019-01-01T12:00:00.000Z\", \"updated\": \"2019-01-01T12:00:00.000Z\"}"; + // Register a mock response + String mockResponseBody = "{\"name\": \"name\", \"kind\": \"service\", \"overview_ui\": {\"mapKey\": {\"display_name\": \"displayName\", \"long_description\": \"longDescription\", \"description\": \"description\", \"featured_description\": \"featuredDescription\"}}, \"images\": {\"image\": \"image\", \"small_image\": \"smallImage\", \"medium_image\": \"mediumImage\", \"feature_image\": \"featureImage\"}, \"parent_id\": \"parentId\", \"disabled\": true, \"tags\": [\"tags\"], \"group\": false, \"provider\": {\"email\": \"email\", \"name\": \"name\", \"contact\": \"contact\", \"support_email\": \"supportEmail\", \"phone\": \"phone\"}, \"active\": true, \"url\": \"url\", \"metadata\": {\"rc_compatible\": true, \"service\": {\"type\": \"type\", \"iam_compatible\": false, \"unique_api_key\": true, \"provisionable\": false, \"bindable\": true, \"async_provisioning_supported\": true, \"async_unprovisioning_supported\": true, \"requires\": [\"requires\"], \"plan_updateable\": true, \"state\": \"state\", \"service_check_enabled\": false, \"test_check_interval\": 17, \"service_key_supported\": false, \"cf_guid\": {\"mapKey\": \"inner\"}}, \"plan\": {\"bindable\": true, \"reservable\": true, \"allow_internal_users\": true, \"async_provisioning_supported\": true, \"async_unprovisioning_supported\": true, \"test_check_interval\": 17, \"single_scope_instance\": \"singleScopeInstance\", \"service_check_enabled\": false, \"cf_guid\": {\"mapKey\": \"inner\"}}, \"alias\": {\"type\": \"type\", \"plan_id\": \"planId\"}, \"template\": {\"services\": [\"services\"], \"default_memory\": 13, \"start_cmd\": \"startCmd\", \"source\": {\"path\": \"path\", \"type\": \"type\", \"url\": \"url\"}, \"runtime_catalog_id\": \"runtimeCatalogId\", \"cf_runtime_id\": \"cfRuntimeId\", \"template_id\": \"templateId\", \"executable_file\": \"executableFile\", \"buildpack\": \"buildpack\", \"environment_variables\": {\"mapKey\": \"inner\"}}, \"ui\": {\"strings\": {\"mapKey\": {\"bullets\": [{\"title\": \"title\", \"description\": \"description\", \"icon\": \"icon\", \"quantity\": 8}], \"media\": [{\"caption\": \"caption\", \"thumbnail_url\": \"thumbnailUrl\", \"type\": \"type\", \"URL\": \"url\", \"source\": [{\"type\": \"type\", \"url\": \"url\"}]}], \"not_creatable_msg\": \"notCreatableMsg\", \"not_creatable__robot_msg\": \"notCreatableRobotMsg\", \"deprecation_warning\": \"deprecationWarning\", \"popup_warning_message\": \"popupWarningMessage\", \"instruction\": \"instruction\"}}, \"urls\": {\"doc_url\": \"docUrl\", \"instructions_url\": \"instructionsUrl\", \"api_url\": \"apiUrl\", \"create_url\": \"createUrl\", \"sdk_download_url\": \"sdkDownloadUrl\", \"terms_url\": \"termsUrl\", \"custom_create_page_url\": \"customCreatePageUrl\", \"catalog_details_url\": \"catalogDetailsUrl\", \"deprecation_doc_url\": \"deprecationDocUrl\", \"dashboard_url\": \"dashboardUrl\", \"registration_url\": \"registrationUrl\", \"apidocsurl\": \"apidocsurl\"}, \"embeddable_dashboard\": \"embeddableDashboard\", \"embeddable_dashboard_full_width\": true, \"navigation_order\": [\"navigationOrder\"], \"not_creatable\": true, \"primary_offering_id\": \"primaryOfferingId\", \"accessible_during_provision\": false, \"side_by_side_index\": 15, \"end_of_service_time\": \"2019-01-01T12:00:00.000Z\", \"hidden\": true, \"hide_lite_metering\": true, \"no_upgrade_next_step\": false}, \"compliance\": [\"compliance\"], \"sla\": {\"terms\": \"terms\", \"tenancy\": \"tenancy\", \"provisioning\": 12, \"responsiveness\": 14, \"dr\": {\"dr\": true, \"description\": \"description\"}}, \"callbacks\": {\"controller_url\": \"controllerUrl\", \"broker_url\": \"brokerUrl\", \"broker_proxy_url\": \"brokerProxyUrl\", \"dashboard_url\": \"dashboardUrl\", \"dashboard_data_url\": \"dashboardDataUrl\", \"dashboard_detail_tab_url\": \"dashboardDetailTabUrl\", \"dashboard_detail_tab_ext_url\": \"dashboardDetailTabExtUrl\", \"service_monitor_api\": \"serviceMonitorApi\", \"service_monitor_app\": \"serviceMonitorApp\", \"api_endpoint\": {\"mapKey\": \"inner\"}}, \"original_name\": \"originalName\", \"version\": \"version\", \"other\": {\"anyKey\": \"anyValue\"}, \"pricing\": {\"type\": \"type\", \"origin\": \"origin\", \"starting_price\": {\"plan_id\": \"planId\", \"deployment_id\": \"deploymentId\", \"unit\": \"unit\", \"amount\": [{\"country\": \"country\", \"currency\": \"currency\", \"prices\": [{\"quantity_tier\": 12, \"price\": 5}]}]}, \"deployment_id\": \"deploymentId\", \"deployment_location\": \"deploymentLocation\", \"deployment_location_no_price_available\": true, \"metrics\": [{\"part_ref\": \"partRef\", \"metric_id\": \"metricId\", \"tier_model\": \"tierModel\", \"charge_unit\": \"chargeUnit\", \"charge_unit_name\": \"chargeUnitName\", \"charge_unit_quantity\": 18, \"resource_display_name\": \"resourceDisplayName\", \"charge_unit_display_name\": \"chargeUnitDisplayName\", \"usage_cap_qty\": 11, \"display_cap\": 10, \"effective_from\": \"2019-01-01T12:00:00.000Z\", \"effective_until\": \"2019-01-01T12:00:00.000Z\", \"amounts\": [{\"country\": \"country\", \"currency\": \"currency\", \"prices\": [{\"quantity_tier\": 12, \"price\": 5}]}]}], \"deployment_regions\": [\"deploymentRegions\"]}, \"deployment\": {\"location\": \"location\", \"location_url\": \"locationUrl\", \"original_location\": \"originalLocation\", \"target_crn\": \"targetCrn\", \"service_crn\": \"serviceCrn\", \"mccp_id\": \"mccpId\", \"broker\": {\"name\": \"name\", \"guid\": \"guid\"}, \"supports_rc_migration\": false, \"target_network\": \"targetNetwork\"}}, \"id\": \"id\", \"catalog_crn\": \"catalogCrn\", \"children_url\": \"childrenUrl\", \"geo_tags\": [\"geoTags\"], \"pricing_tags\": [\"pricingTags\"], \"created\": \"2019-01-01T12:00:00.000Z\", \"updated\": \"2019-01-01T12:00:00.000Z\"}"; String getCatalogEntryPath = "/testString"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - constructClientService(); + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); // Construct an instance of the GetCatalogEntryOptions model GetCatalogEntryOptions getCatalogEntryOptionsModel = new GetCatalogEntryOptions.Builder() - .id("testString") - .account("testString") - .include("testString") - .languages("testString") - .complete(true) - .depth(Long.valueOf("26")) - .build(); - - // Invoke operation with valid options model (positive test) + .id("testString") + .account("testString") + .include("testString") + .languages("testString") + .complete(true) + .depth(Long.valueOf("26")) + .build(); + + // Invoke getCatalogEntry() with a valid options model and verify the result Response response = globalCatalogService.getCatalogEntry(getCatalogEntryOptionsModel).execute(); assertNotNull(response); CatalogEntry responseObj = response.getResult(); assertNotNull(responseObj); - // Verify the contents of the request + // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); assertEquals(request.getMethod(), "GET"); - - // Check query + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, getCatalogEntryPath); + // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - // Get query params assertEquals(query.get("account"), "testString"); assertEquals(query.get("include"), "testString"); assertEquals(query.get("languages"), "testString"); assertEquals(Boolean.valueOf(query.get("complete")), Boolean.valueOf(true)); assertEquals(Long.valueOf(query.get("depth")), Long.valueOf("26")); - // Check request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getCatalogEntryPath); } - // Test the getCatalogEntry operation with null options model parameter + // Test the getCatalogEntry operation with and without retries enabled + @Test + public void testGetCatalogEntryWRetries() throws Throwable { + globalCatalogService.enableRetries(4, 30); + testGetCatalogEntryWOptions(); + + globalCatalogService.disableRetries(); + testGetCatalogEntryWOptions(); + } + + // Test the getCatalogEntry operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) public void testGetCatalogEntryNoOptions() throws Throwable { - // construct the service - constructClientService(); - server.enqueue(new MockResponse()); - - // Invoke operation with null options model (negative test) globalCatalogService.getCatalogEntry(null).execute(); } + // Test the updateCatalogEntry operation with a valid options model parameter @Test public void testUpdateCatalogEntryWOptions() throws Throwable { - // Schedule some responses. - String mockResponseBody = "{\"name\": \"name\", \"kind\": \"service\", \"overview_ui\": {\"mapKey\": {\"display_name\": \"displayName\", \"long_description\": \"longDescription\", \"description\": \"description\", \"featured_description\": \"featuredDescription\"}}, \"images\": {\"image\": \"image\", \"small_image\": \"smallImage\", \"medium_image\": \"mediumImage\", \"feature_image\": \"featureImage\"}, \"parent_id\": \"parentId\", \"disabled\": true, \"tags\": [\"tags\"], \"group\": false, \"provider\": {\"email\": \"email\", \"name\": \"name\", \"contact\": \"contact\", \"support_email\": \"supportEmail\", \"phone\": \"phone\"}, \"active\": true, \"metadata\": {\"rc_compatible\": true, \"service\": {\"type\": \"type\", \"iam_compatible\": false, \"unique_api_key\": true, \"provisionable\": false, \"bindable\": true, \"async_provisioning_supported\": true, \"async_unprovisioning_supported\": true, \"requires\": [\"requires\"], \"plan_updateable\": true, \"state\": \"state\", \"service_check_enabled\": false, \"test_check_interval\": 17, \"service_key_supported\": false, \"cf_guid\": {\"mapKey\": \"inner\"}}, \"plan\": {\"bindable\": true, \"reservable\": true, \"allow_internal_users\": true, \"async_provisioning_supported\": true, \"async_unprovisioning_supported\": true, \"test_check_interval\": 17, \"single_scope_instance\": \"singleScopeInstance\", \"service_check_enabled\": false, \"cf_guid\": {\"mapKey\": \"inner\"}}, \"alias\": {\"type\": \"type\", \"plan_id\": \"planId\"}, \"template\": {\"services\": [\"services\"], \"default_memory\": 13, \"start_cmd\": \"startCmd\", \"source\": {\"path\": \"path\", \"type\": \"type\", \"url\": \"url\"}, \"runtime_catalog_id\": \"runtimeCatalogId\", \"cf_runtime_id\": \"cfRuntimeId\", \"template_id\": \"templateId\", \"executable_file\": \"executableFile\", \"buildpack\": \"buildpack\", \"environment_variables\": {\"mapKey\": \"inner\"}}, \"ui\": {\"strings\": {\"mapKey\": {\"bullets\": [{\"title\": \"title\", \"description\": \"description\", \"icon\": \"icon\", \"quantity\": 8}], \"media\": [{\"caption\": \"caption\", \"thumbnail_url\": \"thumbnailUrl\", \"type\": \"type\", \"URL\": \"url\", \"source\": {\"title\": \"title\", \"description\": \"description\", \"icon\": \"icon\", \"quantity\": 8}}], \"not_creatable_msg\": \"notCreatableMsg\", \"not_creatable__robot_msg\": \"notCreatableRobotMsg\", \"deprecation_warning\": \"deprecationWarning\", \"popup_warning_message\": \"popupWarningMessage\", \"instruction\": \"instruction\"}}, \"urls\": {\"doc_url\": \"docUrl\", \"instructions_url\": \"instructionsUrl\", \"api_url\": \"apiUrl\", \"create_url\": \"createUrl\", \"sdk_download_url\": \"sdkDownloadUrl\", \"terms_url\": \"termsUrl\", \"custom_create_page_url\": \"customCreatePageUrl\", \"catalog_details_url\": \"catalogDetailsUrl\", \"deprecation_doc_url\": \"deprecationDocUrl\", \"dashboard_url\": \"dashboardUrl\", \"registration_url\": \"registrationUrl\", \"apidocsurl\": \"apidocsurl\"}, \"embeddable_dashboard\": \"embeddableDashboard\", \"embeddable_dashboard_full_width\": true, \"navigation_order\": [\"navigationOrder\"], \"not_creatable\": true, \"primary_offering_id\": \"primaryOfferingId\", \"accessible_during_provision\": false, \"side_by_side_index\": 15, \"end_of_service_time\": \"2019-01-01T12:00:00.000Z\", \"hidden\": true, \"hide_lite_metering\": true, \"no_upgrade_next_step\": false}, \"compliance\": [\"compliance\"], \"sla\": {\"terms\": \"terms\", \"tenancy\": \"tenancy\", \"provisioning\": \"provisioning\", \"responsiveness\": \"responsiveness\", \"dr\": {\"dr\": true, \"description\": \"description\"}}, \"callbacks\": {\"controller_url\": \"controllerUrl\", \"broker_url\": \"brokerUrl\", \"broker_proxy_url\": \"brokerProxyUrl\", \"dashboard_url\": \"dashboardUrl\", \"dashboard_data_url\": \"dashboardDataUrl\", \"dashboard_detail_tab_url\": \"dashboardDetailTabUrl\", \"dashboard_detail_tab_ext_url\": \"dashboardDetailTabExtUrl\", \"service_monitor_api\": \"serviceMonitorApi\", \"service_monitor_app\": \"serviceMonitorApp\", \"api_endpoint\": {\"mapKey\": \"inner\"}}, \"original_name\": \"originalName\", \"version\": \"version\", \"other\": {\"mapKey\": \"anyValue\"}, \"pricing\": {\"type\": \"type\", \"origin\": \"origin\", \"starting_price\": {\"plan_id\": \"planId\", \"deployment_id\": \"deploymentId\", \"unit\": \"unit\", \"amount\": [{\"country\": \"country\", \"currency\": \"currency\", \"prices\": [{\"quantity_tier\": 12, \"Price\": 5}]}]}, \"metrics\": [{\"part_ref\": \"partRef\", \"metric_id\": \"metricId\", \"tier_model\": \"tierModel\", \"charge_unit\": \"chargeUnit\", \"charge_unit_name\": \"chargeUnitName\", \"charge_unit_quantity\": \"chargeUnitQuantity\", \"resource_display_name\": \"resourceDisplayName\", \"charge_unit_display_name\": \"chargeUnitDisplayName\", \"usage_cap_qty\": 11, \"display_cap\": 10, \"effective_from\": \"2019-01-01T12:00:00.000Z\", \"effective_until\": \"2019-01-01T12:00:00.000Z\", \"amounts\": [{\"country\": \"country\", \"currency\": \"currency\", \"prices\": [{\"quantity_tier\": 12, \"Price\": 5}]}]}]}, \"deployment\": {\"location\": \"location\", \"location_url\": \"locationUrl\", \"original_location\": \"originalLocation\", \"target_crn\": \"targetCrn\", \"service_crn\": \"serviceCrn\", \"mccp_id\": \"mccpId\", \"broker\": {\"name\": \"name\", \"guid\": \"guid\"}, \"supports_rc_migration\": false, \"target_network\": \"targetNetwork\"}}, \"id\": \"id\", \"catalog_crn\": \"catalogCrn\", \"url\": \"url\", \"children_url\": \"childrenUrl\", \"geo_tags\": [\"geoTags\"], \"pricing_tags\": [\"pricingTags\"], \"created\": \"2019-01-01T12:00:00.000Z\", \"updated\": \"2019-01-01T12:00:00.000Z\"}"; + // Register a mock response + String mockResponseBody = "{\"name\": \"name\", \"kind\": \"service\", \"overview_ui\": {\"mapKey\": {\"display_name\": \"displayName\", \"long_description\": \"longDescription\", \"description\": \"description\", \"featured_description\": \"featuredDescription\"}}, \"images\": {\"image\": \"image\", \"small_image\": \"smallImage\", \"medium_image\": \"mediumImage\", \"feature_image\": \"featureImage\"}, \"parent_id\": \"parentId\", \"disabled\": true, \"tags\": [\"tags\"], \"group\": false, \"provider\": {\"email\": \"email\", \"name\": \"name\", \"contact\": \"contact\", \"support_email\": \"supportEmail\", \"phone\": \"phone\"}, \"active\": true, \"url\": \"url\", \"metadata\": {\"rc_compatible\": true, \"service\": {\"type\": \"type\", \"iam_compatible\": false, \"unique_api_key\": true, \"provisionable\": false, \"bindable\": true, \"async_provisioning_supported\": true, \"async_unprovisioning_supported\": true, \"requires\": [\"requires\"], \"plan_updateable\": true, \"state\": \"state\", \"service_check_enabled\": false, \"test_check_interval\": 17, \"service_key_supported\": false, \"cf_guid\": {\"mapKey\": \"inner\"}}, \"plan\": {\"bindable\": true, \"reservable\": true, \"allow_internal_users\": true, \"async_provisioning_supported\": true, \"async_unprovisioning_supported\": true, \"test_check_interval\": 17, \"single_scope_instance\": \"singleScopeInstance\", \"service_check_enabled\": false, \"cf_guid\": {\"mapKey\": \"inner\"}}, \"alias\": {\"type\": \"type\", \"plan_id\": \"planId\"}, \"template\": {\"services\": [\"services\"], \"default_memory\": 13, \"start_cmd\": \"startCmd\", \"source\": {\"path\": \"path\", \"type\": \"type\", \"url\": \"url\"}, \"runtime_catalog_id\": \"runtimeCatalogId\", \"cf_runtime_id\": \"cfRuntimeId\", \"template_id\": \"templateId\", \"executable_file\": \"executableFile\", \"buildpack\": \"buildpack\", \"environment_variables\": {\"mapKey\": \"inner\"}}, \"ui\": {\"strings\": {\"mapKey\": {\"bullets\": [{\"title\": \"title\", \"description\": \"description\", \"icon\": \"icon\", \"quantity\": 8}], \"media\": [{\"caption\": \"caption\", \"thumbnail_url\": \"thumbnailUrl\", \"type\": \"type\", \"URL\": \"url\", \"source\": [{\"type\": \"type\", \"url\": \"url\"}]}], \"not_creatable_msg\": \"notCreatableMsg\", \"not_creatable__robot_msg\": \"notCreatableRobotMsg\", \"deprecation_warning\": \"deprecationWarning\", \"popup_warning_message\": \"popupWarningMessage\", \"instruction\": \"instruction\"}}, \"urls\": {\"doc_url\": \"docUrl\", \"instructions_url\": \"instructionsUrl\", \"api_url\": \"apiUrl\", \"create_url\": \"createUrl\", \"sdk_download_url\": \"sdkDownloadUrl\", \"terms_url\": \"termsUrl\", \"custom_create_page_url\": \"customCreatePageUrl\", \"catalog_details_url\": \"catalogDetailsUrl\", \"deprecation_doc_url\": \"deprecationDocUrl\", \"dashboard_url\": \"dashboardUrl\", \"registration_url\": \"registrationUrl\", \"apidocsurl\": \"apidocsurl\"}, \"embeddable_dashboard\": \"embeddableDashboard\", \"embeddable_dashboard_full_width\": true, \"navigation_order\": [\"navigationOrder\"], \"not_creatable\": true, \"primary_offering_id\": \"primaryOfferingId\", \"accessible_during_provision\": false, \"side_by_side_index\": 15, \"end_of_service_time\": \"2019-01-01T12:00:00.000Z\", \"hidden\": true, \"hide_lite_metering\": true, \"no_upgrade_next_step\": false}, \"compliance\": [\"compliance\"], \"sla\": {\"terms\": \"terms\", \"tenancy\": \"tenancy\", \"provisioning\": 12, \"responsiveness\": 14, \"dr\": {\"dr\": true, \"description\": \"description\"}}, \"callbacks\": {\"controller_url\": \"controllerUrl\", \"broker_url\": \"brokerUrl\", \"broker_proxy_url\": \"brokerProxyUrl\", \"dashboard_url\": \"dashboardUrl\", \"dashboard_data_url\": \"dashboardDataUrl\", \"dashboard_detail_tab_url\": \"dashboardDetailTabUrl\", \"dashboard_detail_tab_ext_url\": \"dashboardDetailTabExtUrl\", \"service_monitor_api\": \"serviceMonitorApi\", \"service_monitor_app\": \"serviceMonitorApp\", \"api_endpoint\": {\"mapKey\": \"inner\"}}, \"original_name\": \"originalName\", \"version\": \"version\", \"other\": {\"anyKey\": \"anyValue\"}, \"pricing\": {\"type\": \"type\", \"origin\": \"origin\", \"starting_price\": {\"plan_id\": \"planId\", \"deployment_id\": \"deploymentId\", \"unit\": \"unit\", \"amount\": [{\"country\": \"country\", \"currency\": \"currency\", \"prices\": [{\"quantity_tier\": 12, \"price\": 5}]}]}, \"deployment_id\": \"deploymentId\", \"deployment_location\": \"deploymentLocation\", \"deployment_location_no_price_available\": true, \"metrics\": [{\"part_ref\": \"partRef\", \"metric_id\": \"metricId\", \"tier_model\": \"tierModel\", \"charge_unit\": \"chargeUnit\", \"charge_unit_name\": \"chargeUnitName\", \"charge_unit_quantity\": 18, \"resource_display_name\": \"resourceDisplayName\", \"charge_unit_display_name\": \"chargeUnitDisplayName\", \"usage_cap_qty\": 11, \"display_cap\": 10, \"effective_from\": \"2019-01-01T12:00:00.000Z\", \"effective_until\": \"2019-01-01T12:00:00.000Z\", \"amounts\": [{\"country\": \"country\", \"currency\": \"currency\", \"prices\": [{\"quantity_tier\": 12, \"price\": 5}]}]}], \"deployment_regions\": [\"deploymentRegions\"]}, \"deployment\": {\"location\": \"location\", \"location_url\": \"locationUrl\", \"original_location\": \"originalLocation\", \"target_crn\": \"targetCrn\", \"service_crn\": \"serviceCrn\", \"mccp_id\": \"mccpId\", \"broker\": {\"name\": \"name\", \"guid\": \"guid\"}, \"supports_rc_migration\": false, \"target_network\": \"targetNetwork\"}}, \"id\": \"id\", \"catalog_crn\": \"catalogCrn\", \"children_url\": \"childrenUrl\", \"geo_tags\": [\"geoTags\"], \"pricing_tags\": [\"pricingTags\"], \"created\": \"2019-01-01T12:00:00.000Z\", \"updated\": \"2019-01-01T12:00:00.000Z\"}"; String updateCatalogEntryPath = "/testString"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - constructClientService(); + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); // Construct an instance of the Overview model Overview overviewModel = new Overview.Builder() - .displayName("testString") - .longDescription("testString") - .description("testString") - .featuredDescription("testString") - .build(); + .displayName("testString") + .longDescription("testString") + .description("testString") + .featuredDescription("testString") + .build(); // Construct an instance of the Image model Image imageModel = new Image.Builder() - .image("testString") - .smallImage("testString") - .mediumImage("testString") - .featureImage("testString") - .build(); + .image("testString") + .smallImage("testString") + .mediumImage("testString") + .featureImage("testString") + .build(); // Construct an instance of the Provider model Provider providerModel = new Provider.Builder() - .email("testString") - .name("testString") - .contact("testString") - .supportEmail("testString") - .phone("testString") - .build(); + .email("testString") + .name("testString") + .contact("testString") + .supportEmail("testString") + .phone("testString") + .build(); // Construct an instance of the CFMetaData model CFMetaData cfMetaDataModel = new CFMetaData.Builder() - .type("testString") - .iamCompatible(true) - .uniqueApiKey(true) - .provisionable(true) - .bindable(true) - .asyncProvisioningSupported(true) - .asyncUnprovisioningSupported(true) - .requires(new java.util.ArrayList(java.util.Arrays.asList("testString"))) - .planUpdateable(true) - .state("testString") - .serviceCheckEnabled(true) - .testCheckInterval(Long.valueOf("26")) - .serviceKeySupported(true) - .cfGuid(new java.util.HashMap() { { put("foo", "testString"); } }) - .build(); + .type("testString") + .iamCompatible(true) + .uniqueApiKey(true) + .provisionable(true) + .bindable(true) + .asyncProvisioningSupported(true) + .asyncUnprovisioningSupported(true) + .requires(java.util.Arrays.asList("testString")) + .planUpdateable(true) + .state("testString") + .serviceCheckEnabled(true) + .testCheckInterval(Long.valueOf("26")) + .serviceKeySupported(true) + .cfGuid(java.util.Collections.singletonMap("key1", "testString")) + .build(); // Construct an instance of the PlanMetaData model PlanMetaData planMetaDataModel = new PlanMetaData.Builder() - .bindable(true) - .reservable(true) - .allowInternalUsers(true) - .asyncProvisioningSupported(true) - .asyncUnprovisioningSupported(true) - .testCheckInterval(Long.valueOf("26")) - .singleScopeInstance("testString") - .serviceCheckEnabled(true) - .cfGuid(new java.util.HashMap() { { put("foo", "testString"); } }) - .build(); + .bindable(true) + .reservable(true) + .allowInternalUsers(true) + .asyncProvisioningSupported(true) + .asyncUnprovisioningSupported(true) + .testCheckInterval(Long.valueOf("26")) + .singleScopeInstance("testString") + .serviceCheckEnabled(true) + .cfGuid(java.util.Collections.singletonMap("key1", "testString")) + .build(); // Construct an instance of the AliasMetaData model AliasMetaData aliasMetaDataModel = new AliasMetaData.Builder() - .type("testString") - .planId("testString") - .build(); + .type("testString") + .planId("testString") + .build(); // Construct an instance of the SourceMetaData model SourceMetaData sourceMetaDataModel = new SourceMetaData.Builder() - .path("testString") - .type("testString") - .url("testString") - .build(); + .path("testString") + .type("testString") + .url("testString") + .build(); // Construct an instance of the TemplateMetaData model TemplateMetaData templateMetaDataModel = new TemplateMetaData.Builder() - .services(new java.util.ArrayList(java.util.Arrays.asList("testString"))) - .defaultMemory(Long.valueOf("26")) - .startCmd("testString") - .source(sourceMetaDataModel) - .runtimeCatalogId("testString") - .cfRuntimeId("testString") - .templateId("testString") - .executableFile("testString") - .buildpack("testString") - .environmentVariables(new java.util.HashMap() { { put("foo", "testString"); } }) - .build(); + .services(java.util.Arrays.asList("testString")) + .defaultMemory(Long.valueOf("26")) + .startCmd("testString") + .source(sourceMetaDataModel) + .runtimeCatalogId("testString") + .cfRuntimeId("testString") + .templateId("testString") + .executableFile("testString") + .buildpack("testString") + .environmentVariables(java.util.Collections.singletonMap("key1", "testString")) + .build(); // Construct an instance of the Bullets model Bullets bulletsModel = new Bullets.Builder() - .title("testString") - .description("testString") - .icon("testString") - .quantity(Long.valueOf("26")) - .build(); + .title("testString") + .description("testString") + .icon("testString") + .quantity(Long.valueOf("26")) + .build(); + + // Construct an instance of the UIMediaSourceMetaData model + UIMediaSourceMetaData uiMediaSourceMetaDataModel = new UIMediaSourceMetaData.Builder() + .type("testString") + .url("testString") + .build(); // Construct an instance of the UIMetaMedia model UIMetaMedia uiMetaMediaModel = new UIMetaMedia.Builder() - .caption("testString") - .thumbnailUrl("testString") - .type("testString") - .url("testString") - .source(bulletsModel) - .build(); + .caption("testString") + .thumbnailUrl("testString") + .type("testString") + .url("testString") + .source(java.util.Arrays.asList(uiMediaSourceMetaDataModel)) + .build(); // Construct an instance of the Strings model Strings stringsModel = new Strings.Builder() - .bullets(new java.util.ArrayList(java.util.Arrays.asList(bulletsModel))) - .media(new java.util.ArrayList(java.util.Arrays.asList(uiMetaMediaModel))) - .notCreatableMsg("testString") - .notCreatableRobotMsg("testString") - .deprecationWarning("testString") - .popupWarningMessage("testString") - .instruction("testString") - .build(); + .bullets(java.util.Arrays.asList(bulletsModel)) + .media(java.util.Arrays.asList(uiMetaMediaModel)) + .notCreatableMsg("testString") + .notCreatableRobotMsg("testString") + .deprecationWarning("testString") + .popupWarningMessage("testString") + .instruction("testString") + .build(); // Construct an instance of the URLS model URLS urlsModel = new URLS.Builder() - .docUrl("testString") - .instructionsUrl("testString") - .apiUrl("testString") - .createUrl("testString") - .sdkDownloadUrl("testString") - .termsUrl("testString") - .customCreatePageUrl("testString") - .catalogDetailsUrl("testString") - .deprecationDocUrl("testString") - .dashboardUrl("testString") - .registrationUrl("testString") - .apidocsurl("testString") - .build(); + .docUrl("testString") + .instructionsUrl("testString") + .apiUrl("testString") + .createUrl("testString") + .sdkDownloadUrl("testString") + .termsUrl("testString") + .customCreatePageUrl("testString") + .catalogDetailsUrl("testString") + .deprecationDocUrl("testString") + .dashboardUrl("testString") + .registrationUrl("testString") + .apidocsurl("testString") + .build(); // Construct an instance of the UIMetaData model UIMetaData uiMetaDataModel = new UIMetaData.Builder() - .strings(new java.util.HashMap() { { put("foo", stringsModel); } }) - .urls(urlsModel) - .embeddableDashboard("testString") - .embeddableDashboardFullWidth(true) - .navigationOrder(new java.util.ArrayList(java.util.Arrays.asList("testString"))) - .notCreatable(true) - .primaryOfferingId("testString") - .accessibleDuringProvision(true) - .sideBySideIndex(Long.valueOf("26")) - .endOfServiceTime(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) - .hidden(true) - .hideLiteMetering(true) - .noUpgradeNextStep(true) - .build(); + .strings(java.util.Collections.singletonMap("key1", stringsModel)) + .urls(urlsModel) + .embeddableDashboard("testString") + .embeddableDashboardFullWidth(true) + .navigationOrder(java.util.Arrays.asList("testString")) + .notCreatable(true) + .primaryOfferingId("testString") + .accessibleDuringProvision(true) + .sideBySideIndex(Long.valueOf("26")) + .endOfServiceTime(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) + .hidden(true) + .hideLiteMetering(true) + .noUpgradeNextStep(true) + .build(); // Construct an instance of the DRMetaData model DRMetaData drMetaDataModel = new DRMetaData.Builder() - .dr(true) - .description("testString") - .build(); + .dr(true) + .description("testString") + .build(); // Construct an instance of the SLAMetaData model SLAMetaData slaMetaDataModel = new SLAMetaData.Builder() - .terms("testString") - .tenancy("testString") - .provisioning("testString") - .responsiveness("testString") - .dr(drMetaDataModel) - .build(); + .terms("testString") + .tenancy("testString") + .provisioning(Double.valueOf("72.5")) + .responsiveness(Double.valueOf("72.5")) + .dr(drMetaDataModel) + .build(); // Construct an instance of the Callbacks model Callbacks callbacksModel = new Callbacks.Builder() - .controllerUrl("testString") - .brokerUrl("testString") - .brokerProxyUrl("testString") - .dashboardUrl("testString") - .dashboardDataUrl("testString") - .dashboardDetailTabUrl("testString") - .dashboardDetailTabExtUrl("testString") - .serviceMonitorApi("testString") - .serviceMonitorApp("testString") - .apiEndpoint(new java.util.HashMap() { { put("foo", "testString"); } }) - .build(); + .controllerUrl("testString") + .brokerUrl("testString") + .brokerProxyUrl("testString") + .dashboardUrl("testString") + .dashboardDataUrl("testString") + .dashboardDetailTabUrl("testString") + .dashboardDetailTabExtUrl("testString") + .serviceMonitorApi("testString") + .serviceMonitorApp("testString") + .apiEndpoint(java.util.Collections.singletonMap("key1", "testString")) + .build(); // Construct an instance of the Price model Price priceModel = new Price.Builder() - .quantityTier(Long.valueOf("26")) - .price(Double.valueOf("72.5")) - .build(); + .quantityTier(Long.valueOf("26")) + .price(Double.valueOf("72.5")) + .build(); // Construct an instance of the Amount model Amount amountModel = new Amount.Builder() - .country("testString") - .currency("testString") - .prices(new java.util.ArrayList(java.util.Arrays.asList(priceModel))) - .build(); + .country("testString") + .currency("testString") + .prices(java.util.Arrays.asList(priceModel)) + .build(); // Construct an instance of the StartingPrice model StartingPrice startingPriceModel = new StartingPrice.Builder() - .planId("testString") - .deploymentId("testString") - .unit("testString") - .amount(new java.util.ArrayList(java.util.Arrays.asList(amountModel))) - .build(); + .planId("testString") + .deploymentId("testString") + .unit("testString") + .amount(java.util.Arrays.asList(amountModel)) + .build(); // Construct an instance of the PricingSet model PricingSet pricingSetModel = new PricingSet.Builder() - .type("testString") - .origin("testString") - .startingPrice(startingPriceModel) - .build(); + .type("testString") + .origin("testString") + .startingPrice(startingPriceModel) + .build(); // Construct an instance of the Broker model Broker brokerModel = new Broker.Builder() - .name("testString") - .guid("testString") - .build(); + .name("testString") + .guid("testString") + .build(); // Construct an instance of the DeploymentBase model DeploymentBase deploymentBaseModel = new DeploymentBase.Builder() - .location("testString") - .locationUrl("testString") - .originalLocation("testString") - .targetCrn("testString") - .serviceCrn("testString") - .mccpId("testString") - .broker(brokerModel) - .supportsRcMigration(true) - .targetNetwork("testString") - .build(); + .location("testString") + .locationUrl("testString") + .originalLocation("testString") + .targetCrn("testString") + .serviceCrn("testString") + .mccpId("testString") + .broker(brokerModel) + .supportsRcMigration(true) + .targetNetwork("testString") + .build(); // Construct an instance of the ObjectMetadataSet model ObjectMetadataSet objectMetadataSetModel = new ObjectMetadataSet.Builder() - .rcCompatible(true) - .service(cfMetaDataModel) - .plan(planMetaDataModel) - .alias(aliasMetaDataModel) - .template(templateMetaDataModel) - .ui(uiMetaDataModel) - .compliance(new java.util.ArrayList(java.util.Arrays.asList("testString"))) - .sla(slaMetaDataModel) - .callbacks(callbacksModel) - .originalName("testString") - .version("testString") - .other(new java.util.HashMap() { { put("foo", "testString"); } }) - .pricing(pricingSetModel) - .deployment(deploymentBaseModel) - .build(); + .rcCompatible(true) + .service(cfMetaDataModel) + .plan(planMetaDataModel) + .alias(aliasMetaDataModel) + .template(templateMetaDataModel) + .ui(uiMetaDataModel) + .compliance(java.util.Arrays.asList("testString")) + .sla(slaMetaDataModel) + .callbacks(callbacksModel) + .originalName("testString") + .version("testString") + .other(java.util.Collections.singletonMap("anyKey", "anyValue")) + .pricing(pricingSetModel) + .deployment(deploymentBaseModel) + .build(); // Construct an instance of the UpdateCatalogEntryOptions model UpdateCatalogEntryOptions updateCatalogEntryOptionsModel = new UpdateCatalogEntryOptions.Builder() - .id("testString") - .name("testString") - .kind("service") - .overviewUi(new java.util.HashMap() { { put("foo", overviewModel); } }) - .images(imageModel) - .disabled(true) - .tags(new java.util.ArrayList(java.util.Arrays.asList("testString"))) - .provider(providerModel) - .parentId("testString") - .group(true) - .active(true) - .metadata(objectMetadataSetModel) - .account("testString") - .move("testString") - .build(); - - // Invoke operation with valid options model (positive test) + .id("testString") + .name("testString") + .kind("service") + .overviewUi(java.util.Collections.singletonMap("key1", overviewModel)) + .images(imageModel) + .disabled(true) + .tags(java.util.Arrays.asList("testString")) + .provider(providerModel) + .parentId("testString") + .group(true) + .active(true) + .url("testString") + .metadata(objectMetadataSetModel) + .account("testString") + .move("testString") + .build(); + + // Invoke updateCatalogEntry() with a valid options model and verify the result Response response = globalCatalogService.updateCatalogEntry(updateCatalogEntryOptionsModel).execute(); assertNotNull(response); CatalogEntry responseObj = response.getResult(); assertNotNull(responseObj); - // Verify the contents of the request + // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); assertEquals(request.getMethod(), "PUT"); - - // Check query + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, updateCatalogEntryPath); + // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - // Get query params assertEquals(query.get("account"), "testString"); assertEquals(query.get("move"), "testString"); - // Check request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateCatalogEntryPath); } - // Test the updateCatalogEntry operation with null options model parameter + // Test the updateCatalogEntry operation with and without retries enabled + @Test + public void testUpdateCatalogEntryWRetries() throws Throwable { + globalCatalogService.enableRetries(4, 30); + testUpdateCatalogEntryWOptions(); + + globalCatalogService.disableRetries(); + testUpdateCatalogEntryWOptions(); + } + + // Test the updateCatalogEntry operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) public void testUpdateCatalogEntryNoOptions() throws Throwable { - // construct the service - constructClientService(); - server.enqueue(new MockResponse()); - - // Invoke operation with null options model (negative test) globalCatalogService.updateCatalogEntry(null).execute(); } + // Test the deleteCatalogEntry operation with a valid options model parameter @Test public void testDeleteCatalogEntryWOptions() throws Throwable { - // Schedule some responses. + // Register a mock response String mockResponseBody = ""; String deleteCatalogEntryPath = "/testString"; - server.enqueue(new MockResponse() - .setResponseCode(200) - .setBody(mockResponseBody)); - - constructClientService(); + .setResponseCode(200) + .setBody(mockResponseBody)); // Construct an instance of the DeleteCatalogEntryOptions model DeleteCatalogEntryOptions deleteCatalogEntryOptionsModel = new DeleteCatalogEntryOptions.Builder() - .id("testString") - .account("testString") - .force(true) - .build(); + .id("testString") + .account("testString") + .force(true) + .build(); - // Invoke operation with valid options model (positive test) + // Invoke deleteCatalogEntry() with a valid options model and verify the result Response response = globalCatalogService.deleteCatalogEntry(deleteCatalogEntryOptionsModel).execute(); assertNotNull(response); Void responseObj = response.getResult(); - // Response does not have a return type. Check that the result is null. assertNull(responseObj); - // Verify the contents of the request + // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); assertEquals(request.getMethod(), "DELETE"); - - // Check query + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, deleteCatalogEntryPath); + // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - // Get query params assertEquals(query.get("account"), "testString"); assertEquals(Boolean.valueOf(query.get("force")), Boolean.valueOf(true)); - // Check request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteCatalogEntryPath); } - // Test the deleteCatalogEntry operation with null options model parameter + // Test the deleteCatalogEntry operation with and without retries enabled + @Test + public void testDeleteCatalogEntryWRetries() throws Throwable { + globalCatalogService.enableRetries(4, 30); + testDeleteCatalogEntryWOptions(); + + globalCatalogService.disableRetries(); + testDeleteCatalogEntryWOptions(); + } + + // Test the deleteCatalogEntry operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) public void testDeleteCatalogEntryNoOptions() throws Throwable { - // construct the service - constructClientService(); - server.enqueue(new MockResponse()); - - // Invoke operation with null options model (negative test) globalCatalogService.deleteCatalogEntry(null).execute(); } + // Test the getChildObjects operation with a valid options model parameter @Test public void testGetChildObjectsWOptions() throws Throwable { - // Schedule some responses. - String mockResponseBody = "{\"offset\": 6, \"limit\": 5, \"count\": 5, \"resource_count\": 13, \"first\": \"first\", \"last\": \"last\", \"prev\": \"prev\", \"next\": \"next\", \"resources\": [{\"name\": \"name\", \"kind\": \"service\", \"overview_ui\": {\"mapKey\": {\"display_name\": \"displayName\", \"long_description\": \"longDescription\", \"description\": \"description\", \"featured_description\": \"featuredDescription\"}}, \"images\": {\"image\": \"image\", \"small_image\": \"smallImage\", \"medium_image\": \"mediumImage\", \"feature_image\": \"featureImage\"}, \"parent_id\": \"parentId\", \"disabled\": true, \"tags\": [\"tags\"], \"group\": false, \"provider\": {\"email\": \"email\", \"name\": \"name\", \"contact\": \"contact\", \"support_email\": \"supportEmail\", \"phone\": \"phone\"}, \"active\": true, \"metadata\": {\"rc_compatible\": true, \"service\": {\"type\": \"type\", \"iam_compatible\": false, \"unique_api_key\": true, \"provisionable\": false, \"bindable\": true, \"async_provisioning_supported\": true, \"async_unprovisioning_supported\": true, \"requires\": [\"requires\"], \"plan_updateable\": true, \"state\": \"state\", \"service_check_enabled\": false, \"test_check_interval\": 17, \"service_key_supported\": false, \"cf_guid\": {\"mapKey\": \"inner\"}}, \"plan\": {\"bindable\": true, \"reservable\": true, \"allow_internal_users\": true, \"async_provisioning_supported\": true, \"async_unprovisioning_supported\": true, \"test_check_interval\": 17, \"single_scope_instance\": \"singleScopeInstance\", \"service_check_enabled\": false, \"cf_guid\": {\"mapKey\": \"inner\"}}, \"alias\": {\"type\": \"type\", \"plan_id\": \"planId\"}, \"template\": {\"services\": [\"services\"], \"default_memory\": 13, \"start_cmd\": \"startCmd\", \"source\": {\"path\": \"path\", \"type\": \"type\", \"url\": \"url\"}, \"runtime_catalog_id\": \"runtimeCatalogId\", \"cf_runtime_id\": \"cfRuntimeId\", \"template_id\": \"templateId\", \"executable_file\": \"executableFile\", \"buildpack\": \"buildpack\", \"environment_variables\": {\"mapKey\": \"inner\"}}, \"ui\": {\"strings\": {\"mapKey\": {\"bullets\": [{\"title\": \"title\", \"description\": \"description\", \"icon\": \"icon\", \"quantity\": 8}], \"media\": [{\"caption\": \"caption\", \"thumbnail_url\": \"thumbnailUrl\", \"type\": \"type\", \"URL\": \"url\", \"source\": {\"title\": \"title\", \"description\": \"description\", \"icon\": \"icon\", \"quantity\": 8}}], \"not_creatable_msg\": \"notCreatableMsg\", \"not_creatable__robot_msg\": \"notCreatableRobotMsg\", \"deprecation_warning\": \"deprecationWarning\", \"popup_warning_message\": \"popupWarningMessage\", \"instruction\": \"instruction\"}}, \"urls\": {\"doc_url\": \"docUrl\", \"instructions_url\": \"instructionsUrl\", \"api_url\": \"apiUrl\", \"create_url\": \"createUrl\", \"sdk_download_url\": \"sdkDownloadUrl\", \"terms_url\": \"termsUrl\", \"custom_create_page_url\": \"customCreatePageUrl\", \"catalog_details_url\": \"catalogDetailsUrl\", \"deprecation_doc_url\": \"deprecationDocUrl\", \"dashboard_url\": \"dashboardUrl\", \"registration_url\": \"registrationUrl\", \"apidocsurl\": \"apidocsurl\"}, \"embeddable_dashboard\": \"embeddableDashboard\", \"embeddable_dashboard_full_width\": true, \"navigation_order\": [\"navigationOrder\"], \"not_creatable\": true, \"primary_offering_id\": \"primaryOfferingId\", \"accessible_during_provision\": false, \"side_by_side_index\": 15, \"end_of_service_time\": \"2019-01-01T12:00:00.000Z\", \"hidden\": true, \"hide_lite_metering\": true, \"no_upgrade_next_step\": false}, \"compliance\": [\"compliance\"], \"sla\": {\"terms\": \"terms\", \"tenancy\": \"tenancy\", \"provisioning\": \"provisioning\", \"responsiveness\": \"responsiveness\", \"dr\": {\"dr\": true, \"description\": \"description\"}}, \"callbacks\": {\"controller_url\": \"controllerUrl\", \"broker_url\": \"brokerUrl\", \"broker_proxy_url\": \"brokerProxyUrl\", \"dashboard_url\": \"dashboardUrl\", \"dashboard_data_url\": \"dashboardDataUrl\", \"dashboard_detail_tab_url\": \"dashboardDetailTabUrl\", \"dashboard_detail_tab_ext_url\": \"dashboardDetailTabExtUrl\", \"service_monitor_api\": \"serviceMonitorApi\", \"service_monitor_app\": \"serviceMonitorApp\", \"api_endpoint\": {\"mapKey\": \"inner\"}}, \"original_name\": \"originalName\", \"version\": \"version\", \"other\": {\"mapKey\": \"anyValue\"}, \"pricing\": {\"type\": \"type\", \"origin\": \"origin\", \"starting_price\": {\"plan_id\": \"planId\", \"deployment_id\": \"deploymentId\", \"unit\": \"unit\", \"amount\": [{\"country\": \"country\", \"currency\": \"currency\", \"prices\": [{\"quantity_tier\": 12, \"Price\": 5}]}]}, \"metrics\": [{\"part_ref\": \"partRef\", \"metric_id\": \"metricId\", \"tier_model\": \"tierModel\", \"charge_unit\": \"chargeUnit\", \"charge_unit_name\": \"chargeUnitName\", \"charge_unit_quantity\": \"chargeUnitQuantity\", \"resource_display_name\": \"resourceDisplayName\", \"charge_unit_display_name\": \"chargeUnitDisplayName\", \"usage_cap_qty\": 11, \"display_cap\": 10, \"effective_from\": \"2019-01-01T12:00:00.000Z\", \"effective_until\": \"2019-01-01T12:00:00.000Z\", \"amounts\": [{\"country\": \"country\", \"currency\": \"currency\", \"prices\": [{\"quantity_tier\": 12, \"Price\": 5}]}]}]}, \"deployment\": {\"location\": \"location\", \"location_url\": \"locationUrl\", \"original_location\": \"originalLocation\", \"target_crn\": \"targetCrn\", \"service_crn\": \"serviceCrn\", \"mccp_id\": \"mccpId\", \"broker\": {\"name\": \"name\", \"guid\": \"guid\"}, \"supports_rc_migration\": false, \"target_network\": \"targetNetwork\"}}, \"id\": \"id\", \"catalog_crn\": \"catalogCrn\", \"url\": \"url\", \"children_url\": \"childrenUrl\", \"geo_tags\": [\"geoTags\"], \"pricing_tags\": [\"pricingTags\"], \"created\": \"2019-01-01T12:00:00.000Z\", \"updated\": \"2019-01-01T12:00:00.000Z\"}]}"; + // Register a mock response + String mockResponseBody = "{\"offset\": 6, \"limit\": 5, \"count\": 5, \"resource_count\": 13, \"first\": \"first\", \"last\": \"last\", \"prev\": \"prev\", \"next\": \"next\", \"resources\": [{\"name\": \"name\", \"kind\": \"service\", \"overview_ui\": {\"mapKey\": {\"display_name\": \"displayName\", \"long_description\": \"longDescription\", \"description\": \"description\", \"featured_description\": \"featuredDescription\"}}, \"images\": {\"image\": \"image\", \"small_image\": \"smallImage\", \"medium_image\": \"mediumImage\", \"feature_image\": \"featureImage\"}, \"parent_id\": \"parentId\", \"disabled\": true, \"tags\": [\"tags\"], \"group\": false, \"provider\": {\"email\": \"email\", \"name\": \"name\", \"contact\": \"contact\", \"support_email\": \"supportEmail\", \"phone\": \"phone\"}, \"active\": true, \"url\": \"url\", \"metadata\": {\"rc_compatible\": true, \"service\": {\"type\": \"type\", \"iam_compatible\": false, \"unique_api_key\": true, \"provisionable\": false, \"bindable\": true, \"async_provisioning_supported\": true, \"async_unprovisioning_supported\": true, \"requires\": [\"requires\"], \"plan_updateable\": true, \"state\": \"state\", \"service_check_enabled\": false, \"test_check_interval\": 17, \"service_key_supported\": false, \"cf_guid\": {\"mapKey\": \"inner\"}}, \"plan\": {\"bindable\": true, \"reservable\": true, \"allow_internal_users\": true, \"async_provisioning_supported\": true, \"async_unprovisioning_supported\": true, \"test_check_interval\": 17, \"single_scope_instance\": \"singleScopeInstance\", \"service_check_enabled\": false, \"cf_guid\": {\"mapKey\": \"inner\"}}, \"alias\": {\"type\": \"type\", \"plan_id\": \"planId\"}, \"template\": {\"services\": [\"services\"], \"default_memory\": 13, \"start_cmd\": \"startCmd\", \"source\": {\"path\": \"path\", \"type\": \"type\", \"url\": \"url\"}, \"runtime_catalog_id\": \"runtimeCatalogId\", \"cf_runtime_id\": \"cfRuntimeId\", \"template_id\": \"templateId\", \"executable_file\": \"executableFile\", \"buildpack\": \"buildpack\", \"environment_variables\": {\"mapKey\": \"inner\"}}, \"ui\": {\"strings\": {\"mapKey\": {\"bullets\": [{\"title\": \"title\", \"description\": \"description\", \"icon\": \"icon\", \"quantity\": 8}], \"media\": [{\"caption\": \"caption\", \"thumbnail_url\": \"thumbnailUrl\", \"type\": \"type\", \"URL\": \"url\", \"source\": [{\"type\": \"type\", \"url\": \"url\"}]}], \"not_creatable_msg\": \"notCreatableMsg\", \"not_creatable__robot_msg\": \"notCreatableRobotMsg\", \"deprecation_warning\": \"deprecationWarning\", \"popup_warning_message\": \"popupWarningMessage\", \"instruction\": \"instruction\"}}, \"urls\": {\"doc_url\": \"docUrl\", \"instructions_url\": \"instructionsUrl\", \"api_url\": \"apiUrl\", \"create_url\": \"createUrl\", \"sdk_download_url\": \"sdkDownloadUrl\", \"terms_url\": \"termsUrl\", \"custom_create_page_url\": \"customCreatePageUrl\", \"catalog_details_url\": \"catalogDetailsUrl\", \"deprecation_doc_url\": \"deprecationDocUrl\", \"dashboard_url\": \"dashboardUrl\", \"registration_url\": \"registrationUrl\", \"apidocsurl\": \"apidocsurl\"}, \"embeddable_dashboard\": \"embeddableDashboard\", \"embeddable_dashboard_full_width\": true, \"navigation_order\": [\"navigationOrder\"], \"not_creatable\": true, \"primary_offering_id\": \"primaryOfferingId\", \"accessible_during_provision\": false, \"side_by_side_index\": 15, \"end_of_service_time\": \"2019-01-01T12:00:00.000Z\", \"hidden\": true, \"hide_lite_metering\": true, \"no_upgrade_next_step\": false}, \"compliance\": [\"compliance\"], \"sla\": {\"terms\": \"terms\", \"tenancy\": \"tenancy\", \"provisioning\": 12, \"responsiveness\": 14, \"dr\": {\"dr\": true, \"description\": \"description\"}}, \"callbacks\": {\"controller_url\": \"controllerUrl\", \"broker_url\": \"brokerUrl\", \"broker_proxy_url\": \"brokerProxyUrl\", \"dashboard_url\": \"dashboardUrl\", \"dashboard_data_url\": \"dashboardDataUrl\", \"dashboard_detail_tab_url\": \"dashboardDetailTabUrl\", \"dashboard_detail_tab_ext_url\": \"dashboardDetailTabExtUrl\", \"service_monitor_api\": \"serviceMonitorApi\", \"service_monitor_app\": \"serviceMonitorApp\", \"api_endpoint\": {\"mapKey\": \"inner\"}}, \"original_name\": \"originalName\", \"version\": \"version\", \"other\": {\"anyKey\": \"anyValue\"}, \"pricing\": {\"type\": \"type\", \"origin\": \"origin\", \"starting_price\": {\"plan_id\": \"planId\", \"deployment_id\": \"deploymentId\", \"unit\": \"unit\", \"amount\": [{\"country\": \"country\", \"currency\": \"currency\", \"prices\": [{\"quantity_tier\": 12, \"price\": 5}]}]}, \"deployment_id\": \"deploymentId\", \"deployment_location\": \"deploymentLocation\", \"deployment_location_no_price_available\": true, \"metrics\": [{\"part_ref\": \"partRef\", \"metric_id\": \"metricId\", \"tier_model\": \"tierModel\", \"charge_unit\": \"chargeUnit\", \"charge_unit_name\": \"chargeUnitName\", \"charge_unit_quantity\": 18, \"resource_display_name\": \"resourceDisplayName\", \"charge_unit_display_name\": \"chargeUnitDisplayName\", \"usage_cap_qty\": 11, \"display_cap\": 10, \"effective_from\": \"2019-01-01T12:00:00.000Z\", \"effective_until\": \"2019-01-01T12:00:00.000Z\", \"amounts\": [{\"country\": \"country\", \"currency\": \"currency\", \"prices\": [{\"quantity_tier\": 12, \"price\": 5}]}]}], \"deployment_regions\": [\"deploymentRegions\"]}, \"deployment\": {\"location\": \"location\", \"location_url\": \"locationUrl\", \"original_location\": \"originalLocation\", \"target_crn\": \"targetCrn\", \"service_crn\": \"serviceCrn\", \"mccp_id\": \"mccpId\", \"broker\": {\"name\": \"name\", \"guid\": \"guid\"}, \"supports_rc_migration\": false, \"target_network\": \"targetNetwork\"}}, \"id\": \"id\", \"catalog_crn\": \"catalogCrn\", \"children_url\": \"childrenUrl\", \"geo_tags\": [\"geoTags\"], \"pricing_tags\": [\"pricingTags\"], \"created\": \"2019-01-01T12:00:00.000Z\", \"updated\": \"2019-01-01T12:00:00.000Z\"}]}"; String getChildObjectsPath = "/testString/testString"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - constructClientService(); + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); // Construct an instance of the GetChildObjectsOptions model GetChildObjectsOptions getChildObjectsOptionsModel = new GetChildObjectsOptions.Builder() - .id("testString") - .kind("testString") - .account("testString") - .include("testString") - .q("testString") - .sortBy("testString") - .descending("testString") - .languages("testString") - .complete(true) - .offset(Long.valueOf("26")) - .limit(Long.valueOf("200")) - .build(); - - // Invoke operation with valid options model (positive test) + .id("testString") + .kind("testString") + .account("testString") + .include("testString") + .q("testString") + .sortBy("testString") + .descending("testString") + .languages("testString") + .complete(true) + .offset(Long.valueOf("0")) + .limit(Long.valueOf("50")) + .build(); + + // Invoke getChildObjects() with a valid options model and verify the result Response response = globalCatalogService.getChildObjects(getChildObjectsOptionsModel).execute(); assertNotNull(response); EntrySearchResult responseObj = response.getResult(); assertNotNull(responseObj); - // Verify the contents of the request + // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); assertEquals(request.getMethod(), "GET"); - - // Check query + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, getChildObjectsPath); + // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - // Get query params assertEquals(query.get("account"), "testString"); assertEquals(query.get("include"), "testString"); assertEquals(query.get("q"), "testString"); @@ -937,536 +953,612 @@ public void testGetChildObjectsWOptions() throws Throwable { assertEquals(query.get("descending"), "testString"); assertEquals(query.get("languages"), "testString"); assertEquals(Boolean.valueOf(query.get("complete")), Boolean.valueOf(true)); - assertEquals(Long.valueOf(query.get("_offset")), Long.valueOf("26")); - assertEquals(Long.valueOf(query.get("_limit")), Long.valueOf("200")); - // Check request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getChildObjectsPath); + assertEquals(Long.valueOf(query.get("_offset")), Long.valueOf("0")); + assertEquals(Long.valueOf(query.get("_limit")), Long.valueOf("50")); } - // Test the getChildObjects operation with null options model parameter + // Test the getChildObjects operation with and without retries enabled + @Test + public void testGetChildObjectsWRetries() throws Throwable { + globalCatalogService.enableRetries(4, 30); + testGetChildObjectsWOptions(); + + globalCatalogService.disableRetries(); + testGetChildObjectsWOptions(); + } + + // Test the getChildObjects operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) public void testGetChildObjectsNoOptions() throws Throwable { - // construct the service - constructClientService(); - server.enqueue(new MockResponse()); - - // Invoke operation with null options model (negative test) globalCatalogService.getChildObjects(null).execute(); } + // Test the restoreCatalogEntry operation with a valid options model parameter @Test public void testRestoreCatalogEntryWOptions() throws Throwable { - // Schedule some responses. + // Register a mock response String mockResponseBody = ""; String restoreCatalogEntryPath = "/testString/restore"; - server.enqueue(new MockResponse() - .setResponseCode(200) - .setBody(mockResponseBody)); - - constructClientService(); + .setResponseCode(200) + .setBody(mockResponseBody)); // Construct an instance of the RestoreCatalogEntryOptions model RestoreCatalogEntryOptions restoreCatalogEntryOptionsModel = new RestoreCatalogEntryOptions.Builder() - .id("testString") - .account("testString") - .build(); + .id("testString") + .account("testString") + .build(); - // Invoke operation with valid options model (positive test) + // Invoke restoreCatalogEntry() with a valid options model and verify the result Response response = globalCatalogService.restoreCatalogEntry(restoreCatalogEntryOptionsModel).execute(); assertNotNull(response); Void responseObj = response.getResult(); - // Response does not have a return type. Check that the result is null. assertNull(responseObj); - // Verify the contents of the request + // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); assertEquals(request.getMethod(), "PUT"); - - // Check query + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, restoreCatalogEntryPath); + // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - // Get query params assertEquals(query.get("account"), "testString"); - // Check request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, restoreCatalogEntryPath); } - // Test the restoreCatalogEntry operation with null options model parameter + // Test the restoreCatalogEntry operation with and without retries enabled + @Test + public void testRestoreCatalogEntryWRetries() throws Throwable { + globalCatalogService.enableRetries(4, 30); + testRestoreCatalogEntryWOptions(); + + globalCatalogService.disableRetries(); + testRestoreCatalogEntryWOptions(); + } + + // Test the restoreCatalogEntry operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) public void testRestoreCatalogEntryNoOptions() throws Throwable { - // construct the service - constructClientService(); - server.enqueue(new MockResponse()); - - // Invoke operation with null options model (negative test) globalCatalogService.restoreCatalogEntry(null).execute(); } + // Test the getVisibility operation with a valid options model parameter @Test public void testGetVisibilityWOptions() throws Throwable { - // Schedule some responses. + // Register a mock response String mockResponseBody = "{\"restrictions\": \"restrictions\", \"owner\": \"owner\", \"extendable\": true, \"include\": {\"accounts\": {\"_accountid_\": \"accountid\"}}, \"exclude\": {\"accounts\": {\"_accountid_\": \"accountid\"}}, \"approved\": true}"; String getVisibilityPath = "/testString/visibility"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - constructClientService(); + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); // Construct an instance of the GetVisibilityOptions model GetVisibilityOptions getVisibilityOptionsModel = new GetVisibilityOptions.Builder() - .id("testString") - .account("testString") - .build(); + .id("testString") + .account("testString") + .build(); - // Invoke operation with valid options model (positive test) + // Invoke getVisibility() with a valid options model and verify the result Response response = globalCatalogService.getVisibility(getVisibilityOptionsModel).execute(); assertNotNull(response); Visibility responseObj = response.getResult(); assertNotNull(responseObj); - // Verify the contents of the request + // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); assertEquals(request.getMethod(), "GET"); - - // Check query + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, getVisibilityPath); + // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - // Get query params assertEquals(query.get("account"), "testString"); - // Check request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getVisibilityPath); } - // Test the getVisibility operation with null options model parameter + // Test the getVisibility operation with and without retries enabled + @Test + public void testGetVisibilityWRetries() throws Throwable { + globalCatalogService.enableRetries(4, 30); + testGetVisibilityWOptions(); + + globalCatalogService.disableRetries(); + testGetVisibilityWOptions(); + } + + // Test the getVisibility operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) public void testGetVisibilityNoOptions() throws Throwable { - // construct the service - constructClientService(); - server.enqueue(new MockResponse()); - - // Invoke operation with null options model (negative test) globalCatalogService.getVisibility(null).execute(); } + // Test the updateVisibility operation with a valid options model parameter @Test public void testUpdateVisibilityWOptions() throws Throwable { - // Schedule some responses. + // Register a mock response String mockResponseBody = ""; String updateVisibilityPath = "/testString/visibility"; - server.enqueue(new MockResponse() - .setResponseCode(200) - .setBody(mockResponseBody)); - - constructClientService(); + .setResponseCode(200) + .setBody(mockResponseBody)); // Construct an instance of the VisibilityDetailAccounts model VisibilityDetailAccounts visibilityDetailAccountsModel = new VisibilityDetailAccounts.Builder() - .accountid("testString") - .build(); + .accountid("testString") + .build(); // Construct an instance of the VisibilityDetail model VisibilityDetail visibilityDetailModel = new VisibilityDetail.Builder() - .accounts(visibilityDetailAccountsModel) - .build(); + .accounts(visibilityDetailAccountsModel) + .build(); // Construct an instance of the UpdateVisibilityOptions model UpdateVisibilityOptions updateVisibilityOptionsModel = new UpdateVisibilityOptions.Builder() - .id("testString") - .extendable(true) - .include(visibilityDetailModel) - .exclude(visibilityDetailModel) - .account("testString") - .build(); - - // Invoke operation with valid options model (positive test) + .id("testString") + .extendable(true) + .include(visibilityDetailModel) + .exclude(visibilityDetailModel) + .account("testString") + .build(); + + // Invoke updateVisibility() with a valid options model and verify the result Response response = globalCatalogService.updateVisibility(updateVisibilityOptionsModel).execute(); assertNotNull(response); Void responseObj = response.getResult(); - // Response does not have a return type. Check that the result is null. assertNull(responseObj); - // Verify the contents of the request + // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); assertEquals(request.getMethod(), "PUT"); - - // Check query + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, updateVisibilityPath); + // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - // Get query params assertEquals(query.get("account"), "testString"); - // Check request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateVisibilityPath); } - // Test the updateVisibility operation with null options model parameter + // Test the updateVisibility operation with and without retries enabled + @Test + public void testUpdateVisibilityWRetries() throws Throwable { + globalCatalogService.enableRetries(4, 30); + testUpdateVisibilityWOptions(); + + globalCatalogService.disableRetries(); + testUpdateVisibilityWOptions(); + } + + // Test the updateVisibility operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) public void testUpdateVisibilityNoOptions() throws Throwable { - // construct the service - constructClientService(); - server.enqueue(new MockResponse()); - - // Invoke operation with null options model (negative test) globalCatalogService.updateVisibility(null).execute(); } + // Test the getPricing operation with a valid options model parameter @Test public void testGetPricingWOptions() throws Throwable { - // Schedule some responses. - String mockResponseBody = "{\"type\": \"type\", \"origin\": \"origin\", \"starting_price\": {\"plan_id\": \"planId\", \"deployment_id\": \"deploymentId\", \"unit\": \"unit\", \"amount\": [{\"country\": \"country\", \"currency\": \"currency\", \"prices\": [{\"quantity_tier\": 12, \"Price\": 5}]}]}, \"metrics\": [{\"part_ref\": \"partRef\", \"metric_id\": \"metricId\", \"tier_model\": \"tierModel\", \"charge_unit\": \"chargeUnit\", \"charge_unit_name\": \"chargeUnitName\", \"charge_unit_quantity\": \"chargeUnitQuantity\", \"resource_display_name\": \"resourceDisplayName\", \"charge_unit_display_name\": \"chargeUnitDisplayName\", \"usage_cap_qty\": 11, \"display_cap\": 10, \"effective_from\": \"2019-01-01T12:00:00.000Z\", \"effective_until\": \"2019-01-01T12:00:00.000Z\", \"amounts\": [{\"country\": \"country\", \"currency\": \"currency\", \"prices\": [{\"quantity_tier\": 12, \"Price\": 5}]}]}]}"; + // Register a mock response + String mockResponseBody = "{\"deployment_id\": \"deploymentId\", \"deployment_location\": \"deploymentLocation\", \"deployment_location_no_price_available\": true, \"type\": \"type\", \"origin\": \"origin\", \"starting_price\": {\"plan_id\": \"planId\", \"deployment_id\": \"deploymentId\", \"unit\": \"unit\", \"amount\": [{\"country\": \"country\", \"currency\": \"currency\", \"prices\": [{\"quantity_tier\": 12, \"price\": 5}]}]}, \"metrics\": [{\"part_ref\": \"partRef\", \"metric_id\": \"metricId\", \"tier_model\": \"tierModel\", \"charge_unit\": \"chargeUnit\", \"charge_unit_name\": \"chargeUnitName\", \"charge_unit_quantity\": 18, \"resource_display_name\": \"resourceDisplayName\", \"charge_unit_display_name\": \"chargeUnitDisplayName\", \"usage_cap_qty\": 11, \"display_cap\": 10, \"effective_from\": \"2019-01-01T12:00:00.000Z\", \"effective_until\": \"2019-01-01T12:00:00.000Z\", \"amounts\": [{\"country\": \"country\", \"currency\": \"currency\", \"prices\": [{\"quantity_tier\": 12, \"price\": 5}]}]}], \"deployment_regions\": [\"deploymentRegions\"]}"; String getPricingPath = "/testString/pricing"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - constructClientService(); + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); // Construct an instance of the GetPricingOptions model GetPricingOptions getPricingOptionsModel = new GetPricingOptions.Builder() - .id("testString") - .account("testString") - .build(); + .id("testString") + .account("testString") + .deploymentRegion("testString") + .build(); - // Invoke operation with valid options model (positive test) + // Invoke getPricing() with a valid options model and verify the result Response response = globalCatalogService.getPricing(getPricingOptionsModel).execute(); assertNotNull(response); PricingGet responseObj = response.getResult(); assertNotNull(responseObj); - // Verify the contents of the request + // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); assertEquals(request.getMethod(), "GET"); - - // Check query + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, getPricingPath); + // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - // Get query params assertEquals(query.get("account"), "testString"); - // Check request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getPricingPath); + assertEquals(query.get("deployment_region"), "testString"); } - // Test the getPricing operation with null options model parameter + // Test the getPricing operation with and without retries enabled + @Test + public void testGetPricingWRetries() throws Throwable { + globalCatalogService.enableRetries(4, 30); + testGetPricingWOptions(); + + globalCatalogService.disableRetries(); + testGetPricingWOptions(); + } + + // Test the getPricing operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) public void testGetPricingNoOptions() throws Throwable { - // construct the service - constructClientService(); - server.enqueue(new MockResponse()); - - // Invoke operation with null options model (negative test) globalCatalogService.getPricing(null).execute(); } + // Test the getPricingDeployments operation with a valid options model parameter + @Test + public void testGetPricingDeploymentsWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"offset\": 6, \"limit\": 5, \"count\": 5, \"resource_count\": 13, \"first\": \"first\", \"last\": \"last\", \"prev\": \"prev\", \"next\": \"next\", \"resources\": [{\"deployment_id\": \"deploymentId\", \"deployment_location\": \"deploymentLocation\", \"deployment_location_no_price_available\": true, \"type\": \"type\", \"origin\": \"origin\", \"starting_price\": {\"plan_id\": \"planId\", \"deployment_id\": \"deploymentId\", \"unit\": \"unit\", \"amount\": [{\"country\": \"country\", \"currency\": \"currency\", \"prices\": [{\"quantity_tier\": 12, \"price\": 5}]}]}, \"metrics\": [{\"part_ref\": \"partRef\", \"metric_id\": \"metricId\", \"tier_model\": \"tierModel\", \"charge_unit\": \"chargeUnit\", \"charge_unit_name\": \"chargeUnitName\", \"charge_unit_quantity\": 18, \"resource_display_name\": \"resourceDisplayName\", \"charge_unit_display_name\": \"chargeUnitDisplayName\", \"usage_cap_qty\": 11, \"display_cap\": 10, \"effective_from\": \"2019-01-01T12:00:00.000Z\", \"effective_until\": \"2019-01-01T12:00:00.000Z\", \"amounts\": [{\"country\": \"country\", \"currency\": \"currency\", \"prices\": [{\"quantity_tier\": 12, \"price\": 5}]}]}], \"deployment_regions\": [\"deploymentRegions\"]}]}"; + String getPricingDeploymentsPath = "/testString/pricing/deployment"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the GetPricingDeploymentsOptions model + GetPricingDeploymentsOptions getPricingDeploymentsOptionsModel = new GetPricingDeploymentsOptions.Builder() + .id("testString") + .account("testString") + .build(); + + // Invoke getPricingDeployments() with a valid options model and verify the result + Response response = globalCatalogService.getPricingDeployments(getPricingDeploymentsOptionsModel).execute(); + assertNotNull(response); + PricingSearchResult responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "GET"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, getPricingDeploymentsPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("account"), "testString"); + } + + // Test the getPricingDeployments operation with and without retries enabled + @Test + public void testGetPricingDeploymentsWRetries() throws Throwable { + globalCatalogService.enableRetries(4, 30); + testGetPricingDeploymentsWOptions(); + + globalCatalogService.disableRetries(); + testGetPricingDeploymentsWOptions(); + } + + // Test the getPricingDeployments operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testGetPricingDeploymentsNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + globalCatalogService.getPricingDeployments(null).execute(); + } + + // Test the getAuditLogs operation with a valid options model parameter @Test public void testGetAuditLogsWOptions() throws Throwable { - // Schedule some responses. - String mockResponseBody = "{\"offset\": 6, \"limit\": 5, \"count\": 5, \"resource_count\": 13, \"first\": \"first\", \"last\": \"last\", \"prev\": \"prev\", \"next\": \"next\", \"resources\": [{\"id\": \"id\", \"effective\": {\"restrictions\": \"restrictions\", \"owner\": \"owner\", \"extendable\": true, \"include\": {\"accounts\": {\"_accountid_\": \"accountid\"}}, \"exclude\": {\"accounts\": {\"_accountid_\": \"accountid\"}}, \"approved\": true}, \"time\": \"2019-01-01T12:00:00.000Z\", \"who_id\": \"whoId\", \"who_name\": \"whoName\", \"who_email\": \"whoEmail\", \"instance\": \"instance\", \"gid\": \"gid\", \"type\": \"type\", \"message\": \"message\", \"data\": {\"mapKey\": \"anyValue\"}}]}"; + // Register a mock response + String mockResponseBody = "{\"offset\": 6, \"limit\": 5, \"count\": 5, \"resource_count\": 13, \"first\": \"first\", \"last\": \"last\", \"prev\": \"prev\", \"next\": \"next\", \"resources\": [{\"id\": \"id\", \"effective\": {\"restrictions\": \"restrictions\", \"owner\": \"owner\", \"extendable\": true, \"include\": {\"accounts\": {\"_accountid_\": \"accountid\"}}, \"exclude\": {\"accounts\": {\"_accountid_\": \"accountid\"}}, \"approved\": true}, \"time\": \"2019-01-01T12:00:00.000Z\", \"who_id\": \"whoId\", \"who_name\": \"whoName\", \"who_email\": \"whoEmail\", \"instance\": \"instance\", \"gid\": \"gid\", \"type\": \"type\", \"message\": \"message\", \"data\": {\"anyKey\": \"anyValue\"}}]}"; String getAuditLogsPath = "/testString/logs"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - constructClientService(); + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); // Construct an instance of the GetAuditLogsOptions model GetAuditLogsOptions getAuditLogsOptionsModel = new GetAuditLogsOptions.Builder() - .id("testString") - .account("testString") - .ascending("testString") - .startat("testString") - .offset(Long.valueOf("26")) - .limit(Long.valueOf("200")) - .build(); - - // Invoke operation with valid options model (positive test) + .id("testString") + .account("testString") + .ascending("false") + .startat("testString") + .offset(Long.valueOf("0")) + .limit(Long.valueOf("50")) + .build(); + + // Invoke getAuditLogs() with a valid options model and verify the result Response response = globalCatalogService.getAuditLogs(getAuditLogsOptionsModel).execute(); assertNotNull(response); AuditSearchResult responseObj = response.getResult(); assertNotNull(responseObj); - // Verify the contents of the request + // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); assertEquals(request.getMethod(), "GET"); - - // Check query + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, getAuditLogsPath); + // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - // Get query params assertEquals(query.get("account"), "testString"); - assertEquals(query.get("ascending"), "testString"); + assertEquals(query.get("ascending"), "false"); assertEquals(query.get("startat"), "testString"); - assertEquals(Long.valueOf(query.get("_offset")), Long.valueOf("26")); - assertEquals(Long.valueOf(query.get("_limit")), Long.valueOf("200")); - // Check request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getAuditLogsPath); + assertEquals(Long.valueOf(query.get("_offset")), Long.valueOf("0")); + assertEquals(Long.valueOf(query.get("_limit")), Long.valueOf("50")); + } + + // Test the getAuditLogs operation with and without retries enabled + @Test + public void testGetAuditLogsWRetries() throws Throwable { + globalCatalogService.enableRetries(4, 30); + testGetAuditLogsWOptions(); + + globalCatalogService.disableRetries(); + testGetAuditLogsWOptions(); } - // Test the getAuditLogs operation with null options model parameter + // Test the getAuditLogs operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) public void testGetAuditLogsNoOptions() throws Throwable { - // construct the service - constructClientService(); - server.enqueue(new MockResponse()); - - // Invoke operation with null options model (negative test) globalCatalogService.getAuditLogs(null).execute(); } + // Test the listArtifacts operation with a valid options model parameter @Test public void testListArtifactsWOptions() throws Throwable { - // Schedule some responses. + // Register a mock response String mockResponseBody = "{\"count\": 5, \"resources\": [{\"name\": \"name\", \"updated\": \"2019-01-01T12:00:00.000Z\", \"url\": \"url\", \"etag\": \"etag\", \"size\": 4}]}"; String listArtifactsPath = "/testString/artifacts"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - constructClientService(); + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); // Construct an instance of the ListArtifactsOptions model ListArtifactsOptions listArtifactsOptionsModel = new ListArtifactsOptions.Builder() - .objectId("testString") - .account("testString") - .build(); + .objectId("testString") + .account("testString") + .build(); - // Invoke operation with valid options model (positive test) + // Invoke listArtifacts() with a valid options model and verify the result Response response = globalCatalogService.listArtifacts(listArtifactsOptionsModel).execute(); assertNotNull(response); Artifacts responseObj = response.getResult(); assertNotNull(responseObj); - // Verify the contents of the request + // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); assertEquals(request.getMethod(), "GET"); - - // Check query + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, listArtifactsPath); + // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - // Get query params assertEquals(query.get("account"), "testString"); - // Check request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listArtifactsPath); } - // Test the listArtifacts operation with null options model parameter + // Test the listArtifacts operation with and without retries enabled + @Test + public void testListArtifactsWRetries() throws Throwable { + globalCatalogService.enableRetries(4, 30); + testListArtifactsWOptions(); + + globalCatalogService.disableRetries(); + testListArtifactsWOptions(); + } + + // Test the listArtifacts operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) public void testListArtifactsNoOptions() throws Throwable { - // construct the service - constructClientService(); - server.enqueue(new MockResponse()); - - // Invoke operation with null options model (negative test) globalCatalogService.listArtifacts(null).execute(); } + // Test the getArtifact operation with a valid options model parameter @Test public void testGetArtifactWOptions() throws Throwable { - // Schedule some responses. + // Register a mock response String mockResponseBody = "This is a mock binary response."; String getArtifactPath = "/testString/artifacts/testString"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "*/*") - .setResponseCode(200) - .setBody(mockResponseBody)); - - constructClientService(); + .setHeader("Content-type", "*/*") + .setResponseCode(200) + .setBody(mockResponseBody)); // Construct an instance of the GetArtifactOptions model GetArtifactOptions getArtifactOptionsModel = new GetArtifactOptions.Builder() - .objectId("testString") - .artifactId("testString") - .accept("testString") - .account("testString") - .build(); + .objectId("testString") + .artifactId("testString") + .accept("testString") + .account("testString") + .build(); - // Invoke operation with valid options model (positive test) + // Invoke getArtifact() with a valid options model and verify the result Response response = globalCatalogService.getArtifact(getArtifactOptionsModel).execute(); assertNotNull(response); - InputStream responseObj = response.getResult(); - assertNotNull(responseObj); + try (InputStream responseObj = response.getResult();) { + assertNotNull(responseObj); + } - // Verify the contents of the request + // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); assertEquals(request.getMethod(), "GET"); - - // Check query + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, getArtifactPath); + // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - // Get query params assertEquals(query.get("account"), "testString"); - // Check request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getArtifactPath); } - // Test the getArtifact operation with null options model parameter + // Test the getArtifact operation with and without retries enabled + @Test + public void testGetArtifactWRetries() throws Throwable { + globalCatalogService.enableRetries(4, 30); + testGetArtifactWOptions(); + + globalCatalogService.disableRetries(); + testGetArtifactWOptions(); + } + + // Test the getArtifact operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) public void testGetArtifactNoOptions() throws Throwable { - // construct the service - constructClientService(); - server.enqueue(new MockResponse()); - - // Invoke operation with null options model (negative test) globalCatalogService.getArtifact(null).execute(); } + // Test the uploadArtifact operation with a valid options model parameter @Test public void testUploadArtifactWOptions() throws Throwable { - // Schedule some responses. + // Register a mock response String mockResponseBody = ""; String uploadArtifactPath = "/testString/artifacts/testString"; - server.enqueue(new MockResponse() - .setResponseCode(200) - .setBody(mockResponseBody)); - - constructClientService(); + .setResponseCode(200) + .setBody(mockResponseBody)); // Construct an instance of the UploadArtifactOptions model UploadArtifactOptions uploadArtifactOptionsModel = new UploadArtifactOptions.Builder() - .objectId("testString") - .artifactId("testString") - .artifact(TestUtilities.createMockStream("This is a mock file.")) - .contentType("testString") - .account("testString") - .build(); - - // Invoke operation with valid options model (positive test) + .objectId("testString") + .artifactId("testString") + .artifact(TestUtilities.createMockStream("This is a mock file.")) + .contentType("testString") + .account("testString") + .build(); + + // Invoke uploadArtifact() with a valid options model and verify the result Response response = globalCatalogService.uploadArtifact(uploadArtifactOptionsModel).execute(); assertNotNull(response); Void responseObj = response.getResult(); - // Response does not have a return type. Check that the result is null. assertNull(responseObj); - // Verify the contents of the request + // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); assertEquals(request.getMethod(), "PUT"); - - // Check query + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, uploadArtifactPath); + // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - // Get query params assertEquals(query.get("account"), "testString"); - // Check request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, uploadArtifactPath); } - // Test the uploadArtifact operation with null options model parameter + // Test the uploadArtifact operation with and without retries enabled + @Test + public void testUploadArtifactWRetries() throws Throwable { + globalCatalogService.enableRetries(4, 30); + testUploadArtifactWOptions(); + + globalCatalogService.disableRetries(); + testUploadArtifactWOptions(); + } + + // Test the uploadArtifact operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) public void testUploadArtifactNoOptions() throws Throwable { - // construct the service - constructClientService(); - server.enqueue(new MockResponse()); - - // Invoke operation with null options model (negative test) globalCatalogService.uploadArtifact(null).execute(); } + // Test the deleteArtifact operation with a valid options model parameter @Test public void testDeleteArtifactWOptions() throws Throwable { - // Schedule some responses. + // Register a mock response String mockResponseBody = ""; String deleteArtifactPath = "/testString/artifacts/testString"; - server.enqueue(new MockResponse() - .setResponseCode(200) - .setBody(mockResponseBody)); - - constructClientService(); + .setResponseCode(200) + .setBody(mockResponseBody)); // Construct an instance of the DeleteArtifactOptions model DeleteArtifactOptions deleteArtifactOptionsModel = new DeleteArtifactOptions.Builder() - .objectId("testString") - .artifactId("testString") - .account("testString") - .build(); + .objectId("testString") + .artifactId("testString") + .account("testString") + .build(); - // Invoke operation with valid options model (positive test) + // Invoke deleteArtifact() with a valid options model and verify the result Response response = globalCatalogService.deleteArtifact(deleteArtifactOptionsModel).execute(); assertNotNull(response); Void responseObj = response.getResult(); - // Response does not have a return type. Check that the result is null. assertNull(responseObj); - // Verify the contents of the request + // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); assertEquals(request.getMethod(), "DELETE"); - - // Check query + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, deleteArtifactPath); + // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - // Get query params assertEquals(query.get("account"), "testString"); - // Check request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteArtifactPath); } - // Test the deleteArtifact operation with null options model parameter + // Test the deleteArtifact operation with and without retries enabled + @Test + public void testDeleteArtifactWRetries() throws Throwable { + globalCatalogService.enableRetries(4, 30); + testDeleteArtifactWOptions(); + + globalCatalogService.disableRetries(); + testDeleteArtifactWOptions(); + } + + // Test the deleteArtifact operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) public void testDeleteArtifactNoOptions() throws Throwable { - // construct the service - constructClientService(); - server.enqueue(new MockResponse()); - - // Invoke operation with null options model (negative test) globalCatalogService.deleteArtifact(null).execute(); } - /** Initialize the server */ + // Perform setup needed before each test method @BeforeMethod - public void setUpMockServer() { + public void beforeEachTest() { + // Start the mock server. try { - server = new MockWebServer(); - // register handler - server.start(); - } - catch (IOException err) { - fail("Failed to instantiate mock web server"); + server = new MockWebServer(); + server.start(); + } catch (IOException err) { + fail("Failed to instantiate mock web server"); } + + // Construct an instance of the service + constructClientService(); } + // Perform tear down after each test method @AfterMethod - public void tearDownMockServer() throws IOException { + public void afterEachTest() throws IOException { server.shutdown(); globalCatalogService = null; } + + // Constructs an instance of the service to be used by the tests + public void constructClientService() { + System.setProperty("TESTSERVICE_AUTH_TYPE", "noAuth"); + final String serviceName = "testService"; + + globalCatalogService = GlobalCatalog.newInstance(serviceName); + String url = server.url("/").toString(); + globalCatalogService.setServiceUrl(url); + } } \ No newline at end of file diff --git a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/AliasMetaDataTest.java b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/AliasMetaDataTest.java index 01bd08b72b..e81ed82b25 100644 --- a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/AliasMetaDataTest.java +++ b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/AliasMetaDataTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/AmountTest.java b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/AmountTest.java index b6db43acd0..2b630f3794 100644 --- a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/AmountTest.java +++ b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/AmountTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -18,8 +18,6 @@ import com.ibm.cloud.platform_services.global_catalog.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; @@ -44,11 +42,11 @@ public void testAmount() throws Throwable { Amount amountModel = new Amount.Builder() .country("testString") .currency("testString") - .prices(new java.util.ArrayList(java.util.Arrays.asList(priceModel))) + .prices(java.util.Arrays.asList(priceModel)) .build(); assertEquals(amountModel.country(), "testString"); assertEquals(amountModel.currency(), "testString"); - assertEquals(amountModel.prices(), new java.util.ArrayList(java.util.Arrays.asList(priceModel))); + assertEquals(amountModel.prices(), java.util.Arrays.asList(priceModel)); String json = TestUtilities.serialize(amountModel); diff --git a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/ArtifactTest.java b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/ArtifactTest.java index b49e2b534c..a5438177d0 100644 --- a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/ArtifactTest.java +++ b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/ArtifactTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/ArtifactsTest.java b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/ArtifactsTest.java index e5365a0282..ef6af3632e 100644 --- a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/ArtifactsTest.java +++ b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/ArtifactsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/AuditSearchResultTest.java b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/AuditSearchResultTest.java index ecedb92b3b..1bcfb3c1f7 100644 --- a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/AuditSearchResultTest.java +++ b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/AuditSearchResultTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/BrokerTest.java b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/BrokerTest.java index e10798c263..01a79c3618 100644 --- a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/BrokerTest.java +++ b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/BrokerTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/BulletsTest.java b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/BulletsTest.java index f055bdf96a..2662db2b18 100644 --- a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/BulletsTest.java +++ b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/BulletsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/CFMetaDataTest.java b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/CFMetaDataTest.java index e90443e0dc..460ad15db5 100644 --- a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/CFMetaDataTest.java +++ b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/CFMetaDataTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -17,8 +17,6 @@ import com.ibm.cloud.platform_services.global_catalog.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; @@ -41,13 +39,13 @@ public void testCFMetaData() throws Throwable { .bindable(true) .asyncProvisioningSupported(true) .asyncUnprovisioningSupported(true) - .requires(new java.util.ArrayList(java.util.Arrays.asList("testString"))) + .requires(java.util.Arrays.asList("testString")) .planUpdateable(true) .state("testString") .serviceCheckEnabled(true) .testCheckInterval(Long.valueOf("26")) .serviceKeySupported(true) - .cfGuid(new java.util.HashMap() { { put("foo", "testString"); } }) + .cfGuid(java.util.Collections.singletonMap("key1", "testString")) .build(); assertEquals(cfMetaDataModel.type(), "testString"); assertEquals(cfMetaDataModel.iamCompatible(), Boolean.valueOf(true)); @@ -56,13 +54,13 @@ public void testCFMetaData() throws Throwable { assertEquals(cfMetaDataModel.bindable(), Boolean.valueOf(true)); assertEquals(cfMetaDataModel.asyncProvisioningSupported(), Boolean.valueOf(true)); assertEquals(cfMetaDataModel.asyncUnprovisioningSupported(), Boolean.valueOf(true)); - assertEquals(cfMetaDataModel.requires(), new java.util.ArrayList(java.util.Arrays.asList("testString"))); + assertEquals(cfMetaDataModel.requires(), java.util.Arrays.asList("testString")); assertEquals(cfMetaDataModel.planUpdateable(), Boolean.valueOf(true)); assertEquals(cfMetaDataModel.state(), "testString"); assertEquals(cfMetaDataModel.serviceCheckEnabled(), Boolean.valueOf(true)); assertEquals(cfMetaDataModel.testCheckInterval(), Long.valueOf("26")); assertEquals(cfMetaDataModel.serviceKeySupported(), Boolean.valueOf(true)); - assertEquals(cfMetaDataModel.cfGuid(), new java.util.HashMap() { { put("foo", "testString"); } }); + assertEquals(cfMetaDataModel.cfGuid(), java.util.Collections.singletonMap("key1", "testString")); String json = TestUtilities.serialize(cfMetaDataModel); diff --git a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/CallbacksTest.java b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/CallbacksTest.java index 7d2e1dfba5..88bc805c85 100644 --- a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/CallbacksTest.java +++ b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/CallbacksTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -41,7 +41,7 @@ public void testCallbacks() throws Throwable { .dashboardDetailTabExtUrl("testString") .serviceMonitorApi("testString") .serviceMonitorApp("testString") - .apiEndpoint(new java.util.HashMap() { { put("foo", "testString"); } }) + .apiEndpoint(java.util.Collections.singletonMap("key1", "testString")) .build(); assertEquals(callbacksModel.controllerUrl(), "testString"); assertEquals(callbacksModel.brokerUrl(), "testString"); @@ -52,7 +52,7 @@ public void testCallbacks() throws Throwable { assertEquals(callbacksModel.dashboardDetailTabExtUrl(), "testString"); assertEquals(callbacksModel.serviceMonitorApi(), "testString"); assertEquals(callbacksModel.serviceMonitorApp(), "testString"); - assertEquals(callbacksModel.apiEndpoint(), new java.util.HashMap() { { put("foo", "testString"); } }); + assertEquals(callbacksModel.apiEndpoint(), java.util.Collections.singletonMap("key1", "testString")); String json = TestUtilities.serialize(callbacksModel); diff --git a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/CatalogEntryMetadataDeploymentTest.java b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/CatalogEntryMetadataDeploymentTest.java index ba9ab56a1a..dcf9559752 100644 --- a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/CatalogEntryMetadataDeploymentTest.java +++ b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/CatalogEntryMetadataDeploymentTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/CatalogEntryMetadataPricingTest.java b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/CatalogEntryMetadataPricingTest.java index a83ac64475..c577bdcd25 100644 --- a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/CatalogEntryMetadataPricingTest.java +++ b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/CatalogEntryMetadataPricingTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -22,8 +22,6 @@ import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import com.ibm.cloud.sdk.core.util.DateUtils; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; @@ -42,6 +40,10 @@ public void testCatalogEntryMetadataPricing() throws Throwable { assertNull(catalogEntryMetadataPricingModel.getType()); assertNull(catalogEntryMetadataPricingModel.getOrigin()); assertNull(catalogEntryMetadataPricingModel.getStartingPrice()); + assertNull(catalogEntryMetadataPricingModel.getDeploymentId()); + assertNull(catalogEntryMetadataPricingModel.getDeploymentLocation()); + assertNull(catalogEntryMetadataPricingModel.isDeploymentLocationNoPriceAvailable()); assertNull(catalogEntryMetadataPricingModel.getMetrics()); + assertNull(catalogEntryMetadataPricingModel.getDeploymentRegions()); } } \ No newline at end of file diff --git a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/CatalogEntryMetadataTest.java b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/CatalogEntryMetadataTest.java index a56e1129f5..6f1188022c 100644 --- a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/CatalogEntryMetadataTest.java +++ b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/CatalogEntryMetadataTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -31,6 +31,7 @@ import com.ibm.cloud.platform_services.global_catalog.v1.model.StartingPrice; import com.ibm.cloud.platform_services.global_catalog.v1.model.Strings; import com.ibm.cloud.platform_services.global_catalog.v1.model.TemplateMetaData; +import com.ibm.cloud.platform_services.global_catalog.v1.model.UIMediaSourceMetaData; import com.ibm.cloud.platform_services.global_catalog.v1.model.UIMetaData; import com.ibm.cloud.platform_services.global_catalog.v1.model.UIMetaMedia; import com.ibm.cloud.platform_services.global_catalog.v1.model.URLS; @@ -38,8 +39,6 @@ import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import com.ibm.cloud.sdk.core.util.DateUtils; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; diff --git a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/CatalogEntryTest.java b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/CatalogEntryTest.java index f5c3dbeecf..f0c9fbf1fd 100644 --- a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/CatalogEntryTest.java +++ b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/CatalogEntryTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -35,6 +35,7 @@ import com.ibm.cloud.platform_services.global_catalog.v1.model.StartingPrice; import com.ibm.cloud.platform_services.global_catalog.v1.model.Strings; import com.ibm.cloud.platform_services.global_catalog.v1.model.TemplateMetaData; +import com.ibm.cloud.platform_services.global_catalog.v1.model.UIMediaSourceMetaData; import com.ibm.cloud.platform_services.global_catalog.v1.model.UIMetaData; import com.ibm.cloud.platform_services.global_catalog.v1.model.UIMetaMedia; import com.ibm.cloud.platform_services.global_catalog.v1.model.URLS; @@ -42,8 +43,6 @@ import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import com.ibm.cloud.sdk.core.util.DateUtils; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; diff --git a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/CreateCatalogEntryOptionsTest.java b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/CreateCatalogEntryOptionsTest.java index 7d2eb1659f..00859d95a8 100644 --- a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/CreateCatalogEntryOptionsTest.java +++ b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/CreateCatalogEntryOptionsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -34,6 +34,7 @@ import com.ibm.cloud.platform_services.global_catalog.v1.model.StartingPrice; import com.ibm.cloud.platform_services.global_catalog.v1.model.Strings; import com.ibm.cloud.platform_services.global_catalog.v1.model.TemplateMetaData; +import com.ibm.cloud.platform_services.global_catalog.v1.model.UIMediaSourceMetaData; import com.ibm.cloud.platform_services.global_catalog.v1.model.UIMetaData; import com.ibm.cloud.platform_services.global_catalog.v1.model.UIMetaMedia; import com.ibm.cloud.platform_services.global_catalog.v1.model.URLS; @@ -41,8 +42,6 @@ import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import com.ibm.cloud.sdk.core.util.DateUtils; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; @@ -100,13 +99,13 @@ public void testCreateCatalogEntryOptions() throws Throwable { .bindable(true) .asyncProvisioningSupported(true) .asyncUnprovisioningSupported(true) - .requires(new java.util.ArrayList(java.util.Arrays.asList("testString"))) + .requires(java.util.Arrays.asList("testString")) .planUpdateable(true) .state("testString") .serviceCheckEnabled(true) .testCheckInterval(Long.valueOf("26")) .serviceKeySupported(true) - .cfGuid(new java.util.HashMap() { { put("foo", "testString"); } }) + .cfGuid(java.util.Collections.singletonMap("key1", "testString")) .build(); assertEquals(cfMetaDataModel.type(), "testString"); assertEquals(cfMetaDataModel.iamCompatible(), Boolean.valueOf(true)); @@ -115,13 +114,13 @@ public void testCreateCatalogEntryOptions() throws Throwable { assertEquals(cfMetaDataModel.bindable(), Boolean.valueOf(true)); assertEquals(cfMetaDataModel.asyncProvisioningSupported(), Boolean.valueOf(true)); assertEquals(cfMetaDataModel.asyncUnprovisioningSupported(), Boolean.valueOf(true)); - assertEquals(cfMetaDataModel.requires(), new java.util.ArrayList(java.util.Arrays.asList("testString"))); + assertEquals(cfMetaDataModel.requires(), java.util.Arrays.asList("testString")); assertEquals(cfMetaDataModel.planUpdateable(), Boolean.valueOf(true)); assertEquals(cfMetaDataModel.state(), "testString"); assertEquals(cfMetaDataModel.serviceCheckEnabled(), Boolean.valueOf(true)); assertEquals(cfMetaDataModel.testCheckInterval(), Long.valueOf("26")); assertEquals(cfMetaDataModel.serviceKeySupported(), Boolean.valueOf(true)); - assertEquals(cfMetaDataModel.cfGuid(), new java.util.HashMap() { { put("foo", "testString"); } }); + assertEquals(cfMetaDataModel.cfGuid(), java.util.Collections.singletonMap("key1", "testString")); PlanMetaData planMetaDataModel = new PlanMetaData.Builder() .bindable(true) @@ -132,7 +131,7 @@ public void testCreateCatalogEntryOptions() throws Throwable { .testCheckInterval(Long.valueOf("26")) .singleScopeInstance("testString") .serviceCheckEnabled(true) - .cfGuid(new java.util.HashMap() { { put("foo", "testString"); } }) + .cfGuid(java.util.Collections.singletonMap("key1", "testString")) .build(); assertEquals(planMetaDataModel.bindable(), Boolean.valueOf(true)); assertEquals(planMetaDataModel.reservable(), Boolean.valueOf(true)); @@ -142,7 +141,7 @@ public void testCreateCatalogEntryOptions() throws Throwable { assertEquals(planMetaDataModel.testCheckInterval(), Long.valueOf("26")); assertEquals(planMetaDataModel.singleScopeInstance(), "testString"); assertEquals(planMetaDataModel.serviceCheckEnabled(), Boolean.valueOf(true)); - assertEquals(planMetaDataModel.cfGuid(), new java.util.HashMap() { { put("foo", "testString"); } }); + assertEquals(planMetaDataModel.cfGuid(), java.util.Collections.singletonMap("key1", "testString")); AliasMetaData aliasMetaDataModel = new AliasMetaData.Builder() .type("testString") @@ -161,7 +160,7 @@ public void testCreateCatalogEntryOptions() throws Throwable { assertEquals(sourceMetaDataModel.url(), "testString"); TemplateMetaData templateMetaDataModel = new TemplateMetaData.Builder() - .services(new java.util.ArrayList(java.util.Arrays.asList("testString"))) + .services(java.util.Arrays.asList("testString")) .defaultMemory(Long.valueOf("26")) .startCmd("testString") .source(sourceMetaDataModel) @@ -170,9 +169,9 @@ public void testCreateCatalogEntryOptions() throws Throwable { .templateId("testString") .executableFile("testString") .buildpack("testString") - .environmentVariables(new java.util.HashMap() { { put("foo", "testString"); } }) + .environmentVariables(java.util.Collections.singletonMap("key1", "testString")) .build(); - assertEquals(templateMetaDataModel.services(), new java.util.ArrayList(java.util.Arrays.asList("testString"))); + assertEquals(templateMetaDataModel.services(), java.util.Arrays.asList("testString")); assertEquals(templateMetaDataModel.defaultMemory(), Long.valueOf("26")); assertEquals(templateMetaDataModel.startCmd(), "testString"); assertEquals(templateMetaDataModel.source(), sourceMetaDataModel); @@ -181,7 +180,7 @@ public void testCreateCatalogEntryOptions() throws Throwable { assertEquals(templateMetaDataModel.templateId(), "testString"); assertEquals(templateMetaDataModel.executableFile(), "testString"); assertEquals(templateMetaDataModel.buildpack(), "testString"); - assertEquals(templateMetaDataModel.environmentVariables(), new java.util.HashMap() { { put("foo", "testString"); } }); + assertEquals(templateMetaDataModel.environmentVariables(), java.util.Collections.singletonMap("key1", "testString")); Bullets bulletsModel = new Bullets.Builder() .title("testString") @@ -194,30 +193,37 @@ public void testCreateCatalogEntryOptions() throws Throwable { assertEquals(bulletsModel.icon(), "testString"); assertEquals(bulletsModel.quantity(), Long.valueOf("26")); + UIMediaSourceMetaData uiMediaSourceMetaDataModel = new UIMediaSourceMetaData.Builder() + .type("testString") + .url("testString") + .build(); + assertEquals(uiMediaSourceMetaDataModel.type(), "testString"); + assertEquals(uiMediaSourceMetaDataModel.url(), "testString"); + UIMetaMedia uiMetaMediaModel = new UIMetaMedia.Builder() .caption("testString") .thumbnailUrl("testString") .type("testString") .url("testString") - .source(bulletsModel) + .source(java.util.Arrays.asList(uiMediaSourceMetaDataModel)) .build(); assertEquals(uiMetaMediaModel.caption(), "testString"); assertEquals(uiMetaMediaModel.thumbnailUrl(), "testString"); assertEquals(uiMetaMediaModel.type(), "testString"); assertEquals(uiMetaMediaModel.url(), "testString"); - assertEquals(uiMetaMediaModel.source(), bulletsModel); + assertEquals(uiMetaMediaModel.source(), java.util.Arrays.asList(uiMediaSourceMetaDataModel)); Strings stringsModel = new Strings.Builder() - .bullets(new java.util.ArrayList(java.util.Arrays.asList(bulletsModel))) - .media(new java.util.ArrayList(java.util.Arrays.asList(uiMetaMediaModel))) + .bullets(java.util.Arrays.asList(bulletsModel)) + .media(java.util.Arrays.asList(uiMetaMediaModel)) .notCreatableMsg("testString") .notCreatableRobotMsg("testString") .deprecationWarning("testString") .popupWarningMessage("testString") .instruction("testString") .build(); - assertEquals(stringsModel.bullets(), new java.util.ArrayList(java.util.Arrays.asList(bulletsModel))); - assertEquals(stringsModel.media(), new java.util.ArrayList(java.util.Arrays.asList(uiMetaMediaModel))); + assertEquals(stringsModel.bullets(), java.util.Arrays.asList(bulletsModel)); + assertEquals(stringsModel.media(), java.util.Arrays.asList(uiMetaMediaModel)); assertEquals(stringsModel.notCreatableMsg(), "testString"); assertEquals(stringsModel.notCreatableRobotMsg(), "testString"); assertEquals(stringsModel.deprecationWarning(), "testString"); @@ -252,11 +258,11 @@ public void testCreateCatalogEntryOptions() throws Throwable { assertEquals(urlsModel.apidocsurl(), "testString"); UIMetaData uiMetaDataModel = new UIMetaData.Builder() - .strings(new java.util.HashMap() { { put("foo", stringsModel); } }) + .strings(java.util.Collections.singletonMap("key1", stringsModel)) .urls(urlsModel) .embeddableDashboard("testString") .embeddableDashboardFullWidth(true) - .navigationOrder(new java.util.ArrayList(java.util.Arrays.asList("testString"))) + .navigationOrder(java.util.Arrays.asList("testString")) .notCreatable(true) .primaryOfferingId("testString") .accessibleDuringProvision(true) @@ -266,11 +272,11 @@ public void testCreateCatalogEntryOptions() throws Throwable { .hideLiteMetering(true) .noUpgradeNextStep(true) .build(); - assertEquals(uiMetaDataModel.strings(), new java.util.HashMap() { { put("foo", stringsModel); } }); + assertEquals(uiMetaDataModel.strings(), java.util.Collections.singletonMap("key1", stringsModel)); assertEquals(uiMetaDataModel.urls(), urlsModel); assertEquals(uiMetaDataModel.embeddableDashboard(), "testString"); assertEquals(uiMetaDataModel.embeddableDashboardFullWidth(), Boolean.valueOf(true)); - assertEquals(uiMetaDataModel.navigationOrder(), new java.util.ArrayList(java.util.Arrays.asList("testString"))); + assertEquals(uiMetaDataModel.navigationOrder(), java.util.Arrays.asList("testString")); assertEquals(uiMetaDataModel.notCreatable(), Boolean.valueOf(true)); assertEquals(uiMetaDataModel.primaryOfferingId(), "testString"); assertEquals(uiMetaDataModel.accessibleDuringProvision(), Boolean.valueOf(true)); @@ -290,14 +296,14 @@ public void testCreateCatalogEntryOptions() throws Throwable { SLAMetaData slaMetaDataModel = new SLAMetaData.Builder() .terms("testString") .tenancy("testString") - .provisioning("testString") - .responsiveness("testString") + .provisioning(Double.valueOf("72.5")) + .responsiveness(Double.valueOf("72.5")) .dr(drMetaDataModel) .build(); assertEquals(slaMetaDataModel.terms(), "testString"); assertEquals(slaMetaDataModel.tenancy(), "testString"); - assertEquals(slaMetaDataModel.provisioning(), "testString"); - assertEquals(slaMetaDataModel.responsiveness(), "testString"); + assertEquals(slaMetaDataModel.provisioning(), Double.valueOf("72.5")); + assertEquals(slaMetaDataModel.responsiveness(), Double.valueOf("72.5")); assertEquals(slaMetaDataModel.dr(), drMetaDataModel); Callbacks callbacksModel = new Callbacks.Builder() @@ -310,7 +316,7 @@ public void testCreateCatalogEntryOptions() throws Throwable { .dashboardDetailTabExtUrl("testString") .serviceMonitorApi("testString") .serviceMonitorApp("testString") - .apiEndpoint(new java.util.HashMap() { { put("foo", "testString"); } }) + .apiEndpoint(java.util.Collections.singletonMap("key1", "testString")) .build(); assertEquals(callbacksModel.controllerUrl(), "testString"); assertEquals(callbacksModel.brokerUrl(), "testString"); @@ -321,7 +327,7 @@ public void testCreateCatalogEntryOptions() throws Throwable { assertEquals(callbacksModel.dashboardDetailTabExtUrl(), "testString"); assertEquals(callbacksModel.serviceMonitorApi(), "testString"); assertEquals(callbacksModel.serviceMonitorApp(), "testString"); - assertEquals(callbacksModel.apiEndpoint(), new java.util.HashMap() { { put("foo", "testString"); } }); + assertEquals(callbacksModel.apiEndpoint(), java.util.Collections.singletonMap("key1", "testString")); Price priceModel = new Price.Builder() .quantityTier(Long.valueOf("26")) @@ -333,22 +339,22 @@ public void testCreateCatalogEntryOptions() throws Throwable { Amount amountModel = new Amount.Builder() .country("testString") .currency("testString") - .prices(new java.util.ArrayList(java.util.Arrays.asList(priceModel))) + .prices(java.util.Arrays.asList(priceModel)) .build(); assertEquals(amountModel.country(), "testString"); assertEquals(amountModel.currency(), "testString"); - assertEquals(amountModel.prices(), new java.util.ArrayList(java.util.Arrays.asList(priceModel))); + assertEquals(amountModel.prices(), java.util.Arrays.asList(priceModel)); StartingPrice startingPriceModel = new StartingPrice.Builder() .planId("testString") .deploymentId("testString") .unit("testString") - .amount(new java.util.ArrayList(java.util.Arrays.asList(amountModel))) + .amount(java.util.Arrays.asList(amountModel)) .build(); assertEquals(startingPriceModel.planId(), "testString"); assertEquals(startingPriceModel.deploymentId(), "testString"); assertEquals(startingPriceModel.unit(), "testString"); - assertEquals(startingPriceModel.amount(), new java.util.ArrayList(java.util.Arrays.asList(amountModel))); + assertEquals(startingPriceModel.amount(), java.util.Arrays.asList(amountModel)); PricingSet pricingSetModel = new PricingSet.Builder() .type("testString") @@ -394,12 +400,12 @@ public void testCreateCatalogEntryOptions() throws Throwable { .alias(aliasMetaDataModel) .template(templateMetaDataModel) .ui(uiMetaDataModel) - .compliance(new java.util.ArrayList(java.util.Arrays.asList("testString"))) + .compliance(java.util.Arrays.asList("testString")) .sla(slaMetaDataModel) .callbacks(callbacksModel) .originalName("testString") .version("testString") - .other(new java.util.HashMap() { { put("foo", "testString"); } }) + .other(java.util.Collections.singletonMap("anyKey", "anyValue")) .pricing(pricingSetModel) .deployment(deploymentBaseModel) .build(); @@ -409,41 +415,43 @@ public void testCreateCatalogEntryOptions() throws Throwable { assertEquals(objectMetadataSetModel.alias(), aliasMetaDataModel); assertEquals(objectMetadataSetModel.template(), templateMetaDataModel); assertEquals(objectMetadataSetModel.ui(), uiMetaDataModel); - assertEquals(objectMetadataSetModel.compliance(), new java.util.ArrayList(java.util.Arrays.asList("testString"))); + assertEquals(objectMetadataSetModel.compliance(), java.util.Arrays.asList("testString")); assertEquals(objectMetadataSetModel.sla(), slaMetaDataModel); assertEquals(objectMetadataSetModel.callbacks(), callbacksModel); assertEquals(objectMetadataSetModel.originalName(), "testString"); assertEquals(objectMetadataSetModel.version(), "testString"); - assertEquals(objectMetadataSetModel.other(), new java.util.HashMap() { { put("foo", "testString"); } }); + assertEquals(objectMetadataSetModel.other(), java.util.Collections.singletonMap("anyKey", "anyValue")); assertEquals(objectMetadataSetModel.pricing(), pricingSetModel); assertEquals(objectMetadataSetModel.deployment(), deploymentBaseModel); CreateCatalogEntryOptions createCatalogEntryOptionsModel = new CreateCatalogEntryOptions.Builder() .name("testString") .kind("service") - .overviewUi(new java.util.HashMap() { { put("foo", overviewModel); } }) + .overviewUi(java.util.Collections.singletonMap("key1", overviewModel)) .images(imageModel) .disabled(true) - .tags(new java.util.ArrayList(java.util.Arrays.asList("testString"))) + .tags(java.util.Arrays.asList("testString")) .provider(providerModel) .id("testString") .parentId("testString") .group(true) .active(true) + .url("testString") .metadata(objectMetadataSetModel) .account("testString") .build(); assertEquals(createCatalogEntryOptionsModel.name(), "testString"); assertEquals(createCatalogEntryOptionsModel.kind(), "service"); - assertEquals(createCatalogEntryOptionsModel.overviewUi(), new java.util.HashMap() { { put("foo", overviewModel); } }); + assertEquals(createCatalogEntryOptionsModel.overviewUi(), java.util.Collections.singletonMap("key1", overviewModel)); assertEquals(createCatalogEntryOptionsModel.images(), imageModel); assertEquals(createCatalogEntryOptionsModel.disabled(), Boolean.valueOf(true)); - assertEquals(createCatalogEntryOptionsModel.tags(), new java.util.ArrayList(java.util.Arrays.asList("testString"))); + assertEquals(createCatalogEntryOptionsModel.tags(), java.util.Arrays.asList("testString")); assertEquals(createCatalogEntryOptionsModel.provider(), providerModel); assertEquals(createCatalogEntryOptionsModel.id(), "testString"); assertEquals(createCatalogEntryOptionsModel.parentId(), "testString"); assertEquals(createCatalogEntryOptionsModel.group(), Boolean.valueOf(true)); assertEquals(createCatalogEntryOptionsModel.active(), Boolean.valueOf(true)); + assertEquals(createCatalogEntryOptionsModel.url(), "testString"); assertEquals(createCatalogEntryOptionsModel.metadata(), objectMetadataSetModel); assertEquals(createCatalogEntryOptionsModel.account(), "testString"); } diff --git a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/DRMetaDataTest.java b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/DRMetaDataTest.java index b01ca47880..597db26d57 100644 --- a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/DRMetaDataTest.java +++ b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/DRMetaDataTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/DeleteArtifactOptionsTest.java b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/DeleteArtifactOptionsTest.java index 03a9574e39..eaa479d5bc 100644 --- a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/DeleteArtifactOptionsTest.java +++ b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/DeleteArtifactOptionsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/DeleteCatalogEntryOptionsTest.java b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/DeleteCatalogEntryOptionsTest.java index 4364a4adaa..7035fd1f04 100644 --- a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/DeleteCatalogEntryOptionsTest.java +++ b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/DeleteCatalogEntryOptionsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/DeploymentBaseTest.java b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/DeploymentBaseTest.java index 6e840c4394..1a7222c11b 100644 --- a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/DeploymentBaseTest.java +++ b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/DeploymentBaseTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/EntrySearchResultTest.java b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/EntrySearchResultTest.java index 3c86987d84..37985b5eb9 100644 --- a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/EntrySearchResultTest.java +++ b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/EntrySearchResultTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -36,6 +36,7 @@ import com.ibm.cloud.platform_services.global_catalog.v1.model.StartingPrice; import com.ibm.cloud.platform_services.global_catalog.v1.model.Strings; import com.ibm.cloud.platform_services.global_catalog.v1.model.TemplateMetaData; +import com.ibm.cloud.platform_services.global_catalog.v1.model.UIMediaSourceMetaData; import com.ibm.cloud.platform_services.global_catalog.v1.model.UIMetaData; import com.ibm.cloud.platform_services.global_catalog.v1.model.UIMetaMedia; import com.ibm.cloud.platform_services.global_catalog.v1.model.URLS; @@ -43,8 +44,6 @@ import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import com.ibm.cloud.sdk.core.util.DateUtils; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; diff --git a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/GetArtifactOptionsTest.java b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/GetArtifactOptionsTest.java index 60a2ab1f8f..2cfd239eba 100644 --- a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/GetArtifactOptionsTest.java +++ b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/GetArtifactOptionsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/GetAuditLogsOptionsTest.java b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/GetAuditLogsOptionsTest.java index bc61ec5c15..35f48d6ba8 100644 --- a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/GetAuditLogsOptionsTest.java +++ b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/GetAuditLogsOptionsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -34,17 +34,17 @@ public void testGetAuditLogsOptions() throws Throwable { GetAuditLogsOptions getAuditLogsOptionsModel = new GetAuditLogsOptions.Builder() .id("testString") .account("testString") - .ascending("testString") + .ascending("false") .startat("testString") - .offset(Long.valueOf("26")) - .limit(Long.valueOf("200")) + .offset(Long.valueOf("0")) + .limit(Long.valueOf("50")) .build(); assertEquals(getAuditLogsOptionsModel.id(), "testString"); assertEquals(getAuditLogsOptionsModel.account(), "testString"); - assertEquals(getAuditLogsOptionsModel.ascending(), "testString"); + assertEquals(getAuditLogsOptionsModel.ascending(), "false"); assertEquals(getAuditLogsOptionsModel.startat(), "testString"); - assertEquals(getAuditLogsOptionsModel.offset(), Long.valueOf("26")); - assertEquals(getAuditLogsOptionsModel.limit(), Long.valueOf("200")); + assertEquals(getAuditLogsOptionsModel.offset(), Long.valueOf("0")); + assertEquals(getAuditLogsOptionsModel.limit(), Long.valueOf("50")); } @Test(expectedExceptions = IllegalArgumentException.class) diff --git a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/GetCatalogEntryOptionsTest.java b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/GetCatalogEntryOptionsTest.java index c36c087ae4..cc29263c9e 100644 --- a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/GetCatalogEntryOptionsTest.java +++ b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/GetCatalogEntryOptionsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/GetChildObjectsOptionsTest.java b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/GetChildObjectsOptionsTest.java index e06bacf6d5..98ad0ebc4b 100644 --- a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/GetChildObjectsOptionsTest.java +++ b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/GetChildObjectsOptionsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -41,8 +41,8 @@ public void testGetChildObjectsOptions() throws Throwable { .descending("testString") .languages("testString") .complete(true) - .offset(Long.valueOf("26")) - .limit(Long.valueOf("200")) + .offset(Long.valueOf("0")) + .limit(Long.valueOf("50")) .build(); assertEquals(getChildObjectsOptionsModel.id(), "testString"); assertEquals(getChildObjectsOptionsModel.kind(), "testString"); @@ -53,8 +53,8 @@ public void testGetChildObjectsOptions() throws Throwable { assertEquals(getChildObjectsOptionsModel.descending(), "testString"); assertEquals(getChildObjectsOptionsModel.languages(), "testString"); assertEquals(getChildObjectsOptionsModel.complete(), Boolean.valueOf(true)); - assertEquals(getChildObjectsOptionsModel.offset(), Long.valueOf("26")); - assertEquals(getChildObjectsOptionsModel.limit(), Long.valueOf("200")); + assertEquals(getChildObjectsOptionsModel.offset(), Long.valueOf("0")); + assertEquals(getChildObjectsOptionsModel.limit(), Long.valueOf("50")); } @Test(expectedExceptions = IllegalArgumentException.class) diff --git a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/GetPricingDeploymentsOptionsTest.java b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/GetPricingDeploymentsOptionsTest.java new file mode 100644 index 0000000000..006402c86c --- /dev/null +++ b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/GetPricingDeploymentsOptionsTest.java @@ -0,0 +1,47 @@ +/* + * (C) Copyright IBM Corp. 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.platform_services.global_catalog.v1.model; + +import com.ibm.cloud.platform_services.global_catalog.v1.model.GetPricingDeploymentsOptions; +import com.ibm.cloud.platform_services.global_catalog.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the GetPricingDeploymentsOptions model. + */ +public class GetPricingDeploymentsOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testGetPricingDeploymentsOptions() throws Throwable { + GetPricingDeploymentsOptions getPricingDeploymentsOptionsModel = new GetPricingDeploymentsOptions.Builder() + .id("testString") + .account("testString") + .build(); + assertEquals(getPricingDeploymentsOptionsModel.id(), "testString"); + assertEquals(getPricingDeploymentsOptionsModel.account(), "testString"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testGetPricingDeploymentsOptionsError() throws Throwable { + new GetPricingDeploymentsOptions.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/GetPricingOptionsTest.java b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/GetPricingOptionsTest.java index 64a2541740..59eea4ce11 100644 --- a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/GetPricingOptionsTest.java +++ b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/GetPricingOptionsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -34,9 +34,11 @@ public void testGetPricingOptions() throws Throwable { GetPricingOptions getPricingOptionsModel = new GetPricingOptions.Builder() .id("testString") .account("testString") + .deploymentRegion("testString") .build(); assertEquals(getPricingOptionsModel.id(), "testString"); assertEquals(getPricingOptionsModel.account(), "testString"); + assertEquals(getPricingOptionsModel.deploymentRegion(), "testString"); } @Test(expectedExceptions = IllegalArgumentException.class) diff --git a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/GetVisibilityOptionsTest.java b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/GetVisibilityOptionsTest.java index 957d3477cc..8819f437bc 100644 --- a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/GetVisibilityOptionsTest.java +++ b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/GetVisibilityOptionsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/ImageTest.java b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/ImageTest.java index dc59390294..bcf253b1ce 100644 --- a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/ImageTest.java +++ b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/ImageTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/ListArtifactsOptionsTest.java b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/ListArtifactsOptionsTest.java index 44024ed64c..074a7f3e1c 100644 --- a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/ListArtifactsOptionsTest.java +++ b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/ListArtifactsOptionsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/ListCatalogEntriesOptionsTest.java b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/ListCatalogEntriesOptionsTest.java index e17bc07078..c715c2210c 100644 --- a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/ListCatalogEntriesOptionsTest.java +++ b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/ListCatalogEntriesOptionsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -40,8 +40,8 @@ public void testListCatalogEntriesOptions() throws Throwable { .languages("testString") .catalog(true) .complete(true) - .offset(Long.valueOf("26")) - .limit(Long.valueOf("200")) + .offset(Long.valueOf("0")) + .limit(Long.valueOf("50")) .build(); assertEquals(listCatalogEntriesOptionsModel.account(), "testString"); assertEquals(listCatalogEntriesOptionsModel.include(), "testString"); @@ -51,7 +51,7 @@ public void testListCatalogEntriesOptions() throws Throwable { assertEquals(listCatalogEntriesOptionsModel.languages(), "testString"); assertEquals(listCatalogEntriesOptionsModel.catalog(), Boolean.valueOf(true)); assertEquals(listCatalogEntriesOptionsModel.complete(), Boolean.valueOf(true)); - assertEquals(listCatalogEntriesOptionsModel.offset(), Long.valueOf("26")); - assertEquals(listCatalogEntriesOptionsModel.limit(), Long.valueOf("200")); + assertEquals(listCatalogEntriesOptionsModel.offset(), Long.valueOf("0")); + assertEquals(listCatalogEntriesOptionsModel.limit(), Long.valueOf("50")); } } \ No newline at end of file diff --git a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/MessageTest.java b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/MessageTest.java index 2bb2ed9a97..88d9c31072 100644 --- a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/MessageTest.java +++ b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/MessageTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/MetricsTest.java b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/MetricsTest.java index f15b81bd33..171e4d2890 100644 --- a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/MetricsTest.java +++ b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/MetricsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -19,8 +19,6 @@ import com.ibm.cloud.platform_services.global_catalog.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; diff --git a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/ObjectMetadataSetTest.java b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/ObjectMetadataSetTest.java index 0fe295810d..171e510292 100644 --- a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/ObjectMetadataSetTest.java +++ b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/ObjectMetadataSetTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -30,6 +30,7 @@ import com.ibm.cloud.platform_services.global_catalog.v1.model.StartingPrice; import com.ibm.cloud.platform_services.global_catalog.v1.model.Strings; import com.ibm.cloud.platform_services.global_catalog.v1.model.TemplateMetaData; +import com.ibm.cloud.platform_services.global_catalog.v1.model.UIMediaSourceMetaData; import com.ibm.cloud.platform_services.global_catalog.v1.model.UIMetaData; import com.ibm.cloud.platform_services.global_catalog.v1.model.UIMetaMedia; import com.ibm.cloud.platform_services.global_catalog.v1.model.URLS; @@ -37,8 +38,6 @@ import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import com.ibm.cloud.sdk.core.util.DateUtils; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; @@ -61,13 +60,13 @@ public void testObjectMetadataSet() throws Throwable { .bindable(true) .asyncProvisioningSupported(true) .asyncUnprovisioningSupported(true) - .requires(new java.util.ArrayList(java.util.Arrays.asList("testString"))) + .requires(java.util.Arrays.asList("testString")) .planUpdateable(true) .state("testString") .serviceCheckEnabled(true) .testCheckInterval(Long.valueOf("26")) .serviceKeySupported(true) - .cfGuid(new java.util.HashMap() { { put("foo", "testString"); } }) + .cfGuid(java.util.Collections.singletonMap("key1", "testString")) .build(); assertEquals(cfMetaDataModel.type(), "testString"); assertEquals(cfMetaDataModel.iamCompatible(), Boolean.valueOf(true)); @@ -76,13 +75,13 @@ public void testObjectMetadataSet() throws Throwable { assertEquals(cfMetaDataModel.bindable(), Boolean.valueOf(true)); assertEquals(cfMetaDataModel.asyncProvisioningSupported(), Boolean.valueOf(true)); assertEquals(cfMetaDataModel.asyncUnprovisioningSupported(), Boolean.valueOf(true)); - assertEquals(cfMetaDataModel.requires(), new java.util.ArrayList(java.util.Arrays.asList("testString"))); + assertEquals(cfMetaDataModel.requires(), java.util.Arrays.asList("testString")); assertEquals(cfMetaDataModel.planUpdateable(), Boolean.valueOf(true)); assertEquals(cfMetaDataModel.state(), "testString"); assertEquals(cfMetaDataModel.serviceCheckEnabled(), Boolean.valueOf(true)); assertEquals(cfMetaDataModel.testCheckInterval(), Long.valueOf("26")); assertEquals(cfMetaDataModel.serviceKeySupported(), Boolean.valueOf(true)); - assertEquals(cfMetaDataModel.cfGuid(), new java.util.HashMap() { { put("foo", "testString"); } }); + assertEquals(cfMetaDataModel.cfGuid(), java.util.Collections.singletonMap("key1", "testString")); PlanMetaData planMetaDataModel = new PlanMetaData.Builder() .bindable(true) @@ -93,7 +92,7 @@ public void testObjectMetadataSet() throws Throwable { .testCheckInterval(Long.valueOf("26")) .singleScopeInstance("testString") .serviceCheckEnabled(true) - .cfGuid(new java.util.HashMap() { { put("foo", "testString"); } }) + .cfGuid(java.util.Collections.singletonMap("key1", "testString")) .build(); assertEquals(planMetaDataModel.bindable(), Boolean.valueOf(true)); assertEquals(planMetaDataModel.reservable(), Boolean.valueOf(true)); @@ -103,7 +102,7 @@ public void testObjectMetadataSet() throws Throwable { assertEquals(planMetaDataModel.testCheckInterval(), Long.valueOf("26")); assertEquals(planMetaDataModel.singleScopeInstance(), "testString"); assertEquals(planMetaDataModel.serviceCheckEnabled(), Boolean.valueOf(true)); - assertEquals(planMetaDataModel.cfGuid(), new java.util.HashMap() { { put("foo", "testString"); } }); + assertEquals(planMetaDataModel.cfGuid(), java.util.Collections.singletonMap("key1", "testString")); AliasMetaData aliasMetaDataModel = new AliasMetaData.Builder() .type("testString") @@ -122,7 +121,7 @@ public void testObjectMetadataSet() throws Throwable { assertEquals(sourceMetaDataModel.url(), "testString"); TemplateMetaData templateMetaDataModel = new TemplateMetaData.Builder() - .services(new java.util.ArrayList(java.util.Arrays.asList("testString"))) + .services(java.util.Arrays.asList("testString")) .defaultMemory(Long.valueOf("26")) .startCmd("testString") .source(sourceMetaDataModel) @@ -131,9 +130,9 @@ public void testObjectMetadataSet() throws Throwable { .templateId("testString") .executableFile("testString") .buildpack("testString") - .environmentVariables(new java.util.HashMap() { { put("foo", "testString"); } }) + .environmentVariables(java.util.Collections.singletonMap("key1", "testString")) .build(); - assertEquals(templateMetaDataModel.services(), new java.util.ArrayList(java.util.Arrays.asList("testString"))); + assertEquals(templateMetaDataModel.services(), java.util.Arrays.asList("testString")); assertEquals(templateMetaDataModel.defaultMemory(), Long.valueOf("26")); assertEquals(templateMetaDataModel.startCmd(), "testString"); assertEquals(templateMetaDataModel.source(), sourceMetaDataModel); @@ -142,7 +141,7 @@ public void testObjectMetadataSet() throws Throwable { assertEquals(templateMetaDataModel.templateId(), "testString"); assertEquals(templateMetaDataModel.executableFile(), "testString"); assertEquals(templateMetaDataModel.buildpack(), "testString"); - assertEquals(templateMetaDataModel.environmentVariables(), new java.util.HashMap() { { put("foo", "testString"); } }); + assertEquals(templateMetaDataModel.environmentVariables(), java.util.Collections.singletonMap("key1", "testString")); Bullets bulletsModel = new Bullets.Builder() .title("testString") @@ -155,30 +154,37 @@ public void testObjectMetadataSet() throws Throwable { assertEquals(bulletsModel.icon(), "testString"); assertEquals(bulletsModel.quantity(), Long.valueOf("26")); + UIMediaSourceMetaData uiMediaSourceMetaDataModel = new UIMediaSourceMetaData.Builder() + .type("testString") + .url("testString") + .build(); + assertEquals(uiMediaSourceMetaDataModel.type(), "testString"); + assertEquals(uiMediaSourceMetaDataModel.url(), "testString"); + UIMetaMedia uiMetaMediaModel = new UIMetaMedia.Builder() .caption("testString") .thumbnailUrl("testString") .type("testString") .url("testString") - .source(bulletsModel) + .source(java.util.Arrays.asList(uiMediaSourceMetaDataModel)) .build(); assertEquals(uiMetaMediaModel.caption(), "testString"); assertEquals(uiMetaMediaModel.thumbnailUrl(), "testString"); assertEquals(uiMetaMediaModel.type(), "testString"); assertEquals(uiMetaMediaModel.url(), "testString"); - assertEquals(uiMetaMediaModel.source(), bulletsModel); + assertEquals(uiMetaMediaModel.source(), java.util.Arrays.asList(uiMediaSourceMetaDataModel)); Strings stringsModel = new Strings.Builder() - .bullets(new java.util.ArrayList(java.util.Arrays.asList(bulletsModel))) - .media(new java.util.ArrayList(java.util.Arrays.asList(uiMetaMediaModel))) + .bullets(java.util.Arrays.asList(bulletsModel)) + .media(java.util.Arrays.asList(uiMetaMediaModel)) .notCreatableMsg("testString") .notCreatableRobotMsg("testString") .deprecationWarning("testString") .popupWarningMessage("testString") .instruction("testString") .build(); - assertEquals(stringsModel.bullets(), new java.util.ArrayList(java.util.Arrays.asList(bulletsModel))); - assertEquals(stringsModel.media(), new java.util.ArrayList(java.util.Arrays.asList(uiMetaMediaModel))); + assertEquals(stringsModel.bullets(), java.util.Arrays.asList(bulletsModel)); + assertEquals(stringsModel.media(), java.util.Arrays.asList(uiMetaMediaModel)); assertEquals(stringsModel.notCreatableMsg(), "testString"); assertEquals(stringsModel.notCreatableRobotMsg(), "testString"); assertEquals(stringsModel.deprecationWarning(), "testString"); @@ -213,11 +219,11 @@ public void testObjectMetadataSet() throws Throwable { assertEquals(urlsModel.apidocsurl(), "testString"); UIMetaData uiMetaDataModel = new UIMetaData.Builder() - .strings(new java.util.HashMap() { { put("foo", stringsModel); } }) + .strings(java.util.Collections.singletonMap("key1", stringsModel)) .urls(urlsModel) .embeddableDashboard("testString") .embeddableDashboardFullWidth(true) - .navigationOrder(new java.util.ArrayList(java.util.Arrays.asList("testString"))) + .navigationOrder(java.util.Arrays.asList("testString")) .notCreatable(true) .primaryOfferingId("testString") .accessibleDuringProvision(true) @@ -227,11 +233,11 @@ public void testObjectMetadataSet() throws Throwable { .hideLiteMetering(true) .noUpgradeNextStep(true) .build(); - assertEquals(uiMetaDataModel.strings(), new java.util.HashMap() { { put("foo", stringsModel); } }); + assertEquals(uiMetaDataModel.strings(), java.util.Collections.singletonMap("key1", stringsModel)); assertEquals(uiMetaDataModel.urls(), urlsModel); assertEquals(uiMetaDataModel.embeddableDashboard(), "testString"); assertEquals(uiMetaDataModel.embeddableDashboardFullWidth(), Boolean.valueOf(true)); - assertEquals(uiMetaDataModel.navigationOrder(), new java.util.ArrayList(java.util.Arrays.asList("testString"))); + assertEquals(uiMetaDataModel.navigationOrder(), java.util.Arrays.asList("testString")); assertEquals(uiMetaDataModel.notCreatable(), Boolean.valueOf(true)); assertEquals(uiMetaDataModel.primaryOfferingId(), "testString"); assertEquals(uiMetaDataModel.accessibleDuringProvision(), Boolean.valueOf(true)); @@ -251,14 +257,14 @@ public void testObjectMetadataSet() throws Throwable { SLAMetaData slaMetaDataModel = new SLAMetaData.Builder() .terms("testString") .tenancy("testString") - .provisioning("testString") - .responsiveness("testString") + .provisioning(Double.valueOf("72.5")) + .responsiveness(Double.valueOf("72.5")) .dr(drMetaDataModel) .build(); assertEquals(slaMetaDataModel.terms(), "testString"); assertEquals(slaMetaDataModel.tenancy(), "testString"); - assertEquals(slaMetaDataModel.provisioning(), "testString"); - assertEquals(slaMetaDataModel.responsiveness(), "testString"); + assertEquals(slaMetaDataModel.provisioning(), Double.valueOf("72.5")); + assertEquals(slaMetaDataModel.responsiveness(), Double.valueOf("72.5")); assertEquals(slaMetaDataModel.dr(), drMetaDataModel); Callbacks callbacksModel = new Callbacks.Builder() @@ -271,7 +277,7 @@ public void testObjectMetadataSet() throws Throwable { .dashboardDetailTabExtUrl("testString") .serviceMonitorApi("testString") .serviceMonitorApp("testString") - .apiEndpoint(new java.util.HashMap() { { put("foo", "testString"); } }) + .apiEndpoint(java.util.Collections.singletonMap("key1", "testString")) .build(); assertEquals(callbacksModel.controllerUrl(), "testString"); assertEquals(callbacksModel.brokerUrl(), "testString"); @@ -282,7 +288,7 @@ public void testObjectMetadataSet() throws Throwable { assertEquals(callbacksModel.dashboardDetailTabExtUrl(), "testString"); assertEquals(callbacksModel.serviceMonitorApi(), "testString"); assertEquals(callbacksModel.serviceMonitorApp(), "testString"); - assertEquals(callbacksModel.apiEndpoint(), new java.util.HashMap() { { put("foo", "testString"); } }); + assertEquals(callbacksModel.apiEndpoint(), java.util.Collections.singletonMap("key1", "testString")); Price priceModel = new Price.Builder() .quantityTier(Long.valueOf("26")) @@ -294,22 +300,22 @@ public void testObjectMetadataSet() throws Throwable { Amount amountModel = new Amount.Builder() .country("testString") .currency("testString") - .prices(new java.util.ArrayList(java.util.Arrays.asList(priceModel))) + .prices(java.util.Arrays.asList(priceModel)) .build(); assertEquals(amountModel.country(), "testString"); assertEquals(amountModel.currency(), "testString"); - assertEquals(amountModel.prices(), new java.util.ArrayList(java.util.Arrays.asList(priceModel))); + assertEquals(amountModel.prices(), java.util.Arrays.asList(priceModel)); StartingPrice startingPriceModel = new StartingPrice.Builder() .planId("testString") .deploymentId("testString") .unit("testString") - .amount(new java.util.ArrayList(java.util.Arrays.asList(amountModel))) + .amount(java.util.Arrays.asList(amountModel)) .build(); assertEquals(startingPriceModel.planId(), "testString"); assertEquals(startingPriceModel.deploymentId(), "testString"); assertEquals(startingPriceModel.unit(), "testString"); - assertEquals(startingPriceModel.amount(), new java.util.ArrayList(java.util.Arrays.asList(amountModel))); + assertEquals(startingPriceModel.amount(), java.util.Arrays.asList(amountModel)); PricingSet pricingSetModel = new PricingSet.Builder() .type("testString") @@ -355,12 +361,12 @@ public void testObjectMetadataSet() throws Throwable { .alias(aliasMetaDataModel) .template(templateMetaDataModel) .ui(uiMetaDataModel) - .compliance(new java.util.ArrayList(java.util.Arrays.asList("testString"))) + .compliance(java.util.Arrays.asList("testString")) .sla(slaMetaDataModel) .callbacks(callbacksModel) .originalName("testString") .version("testString") - .other(new java.util.HashMap() { { put("foo", "testString"); } }) + .other(java.util.Collections.singletonMap("anyKey", "anyValue")) .pricing(pricingSetModel) .deployment(deploymentBaseModel) .build(); @@ -370,12 +376,12 @@ public void testObjectMetadataSet() throws Throwable { assertEquals(objectMetadataSetModel.alias(), aliasMetaDataModel); assertEquals(objectMetadataSetModel.template(), templateMetaDataModel); assertEquals(objectMetadataSetModel.ui(), uiMetaDataModel); - assertEquals(objectMetadataSetModel.compliance(), new java.util.ArrayList(java.util.Arrays.asList("testString"))); + assertEquals(objectMetadataSetModel.compliance(), java.util.Arrays.asList("testString")); assertEquals(objectMetadataSetModel.sla(), slaMetaDataModel); assertEquals(objectMetadataSetModel.callbacks(), callbacksModel); assertEquals(objectMetadataSetModel.originalName(), "testString"); assertEquals(objectMetadataSetModel.version(), "testString"); - assertEquals(objectMetadataSetModel.other(), new java.util.HashMap() { { put("foo", "testString"); } }); + assertEquals(objectMetadataSetModel.other(), java.util.Collections.singletonMap("anyKey", "anyValue")); assertEquals(objectMetadataSetModel.pricing(), pricingSetModel); assertEquals(objectMetadataSetModel.deployment(), deploymentBaseModel); @@ -393,6 +399,7 @@ public void testObjectMetadataSet() throws Throwable { assertEquals(objectMetadataSetModelNew.callbacks().toString(), callbacksModel.toString()); assertEquals(objectMetadataSetModelNew.originalName(), "testString"); assertEquals(objectMetadataSetModelNew.version(), "testString"); + assertEquals(objectMetadataSetModelNew.other().toString(), java.util.Collections.singletonMap("anyKey", "anyValue").toString()); assertEquals(objectMetadataSetModelNew.pricing().toString(), pricingSetModel.toString()); assertEquals(objectMetadataSetModelNew.deployment().toString(), deploymentBaseModel.toString()); } diff --git a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/OverviewTest.java b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/OverviewTest.java index ea52ec3b56..9af9ca67bf 100644 --- a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/OverviewTest.java +++ b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/OverviewTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/PlanMetaDataTest.java b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/PlanMetaDataTest.java index 353af1bec4..a2959b5ba2 100644 --- a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/PlanMetaDataTest.java +++ b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/PlanMetaDataTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -40,7 +40,7 @@ public void testPlanMetaData() throws Throwable { .testCheckInterval(Long.valueOf("26")) .singleScopeInstance("testString") .serviceCheckEnabled(true) - .cfGuid(new java.util.HashMap() { { put("foo", "testString"); } }) + .cfGuid(java.util.Collections.singletonMap("key1", "testString")) .build(); assertEquals(planMetaDataModel.bindable(), Boolean.valueOf(true)); assertEquals(planMetaDataModel.reservable(), Boolean.valueOf(true)); @@ -50,7 +50,7 @@ public void testPlanMetaData() throws Throwable { assertEquals(planMetaDataModel.testCheckInterval(), Long.valueOf("26")); assertEquals(planMetaDataModel.singleScopeInstance(), "testString"); assertEquals(planMetaDataModel.serviceCheckEnabled(), Boolean.valueOf(true)); - assertEquals(planMetaDataModel.cfGuid(), new java.util.HashMap() { { put("foo", "testString"); } }); + assertEquals(planMetaDataModel.cfGuid(), java.util.Collections.singletonMap("key1", "testString")); String json = TestUtilities.serialize(planMetaDataModel); diff --git a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/PriceTest.java b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/PriceTest.java index 26149b034f..221f4505a4 100644 --- a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/PriceTest.java +++ b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/PriceTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/PricingGetTest.java b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/PricingGetTest.java index eac939ab29..4dea2a8979 100644 --- a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/PricingGetTest.java +++ b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/PricingGetTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -22,8 +22,6 @@ import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import com.ibm.cloud.sdk.core.util.DateUtils; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; @@ -39,9 +37,13 @@ public class PricingGetTest { @Test public void testPricingGet() throws Throwable { PricingGet pricingGetModel = new PricingGet(); + assertNull(pricingGetModel.getDeploymentId()); + assertNull(pricingGetModel.getDeploymentLocation()); + assertNull(pricingGetModel.isDeploymentLocationNoPriceAvailable()); assertNull(pricingGetModel.getType()); assertNull(pricingGetModel.getOrigin()); assertNull(pricingGetModel.getStartingPrice()); assertNull(pricingGetModel.getMetrics()); + assertNull(pricingGetModel.getDeploymentRegions()); } } \ No newline at end of file diff --git a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/PricingSearchResultTest.java b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/PricingSearchResultTest.java new file mode 100644 index 0000000000..e936dbab6e --- /dev/null +++ b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/PricingSearchResultTest.java @@ -0,0 +1,51 @@ +/* + * (C) Copyright IBM Corp. 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.platform_services.global_catalog.v1.model; + +import com.ibm.cloud.platform_services.global_catalog.v1.model.Amount; +import com.ibm.cloud.platform_services.global_catalog.v1.model.Metrics; +import com.ibm.cloud.platform_services.global_catalog.v1.model.Price; +import com.ibm.cloud.platform_services.global_catalog.v1.model.PricingGet; +import com.ibm.cloud.platform_services.global_catalog.v1.model.PricingSearchResult; +import com.ibm.cloud.platform_services.global_catalog.v1.model.StartingPrice; +import com.ibm.cloud.platform_services.global_catalog.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.sdk.core.util.DateUtils; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the PricingSearchResult model. + */ +public class PricingSearchResultTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testPricingSearchResult() throws Throwable { + PricingSearchResult pricingSearchResultModel = new PricingSearchResult(); + assertNull(pricingSearchResultModel.getOffset()); + assertNull(pricingSearchResultModel.getLimit()); + assertNull(pricingSearchResultModel.getCount()); + assertNull(pricingSearchResultModel.getResourceCount()); + assertNull(pricingSearchResultModel.getFirst()); + assertNull(pricingSearchResultModel.getLast()); + assertNull(pricingSearchResultModel.getPrev()); + assertNull(pricingSearchResultModel.getNext()); + assertNull(pricingSearchResultModel.getResources()); + } +} \ No newline at end of file diff --git a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/PricingSetTest.java b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/PricingSetTest.java index a9097002a9..e19ca20224 100644 --- a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/PricingSetTest.java +++ b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/PricingSetTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -20,8 +20,6 @@ import com.ibm.cloud.platform_services.global_catalog.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; @@ -46,22 +44,22 @@ public void testPricingSet() throws Throwable { Amount amountModel = new Amount.Builder() .country("testString") .currency("testString") - .prices(new java.util.ArrayList(java.util.Arrays.asList(priceModel))) + .prices(java.util.Arrays.asList(priceModel)) .build(); assertEquals(amountModel.country(), "testString"); assertEquals(amountModel.currency(), "testString"); - assertEquals(amountModel.prices(), new java.util.ArrayList(java.util.Arrays.asList(priceModel))); + assertEquals(amountModel.prices(), java.util.Arrays.asList(priceModel)); StartingPrice startingPriceModel = new StartingPrice.Builder() .planId("testString") .deploymentId("testString") .unit("testString") - .amount(new java.util.ArrayList(java.util.Arrays.asList(amountModel))) + .amount(java.util.Arrays.asList(amountModel)) .build(); assertEquals(startingPriceModel.planId(), "testString"); assertEquals(startingPriceModel.deploymentId(), "testString"); assertEquals(startingPriceModel.unit(), "testString"); - assertEquals(startingPriceModel.amount(), new java.util.ArrayList(java.util.Arrays.asList(amountModel))); + assertEquals(startingPriceModel.amount(), java.util.Arrays.asList(amountModel)); PricingSet pricingSetModel = new PricingSet.Builder() .type("testString") diff --git a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/ProviderTest.java b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/ProviderTest.java index 8f39dbbdc4..8124425ba9 100644 --- a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/ProviderTest.java +++ b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/ProviderTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/RestoreCatalogEntryOptionsTest.java b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/RestoreCatalogEntryOptionsTest.java index 87e99218eb..6c79a3d641 100644 --- a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/RestoreCatalogEntryOptionsTest.java +++ b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/RestoreCatalogEntryOptionsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/SLAMetaDataTest.java b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/SLAMetaDataTest.java index 1907fb6f3b..5111d3d40e 100644 --- a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/SLAMetaDataTest.java +++ b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/SLAMetaDataTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -42,14 +42,14 @@ public void testSLAMetaData() throws Throwable { SLAMetaData slaMetaDataModel = new SLAMetaData.Builder() .terms("testString") .tenancy("testString") - .provisioning("testString") - .responsiveness("testString") + .provisioning(Double.valueOf("72.5")) + .responsiveness(Double.valueOf("72.5")) .dr(drMetaDataModel) .build(); assertEquals(slaMetaDataModel.terms(), "testString"); assertEquals(slaMetaDataModel.tenancy(), "testString"); - assertEquals(slaMetaDataModel.provisioning(), "testString"); - assertEquals(slaMetaDataModel.responsiveness(), "testString"); + assertEquals(slaMetaDataModel.provisioning(), Double.valueOf("72.5")); + assertEquals(slaMetaDataModel.responsiveness(), Double.valueOf("72.5")); assertEquals(slaMetaDataModel.dr(), drMetaDataModel); String json = TestUtilities.serialize(slaMetaDataModel); @@ -58,8 +58,8 @@ public void testSLAMetaData() throws Throwable { assertTrue(slaMetaDataModelNew instanceof SLAMetaData); assertEquals(slaMetaDataModelNew.terms(), "testString"); assertEquals(slaMetaDataModelNew.tenancy(), "testString"); - assertEquals(slaMetaDataModelNew.provisioning(), "testString"); - assertEquals(slaMetaDataModelNew.responsiveness(), "testString"); + assertEquals(slaMetaDataModelNew.provisioning(), Double.valueOf("72.5")); + assertEquals(slaMetaDataModelNew.responsiveness(), Double.valueOf("72.5")); assertEquals(slaMetaDataModelNew.dr().toString(), drMetaDataModel.toString()); } } \ No newline at end of file diff --git a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/SourceMetaDataTest.java b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/SourceMetaDataTest.java index fa09043358..e94b246596 100644 --- a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/SourceMetaDataTest.java +++ b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/SourceMetaDataTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/StartingPriceTest.java b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/StartingPriceTest.java index a22a7ac2ff..7929a0861d 100644 --- a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/StartingPriceTest.java +++ b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/StartingPriceTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -19,8 +19,6 @@ import com.ibm.cloud.platform_services.global_catalog.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; @@ -45,22 +43,22 @@ public void testStartingPrice() throws Throwable { Amount amountModel = new Amount.Builder() .country("testString") .currency("testString") - .prices(new java.util.ArrayList(java.util.Arrays.asList(priceModel))) + .prices(java.util.Arrays.asList(priceModel)) .build(); assertEquals(amountModel.country(), "testString"); assertEquals(amountModel.currency(), "testString"); - assertEquals(amountModel.prices(), new java.util.ArrayList(java.util.Arrays.asList(priceModel))); + assertEquals(amountModel.prices(), java.util.Arrays.asList(priceModel)); StartingPrice startingPriceModel = new StartingPrice.Builder() .planId("testString") .deploymentId("testString") .unit("testString") - .amount(new java.util.ArrayList(java.util.Arrays.asList(amountModel))) + .amount(java.util.Arrays.asList(amountModel)) .build(); assertEquals(startingPriceModel.planId(), "testString"); assertEquals(startingPriceModel.deploymentId(), "testString"); assertEquals(startingPriceModel.unit(), "testString"); - assertEquals(startingPriceModel.amount(), new java.util.ArrayList(java.util.Arrays.asList(amountModel))); + assertEquals(startingPriceModel.amount(), java.util.Arrays.asList(amountModel)); String json = TestUtilities.serialize(startingPriceModel); diff --git a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/StringsTest.java b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/StringsTest.java index b484ca025b..aaaef1351e 100644 --- a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/StringsTest.java +++ b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/StringsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -15,12 +15,11 @@ import com.ibm.cloud.platform_services.global_catalog.v1.model.Bullets; import com.ibm.cloud.platform_services.global_catalog.v1.model.Strings; +import com.ibm.cloud.platform_services.global_catalog.v1.model.UIMediaSourceMetaData; import com.ibm.cloud.platform_services.global_catalog.v1.model.UIMetaMedia; import com.ibm.cloud.platform_services.global_catalog.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; @@ -46,30 +45,37 @@ public void testStrings() throws Throwable { assertEquals(bulletsModel.icon(), "testString"); assertEquals(bulletsModel.quantity(), Long.valueOf("26")); + UIMediaSourceMetaData uiMediaSourceMetaDataModel = new UIMediaSourceMetaData.Builder() + .type("testString") + .url("testString") + .build(); + assertEquals(uiMediaSourceMetaDataModel.type(), "testString"); + assertEquals(uiMediaSourceMetaDataModel.url(), "testString"); + UIMetaMedia uiMetaMediaModel = new UIMetaMedia.Builder() .caption("testString") .thumbnailUrl("testString") .type("testString") .url("testString") - .source(bulletsModel) + .source(java.util.Arrays.asList(uiMediaSourceMetaDataModel)) .build(); assertEquals(uiMetaMediaModel.caption(), "testString"); assertEquals(uiMetaMediaModel.thumbnailUrl(), "testString"); assertEquals(uiMetaMediaModel.type(), "testString"); assertEquals(uiMetaMediaModel.url(), "testString"); - assertEquals(uiMetaMediaModel.source(), bulletsModel); + assertEquals(uiMetaMediaModel.source(), java.util.Arrays.asList(uiMediaSourceMetaDataModel)); Strings stringsModel = new Strings.Builder() - .bullets(new java.util.ArrayList(java.util.Arrays.asList(bulletsModel))) - .media(new java.util.ArrayList(java.util.Arrays.asList(uiMetaMediaModel))) + .bullets(java.util.Arrays.asList(bulletsModel)) + .media(java.util.Arrays.asList(uiMetaMediaModel)) .notCreatableMsg("testString") .notCreatableRobotMsg("testString") .deprecationWarning("testString") .popupWarningMessage("testString") .instruction("testString") .build(); - assertEquals(stringsModel.bullets(), new java.util.ArrayList(java.util.Arrays.asList(bulletsModel))); - assertEquals(stringsModel.media(), new java.util.ArrayList(java.util.Arrays.asList(uiMetaMediaModel))); + assertEquals(stringsModel.bullets(), java.util.Arrays.asList(bulletsModel)); + assertEquals(stringsModel.media(), java.util.Arrays.asList(uiMetaMediaModel)); assertEquals(stringsModel.notCreatableMsg(), "testString"); assertEquals(stringsModel.notCreatableRobotMsg(), "testString"); assertEquals(stringsModel.deprecationWarning(), "testString"); diff --git a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/TemplateMetaDataTest.java b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/TemplateMetaDataTest.java index 7b8ab0d5e0..c29002f85f 100644 --- a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/TemplateMetaDataTest.java +++ b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/TemplateMetaDataTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -18,8 +18,6 @@ import com.ibm.cloud.platform_services.global_catalog.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; @@ -44,7 +42,7 @@ public void testTemplateMetaData() throws Throwable { assertEquals(sourceMetaDataModel.url(), "testString"); TemplateMetaData templateMetaDataModel = new TemplateMetaData.Builder() - .services(new java.util.ArrayList(java.util.Arrays.asList("testString"))) + .services(java.util.Arrays.asList("testString")) .defaultMemory(Long.valueOf("26")) .startCmd("testString") .source(sourceMetaDataModel) @@ -53,9 +51,9 @@ public void testTemplateMetaData() throws Throwable { .templateId("testString") .executableFile("testString") .buildpack("testString") - .environmentVariables(new java.util.HashMap() { { put("foo", "testString"); } }) + .environmentVariables(java.util.Collections.singletonMap("key1", "testString")) .build(); - assertEquals(templateMetaDataModel.services(), new java.util.ArrayList(java.util.Arrays.asList("testString"))); + assertEquals(templateMetaDataModel.services(), java.util.Arrays.asList("testString")); assertEquals(templateMetaDataModel.defaultMemory(), Long.valueOf("26")); assertEquals(templateMetaDataModel.startCmd(), "testString"); assertEquals(templateMetaDataModel.source(), sourceMetaDataModel); @@ -64,7 +62,7 @@ public void testTemplateMetaData() throws Throwable { assertEquals(templateMetaDataModel.templateId(), "testString"); assertEquals(templateMetaDataModel.executableFile(), "testString"); assertEquals(templateMetaDataModel.buildpack(), "testString"); - assertEquals(templateMetaDataModel.environmentVariables(), new java.util.HashMap() { { put("foo", "testString"); } }); + assertEquals(templateMetaDataModel.environmentVariables(), java.util.Collections.singletonMap("key1", "testString")); String json = TestUtilities.serialize(templateMetaDataModel); diff --git a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/UIMediaSourceMetaDataTest.java b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/UIMediaSourceMetaDataTest.java new file mode 100644 index 0000000000..3373c02a35 --- /dev/null +++ b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/UIMediaSourceMetaDataTest.java @@ -0,0 +1,48 @@ +/* + * (C) Copyright IBM Corp. 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.platform_services.global_catalog.v1.model; + +import com.ibm.cloud.platform_services.global_catalog.v1.model.UIMediaSourceMetaData; +import com.ibm.cloud.platform_services.global_catalog.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the UIMediaSourceMetaData model. + */ +public class UIMediaSourceMetaDataTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testUIMediaSourceMetaData() throws Throwable { + UIMediaSourceMetaData uiMediaSourceMetaDataModel = new UIMediaSourceMetaData.Builder() + .type("testString") + .url("testString") + .build(); + assertEquals(uiMediaSourceMetaDataModel.type(), "testString"); + assertEquals(uiMediaSourceMetaDataModel.url(), "testString"); + + String json = TestUtilities.serialize(uiMediaSourceMetaDataModel); + + UIMediaSourceMetaData uiMediaSourceMetaDataModelNew = TestUtilities.deserialize(json, UIMediaSourceMetaData.class); + assertTrue(uiMediaSourceMetaDataModelNew instanceof UIMediaSourceMetaData); + assertEquals(uiMediaSourceMetaDataModelNew.type(), "testString"); + assertEquals(uiMediaSourceMetaDataModelNew.url(), "testString"); + } +} \ No newline at end of file diff --git a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/UIMetaDataTest.java b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/UIMetaDataTest.java index ecbcfb6dcc..def968117f 100644 --- a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/UIMetaDataTest.java +++ b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/UIMetaDataTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -15,6 +15,7 @@ import com.ibm.cloud.platform_services.global_catalog.v1.model.Bullets; import com.ibm.cloud.platform_services.global_catalog.v1.model.Strings; +import com.ibm.cloud.platform_services.global_catalog.v1.model.UIMediaSourceMetaData; import com.ibm.cloud.platform_services.global_catalog.v1.model.UIMetaData; import com.ibm.cloud.platform_services.global_catalog.v1.model.UIMetaMedia; import com.ibm.cloud.platform_services.global_catalog.v1.model.URLS; @@ -22,8 +23,6 @@ import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import com.ibm.cloud.sdk.core.util.DateUtils; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; @@ -49,30 +48,37 @@ public void testUIMetaData() throws Throwable { assertEquals(bulletsModel.icon(), "testString"); assertEquals(bulletsModel.quantity(), Long.valueOf("26")); + UIMediaSourceMetaData uiMediaSourceMetaDataModel = new UIMediaSourceMetaData.Builder() + .type("testString") + .url("testString") + .build(); + assertEquals(uiMediaSourceMetaDataModel.type(), "testString"); + assertEquals(uiMediaSourceMetaDataModel.url(), "testString"); + UIMetaMedia uiMetaMediaModel = new UIMetaMedia.Builder() .caption("testString") .thumbnailUrl("testString") .type("testString") .url("testString") - .source(bulletsModel) + .source(java.util.Arrays.asList(uiMediaSourceMetaDataModel)) .build(); assertEquals(uiMetaMediaModel.caption(), "testString"); assertEquals(uiMetaMediaModel.thumbnailUrl(), "testString"); assertEquals(uiMetaMediaModel.type(), "testString"); assertEquals(uiMetaMediaModel.url(), "testString"); - assertEquals(uiMetaMediaModel.source(), bulletsModel); + assertEquals(uiMetaMediaModel.source(), java.util.Arrays.asList(uiMediaSourceMetaDataModel)); Strings stringsModel = new Strings.Builder() - .bullets(new java.util.ArrayList(java.util.Arrays.asList(bulletsModel))) - .media(new java.util.ArrayList(java.util.Arrays.asList(uiMetaMediaModel))) + .bullets(java.util.Arrays.asList(bulletsModel)) + .media(java.util.Arrays.asList(uiMetaMediaModel)) .notCreatableMsg("testString") .notCreatableRobotMsg("testString") .deprecationWarning("testString") .popupWarningMessage("testString") .instruction("testString") .build(); - assertEquals(stringsModel.bullets(), new java.util.ArrayList(java.util.Arrays.asList(bulletsModel))); - assertEquals(stringsModel.media(), new java.util.ArrayList(java.util.Arrays.asList(uiMetaMediaModel))); + assertEquals(stringsModel.bullets(), java.util.Arrays.asList(bulletsModel)); + assertEquals(stringsModel.media(), java.util.Arrays.asList(uiMetaMediaModel)); assertEquals(stringsModel.notCreatableMsg(), "testString"); assertEquals(stringsModel.notCreatableRobotMsg(), "testString"); assertEquals(stringsModel.deprecationWarning(), "testString"); @@ -107,11 +113,11 @@ public void testUIMetaData() throws Throwable { assertEquals(urlsModel.apidocsurl(), "testString"); UIMetaData uiMetaDataModel = new UIMetaData.Builder() - .strings(new java.util.HashMap() { { put("foo", stringsModel); } }) + .strings(java.util.Collections.singletonMap("key1", stringsModel)) .urls(urlsModel) .embeddableDashboard("testString") .embeddableDashboardFullWidth(true) - .navigationOrder(new java.util.ArrayList(java.util.Arrays.asList("testString"))) + .navigationOrder(java.util.Arrays.asList("testString")) .notCreatable(true) .primaryOfferingId("testString") .accessibleDuringProvision(true) @@ -121,11 +127,11 @@ public void testUIMetaData() throws Throwable { .hideLiteMetering(true) .noUpgradeNextStep(true) .build(); - assertEquals(uiMetaDataModel.strings(), new java.util.HashMap() { { put("foo", stringsModel); } }); + assertEquals(uiMetaDataModel.strings(), java.util.Collections.singletonMap("key1", stringsModel)); assertEquals(uiMetaDataModel.urls(), urlsModel); assertEquals(uiMetaDataModel.embeddableDashboard(), "testString"); assertEquals(uiMetaDataModel.embeddableDashboardFullWidth(), Boolean.valueOf(true)); - assertEquals(uiMetaDataModel.navigationOrder(), new java.util.ArrayList(java.util.Arrays.asList("testString"))); + assertEquals(uiMetaDataModel.navigationOrder(), java.util.Arrays.asList("testString")); assertEquals(uiMetaDataModel.notCreatable(), Boolean.valueOf(true)); assertEquals(uiMetaDataModel.primaryOfferingId(), "testString"); assertEquals(uiMetaDataModel.accessibleDuringProvision(), Boolean.valueOf(true)); diff --git a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/UIMetaMediaTest.java b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/UIMetaMediaTest.java index f865d075ca..7429e664d1 100644 --- a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/UIMetaMediaTest.java +++ b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/UIMetaMediaTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -13,7 +13,7 @@ package com.ibm.cloud.platform_services.global_catalog.v1.model; -import com.ibm.cloud.platform_services.global_catalog.v1.model.Bullets; +import com.ibm.cloud.platform_services.global_catalog.v1.model.UIMediaSourceMetaData; import com.ibm.cloud.platform_services.global_catalog.v1.model.UIMetaMedia; import com.ibm.cloud.platform_services.global_catalog.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; @@ -32,29 +32,25 @@ public class UIMetaMediaTest { @Test public void testUIMetaMedia() throws Throwable { - Bullets bulletsModel = new Bullets.Builder() - .title("testString") - .description("testString") - .icon("testString") - .quantity(Long.valueOf("26")) + UIMediaSourceMetaData uiMediaSourceMetaDataModel = new UIMediaSourceMetaData.Builder() + .type("testString") + .url("testString") .build(); - assertEquals(bulletsModel.title(), "testString"); - assertEquals(bulletsModel.description(), "testString"); - assertEquals(bulletsModel.icon(), "testString"); - assertEquals(bulletsModel.quantity(), Long.valueOf("26")); + assertEquals(uiMediaSourceMetaDataModel.type(), "testString"); + assertEquals(uiMediaSourceMetaDataModel.url(), "testString"); UIMetaMedia uiMetaMediaModel = new UIMetaMedia.Builder() .caption("testString") .thumbnailUrl("testString") .type("testString") .url("testString") - .source(bulletsModel) + .source(java.util.Arrays.asList(uiMediaSourceMetaDataModel)) .build(); assertEquals(uiMetaMediaModel.caption(), "testString"); assertEquals(uiMetaMediaModel.thumbnailUrl(), "testString"); assertEquals(uiMetaMediaModel.type(), "testString"); assertEquals(uiMetaMediaModel.url(), "testString"); - assertEquals(uiMetaMediaModel.source(), bulletsModel); + assertEquals(uiMetaMediaModel.source(), java.util.Arrays.asList(uiMediaSourceMetaDataModel)); String json = TestUtilities.serialize(uiMetaMediaModel); @@ -64,6 +60,5 @@ public void testUIMetaMedia() throws Throwable { assertEquals(uiMetaMediaModelNew.thumbnailUrl(), "testString"); assertEquals(uiMetaMediaModelNew.type(), "testString"); assertEquals(uiMetaMediaModelNew.url(), "testString"); - assertEquals(uiMetaMediaModelNew.source().toString(), bulletsModel.toString()); } } \ No newline at end of file diff --git a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/URLSTest.java b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/URLSTest.java index 8a83a0f02e..90875335aa 100644 --- a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/URLSTest.java +++ b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/URLSTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/UpdateCatalogEntryOptionsTest.java b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/UpdateCatalogEntryOptionsTest.java index 68ed70c449..48ef65a0c5 100644 --- a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/UpdateCatalogEntryOptionsTest.java +++ b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/UpdateCatalogEntryOptionsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -33,6 +33,7 @@ import com.ibm.cloud.platform_services.global_catalog.v1.model.StartingPrice; import com.ibm.cloud.platform_services.global_catalog.v1.model.Strings; import com.ibm.cloud.platform_services.global_catalog.v1.model.TemplateMetaData; +import com.ibm.cloud.platform_services.global_catalog.v1.model.UIMediaSourceMetaData; import com.ibm.cloud.platform_services.global_catalog.v1.model.UIMetaData; import com.ibm.cloud.platform_services.global_catalog.v1.model.UIMetaMedia; import com.ibm.cloud.platform_services.global_catalog.v1.model.URLS; @@ -41,8 +42,6 @@ import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import com.ibm.cloud.sdk.core.util.DateUtils; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; @@ -100,13 +99,13 @@ public void testUpdateCatalogEntryOptions() throws Throwable { .bindable(true) .asyncProvisioningSupported(true) .asyncUnprovisioningSupported(true) - .requires(new java.util.ArrayList(java.util.Arrays.asList("testString"))) + .requires(java.util.Arrays.asList("testString")) .planUpdateable(true) .state("testString") .serviceCheckEnabled(true) .testCheckInterval(Long.valueOf("26")) .serviceKeySupported(true) - .cfGuid(new java.util.HashMap() { { put("foo", "testString"); } }) + .cfGuid(java.util.Collections.singletonMap("key1", "testString")) .build(); assertEquals(cfMetaDataModel.type(), "testString"); assertEquals(cfMetaDataModel.iamCompatible(), Boolean.valueOf(true)); @@ -115,13 +114,13 @@ public void testUpdateCatalogEntryOptions() throws Throwable { assertEquals(cfMetaDataModel.bindable(), Boolean.valueOf(true)); assertEquals(cfMetaDataModel.asyncProvisioningSupported(), Boolean.valueOf(true)); assertEquals(cfMetaDataModel.asyncUnprovisioningSupported(), Boolean.valueOf(true)); - assertEquals(cfMetaDataModel.requires(), new java.util.ArrayList(java.util.Arrays.asList("testString"))); + assertEquals(cfMetaDataModel.requires(), java.util.Arrays.asList("testString")); assertEquals(cfMetaDataModel.planUpdateable(), Boolean.valueOf(true)); assertEquals(cfMetaDataModel.state(), "testString"); assertEquals(cfMetaDataModel.serviceCheckEnabled(), Boolean.valueOf(true)); assertEquals(cfMetaDataModel.testCheckInterval(), Long.valueOf("26")); assertEquals(cfMetaDataModel.serviceKeySupported(), Boolean.valueOf(true)); - assertEquals(cfMetaDataModel.cfGuid(), new java.util.HashMap() { { put("foo", "testString"); } }); + assertEquals(cfMetaDataModel.cfGuid(), java.util.Collections.singletonMap("key1", "testString")); PlanMetaData planMetaDataModel = new PlanMetaData.Builder() .bindable(true) @@ -132,7 +131,7 @@ public void testUpdateCatalogEntryOptions() throws Throwable { .testCheckInterval(Long.valueOf("26")) .singleScopeInstance("testString") .serviceCheckEnabled(true) - .cfGuid(new java.util.HashMap() { { put("foo", "testString"); } }) + .cfGuid(java.util.Collections.singletonMap("key1", "testString")) .build(); assertEquals(planMetaDataModel.bindable(), Boolean.valueOf(true)); assertEquals(planMetaDataModel.reservable(), Boolean.valueOf(true)); @@ -142,7 +141,7 @@ public void testUpdateCatalogEntryOptions() throws Throwable { assertEquals(planMetaDataModel.testCheckInterval(), Long.valueOf("26")); assertEquals(planMetaDataModel.singleScopeInstance(), "testString"); assertEquals(planMetaDataModel.serviceCheckEnabled(), Boolean.valueOf(true)); - assertEquals(planMetaDataModel.cfGuid(), new java.util.HashMap() { { put("foo", "testString"); } }); + assertEquals(planMetaDataModel.cfGuid(), java.util.Collections.singletonMap("key1", "testString")); AliasMetaData aliasMetaDataModel = new AliasMetaData.Builder() .type("testString") @@ -161,7 +160,7 @@ public void testUpdateCatalogEntryOptions() throws Throwable { assertEquals(sourceMetaDataModel.url(), "testString"); TemplateMetaData templateMetaDataModel = new TemplateMetaData.Builder() - .services(new java.util.ArrayList(java.util.Arrays.asList("testString"))) + .services(java.util.Arrays.asList("testString")) .defaultMemory(Long.valueOf("26")) .startCmd("testString") .source(sourceMetaDataModel) @@ -170,9 +169,9 @@ public void testUpdateCatalogEntryOptions() throws Throwable { .templateId("testString") .executableFile("testString") .buildpack("testString") - .environmentVariables(new java.util.HashMap() { { put("foo", "testString"); } }) + .environmentVariables(java.util.Collections.singletonMap("key1", "testString")) .build(); - assertEquals(templateMetaDataModel.services(), new java.util.ArrayList(java.util.Arrays.asList("testString"))); + assertEquals(templateMetaDataModel.services(), java.util.Arrays.asList("testString")); assertEquals(templateMetaDataModel.defaultMemory(), Long.valueOf("26")); assertEquals(templateMetaDataModel.startCmd(), "testString"); assertEquals(templateMetaDataModel.source(), sourceMetaDataModel); @@ -181,7 +180,7 @@ public void testUpdateCatalogEntryOptions() throws Throwable { assertEquals(templateMetaDataModel.templateId(), "testString"); assertEquals(templateMetaDataModel.executableFile(), "testString"); assertEquals(templateMetaDataModel.buildpack(), "testString"); - assertEquals(templateMetaDataModel.environmentVariables(), new java.util.HashMap() { { put("foo", "testString"); } }); + assertEquals(templateMetaDataModel.environmentVariables(), java.util.Collections.singletonMap("key1", "testString")); Bullets bulletsModel = new Bullets.Builder() .title("testString") @@ -194,30 +193,37 @@ public void testUpdateCatalogEntryOptions() throws Throwable { assertEquals(bulletsModel.icon(), "testString"); assertEquals(bulletsModel.quantity(), Long.valueOf("26")); + UIMediaSourceMetaData uiMediaSourceMetaDataModel = new UIMediaSourceMetaData.Builder() + .type("testString") + .url("testString") + .build(); + assertEquals(uiMediaSourceMetaDataModel.type(), "testString"); + assertEquals(uiMediaSourceMetaDataModel.url(), "testString"); + UIMetaMedia uiMetaMediaModel = new UIMetaMedia.Builder() .caption("testString") .thumbnailUrl("testString") .type("testString") .url("testString") - .source(bulletsModel) + .source(java.util.Arrays.asList(uiMediaSourceMetaDataModel)) .build(); assertEquals(uiMetaMediaModel.caption(), "testString"); assertEquals(uiMetaMediaModel.thumbnailUrl(), "testString"); assertEquals(uiMetaMediaModel.type(), "testString"); assertEquals(uiMetaMediaModel.url(), "testString"); - assertEquals(uiMetaMediaModel.source(), bulletsModel); + assertEquals(uiMetaMediaModel.source(), java.util.Arrays.asList(uiMediaSourceMetaDataModel)); Strings stringsModel = new Strings.Builder() - .bullets(new java.util.ArrayList(java.util.Arrays.asList(bulletsModel))) - .media(new java.util.ArrayList(java.util.Arrays.asList(uiMetaMediaModel))) + .bullets(java.util.Arrays.asList(bulletsModel)) + .media(java.util.Arrays.asList(uiMetaMediaModel)) .notCreatableMsg("testString") .notCreatableRobotMsg("testString") .deprecationWarning("testString") .popupWarningMessage("testString") .instruction("testString") .build(); - assertEquals(stringsModel.bullets(), new java.util.ArrayList(java.util.Arrays.asList(bulletsModel))); - assertEquals(stringsModel.media(), new java.util.ArrayList(java.util.Arrays.asList(uiMetaMediaModel))); + assertEquals(stringsModel.bullets(), java.util.Arrays.asList(bulletsModel)); + assertEquals(stringsModel.media(), java.util.Arrays.asList(uiMetaMediaModel)); assertEquals(stringsModel.notCreatableMsg(), "testString"); assertEquals(stringsModel.notCreatableRobotMsg(), "testString"); assertEquals(stringsModel.deprecationWarning(), "testString"); @@ -252,11 +258,11 @@ public void testUpdateCatalogEntryOptions() throws Throwable { assertEquals(urlsModel.apidocsurl(), "testString"); UIMetaData uiMetaDataModel = new UIMetaData.Builder() - .strings(new java.util.HashMap() { { put("foo", stringsModel); } }) + .strings(java.util.Collections.singletonMap("key1", stringsModel)) .urls(urlsModel) .embeddableDashboard("testString") .embeddableDashboardFullWidth(true) - .navigationOrder(new java.util.ArrayList(java.util.Arrays.asList("testString"))) + .navigationOrder(java.util.Arrays.asList("testString")) .notCreatable(true) .primaryOfferingId("testString") .accessibleDuringProvision(true) @@ -266,11 +272,11 @@ public void testUpdateCatalogEntryOptions() throws Throwable { .hideLiteMetering(true) .noUpgradeNextStep(true) .build(); - assertEquals(uiMetaDataModel.strings(), new java.util.HashMap() { { put("foo", stringsModel); } }); + assertEquals(uiMetaDataModel.strings(), java.util.Collections.singletonMap("key1", stringsModel)); assertEquals(uiMetaDataModel.urls(), urlsModel); assertEquals(uiMetaDataModel.embeddableDashboard(), "testString"); assertEquals(uiMetaDataModel.embeddableDashboardFullWidth(), Boolean.valueOf(true)); - assertEquals(uiMetaDataModel.navigationOrder(), new java.util.ArrayList(java.util.Arrays.asList("testString"))); + assertEquals(uiMetaDataModel.navigationOrder(), java.util.Arrays.asList("testString")); assertEquals(uiMetaDataModel.notCreatable(), Boolean.valueOf(true)); assertEquals(uiMetaDataModel.primaryOfferingId(), "testString"); assertEquals(uiMetaDataModel.accessibleDuringProvision(), Boolean.valueOf(true)); @@ -290,14 +296,14 @@ public void testUpdateCatalogEntryOptions() throws Throwable { SLAMetaData slaMetaDataModel = new SLAMetaData.Builder() .terms("testString") .tenancy("testString") - .provisioning("testString") - .responsiveness("testString") + .provisioning(Double.valueOf("72.5")) + .responsiveness(Double.valueOf("72.5")) .dr(drMetaDataModel) .build(); assertEquals(slaMetaDataModel.terms(), "testString"); assertEquals(slaMetaDataModel.tenancy(), "testString"); - assertEquals(slaMetaDataModel.provisioning(), "testString"); - assertEquals(slaMetaDataModel.responsiveness(), "testString"); + assertEquals(slaMetaDataModel.provisioning(), Double.valueOf("72.5")); + assertEquals(slaMetaDataModel.responsiveness(), Double.valueOf("72.5")); assertEquals(slaMetaDataModel.dr(), drMetaDataModel); Callbacks callbacksModel = new Callbacks.Builder() @@ -310,7 +316,7 @@ public void testUpdateCatalogEntryOptions() throws Throwable { .dashboardDetailTabExtUrl("testString") .serviceMonitorApi("testString") .serviceMonitorApp("testString") - .apiEndpoint(new java.util.HashMap() { { put("foo", "testString"); } }) + .apiEndpoint(java.util.Collections.singletonMap("key1", "testString")) .build(); assertEquals(callbacksModel.controllerUrl(), "testString"); assertEquals(callbacksModel.brokerUrl(), "testString"); @@ -321,7 +327,7 @@ public void testUpdateCatalogEntryOptions() throws Throwable { assertEquals(callbacksModel.dashboardDetailTabExtUrl(), "testString"); assertEquals(callbacksModel.serviceMonitorApi(), "testString"); assertEquals(callbacksModel.serviceMonitorApp(), "testString"); - assertEquals(callbacksModel.apiEndpoint(), new java.util.HashMap() { { put("foo", "testString"); } }); + assertEquals(callbacksModel.apiEndpoint(), java.util.Collections.singletonMap("key1", "testString")); Price priceModel = new Price.Builder() .quantityTier(Long.valueOf("26")) @@ -333,22 +339,22 @@ public void testUpdateCatalogEntryOptions() throws Throwable { Amount amountModel = new Amount.Builder() .country("testString") .currency("testString") - .prices(new java.util.ArrayList(java.util.Arrays.asList(priceModel))) + .prices(java.util.Arrays.asList(priceModel)) .build(); assertEquals(amountModel.country(), "testString"); assertEquals(amountModel.currency(), "testString"); - assertEquals(amountModel.prices(), new java.util.ArrayList(java.util.Arrays.asList(priceModel))); + assertEquals(amountModel.prices(), java.util.Arrays.asList(priceModel)); StartingPrice startingPriceModel = new StartingPrice.Builder() .planId("testString") .deploymentId("testString") .unit("testString") - .amount(new java.util.ArrayList(java.util.Arrays.asList(amountModel))) + .amount(java.util.Arrays.asList(amountModel)) .build(); assertEquals(startingPriceModel.planId(), "testString"); assertEquals(startingPriceModel.deploymentId(), "testString"); assertEquals(startingPriceModel.unit(), "testString"); - assertEquals(startingPriceModel.amount(), new java.util.ArrayList(java.util.Arrays.asList(amountModel))); + assertEquals(startingPriceModel.amount(), java.util.Arrays.asList(amountModel)); PricingSet pricingSetModel = new PricingSet.Builder() .type("testString") @@ -394,12 +400,12 @@ public void testUpdateCatalogEntryOptions() throws Throwable { .alias(aliasMetaDataModel) .template(templateMetaDataModel) .ui(uiMetaDataModel) - .compliance(new java.util.ArrayList(java.util.Arrays.asList("testString"))) + .compliance(java.util.Arrays.asList("testString")) .sla(slaMetaDataModel) .callbacks(callbacksModel) .originalName("testString") .version("testString") - .other(new java.util.HashMap() { { put("foo", "testString"); } }) + .other(java.util.Collections.singletonMap("anyKey", "anyValue")) .pricing(pricingSetModel) .deployment(deploymentBaseModel) .build(); @@ -409,12 +415,12 @@ public void testUpdateCatalogEntryOptions() throws Throwable { assertEquals(objectMetadataSetModel.alias(), aliasMetaDataModel); assertEquals(objectMetadataSetModel.template(), templateMetaDataModel); assertEquals(objectMetadataSetModel.ui(), uiMetaDataModel); - assertEquals(objectMetadataSetModel.compliance(), new java.util.ArrayList(java.util.Arrays.asList("testString"))); + assertEquals(objectMetadataSetModel.compliance(), java.util.Arrays.asList("testString")); assertEquals(objectMetadataSetModel.sla(), slaMetaDataModel); assertEquals(objectMetadataSetModel.callbacks(), callbacksModel); assertEquals(objectMetadataSetModel.originalName(), "testString"); assertEquals(objectMetadataSetModel.version(), "testString"); - assertEquals(objectMetadataSetModel.other(), new java.util.HashMap() { { put("foo", "testString"); } }); + assertEquals(objectMetadataSetModel.other(), java.util.Collections.singletonMap("anyKey", "anyValue")); assertEquals(objectMetadataSetModel.pricing(), pricingSetModel); assertEquals(objectMetadataSetModel.deployment(), deploymentBaseModel); @@ -422,14 +428,15 @@ public void testUpdateCatalogEntryOptions() throws Throwable { .id("testString") .name("testString") .kind("service") - .overviewUi(new java.util.HashMap() { { put("foo", overviewModel); } }) + .overviewUi(java.util.Collections.singletonMap("key1", overviewModel)) .images(imageModel) .disabled(true) - .tags(new java.util.ArrayList(java.util.Arrays.asList("testString"))) + .tags(java.util.Arrays.asList("testString")) .provider(providerModel) .parentId("testString") .group(true) .active(true) + .url("testString") .metadata(objectMetadataSetModel) .account("testString") .move("testString") @@ -437,14 +444,15 @@ public void testUpdateCatalogEntryOptions() throws Throwable { assertEquals(updateCatalogEntryOptionsModel.id(), "testString"); assertEquals(updateCatalogEntryOptionsModel.name(), "testString"); assertEquals(updateCatalogEntryOptionsModel.kind(), "service"); - assertEquals(updateCatalogEntryOptionsModel.overviewUi(), new java.util.HashMap() { { put("foo", overviewModel); } }); + assertEquals(updateCatalogEntryOptionsModel.overviewUi(), java.util.Collections.singletonMap("key1", overviewModel)); assertEquals(updateCatalogEntryOptionsModel.images(), imageModel); assertEquals(updateCatalogEntryOptionsModel.disabled(), Boolean.valueOf(true)); - assertEquals(updateCatalogEntryOptionsModel.tags(), new java.util.ArrayList(java.util.Arrays.asList("testString"))); + assertEquals(updateCatalogEntryOptionsModel.tags(), java.util.Arrays.asList("testString")); assertEquals(updateCatalogEntryOptionsModel.provider(), providerModel); assertEquals(updateCatalogEntryOptionsModel.parentId(), "testString"); assertEquals(updateCatalogEntryOptionsModel.group(), Boolean.valueOf(true)); assertEquals(updateCatalogEntryOptionsModel.active(), Boolean.valueOf(true)); + assertEquals(updateCatalogEntryOptionsModel.url(), "testString"); assertEquals(updateCatalogEntryOptionsModel.metadata(), objectMetadataSetModel); assertEquals(updateCatalogEntryOptionsModel.account(), "testString"); assertEquals(updateCatalogEntryOptionsModel.move(), "testString"); diff --git a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/UpdateVisibilityOptionsTest.java b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/UpdateVisibilityOptionsTest.java index 3de9b4aa24..50683d6297 100644 --- a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/UpdateVisibilityOptionsTest.java +++ b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/UpdateVisibilityOptionsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/UploadArtifactOptionsTest.java b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/UploadArtifactOptionsTest.java index fa7fccda58..ba0ef5b592 100644 --- a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/UploadArtifactOptionsTest.java +++ b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/UploadArtifactOptionsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/VisibilityDetailAccountsTest.java b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/VisibilityDetailAccountsTest.java index c4d5c643d7..19d7c61c37 100644 --- a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/VisibilityDetailAccountsTest.java +++ b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/VisibilityDetailAccountsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/VisibilityDetailTest.java b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/VisibilityDetailTest.java index 6c0861c386..531797e959 100644 --- a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/VisibilityDetailTest.java +++ b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/VisibilityDetailTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/VisibilityTest.java b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/VisibilityTest.java index 5fca0ac0e0..de90385061 100644 --- a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/VisibilityTest.java +++ b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/model/VisibilityTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at diff --git a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/utils/TestUtilities.java b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/utils/TestUtilities.java index b6eafee6a4..c46e11cb4a 100644 --- a/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/utils/TestUtilities.java +++ b/modules/global-catalog/src/test/java/com/ibm/cloud/platform_services/global_catalog/v1/utils/TestUtilities.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -10,8 +10,10 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ + package com.ibm.cloud.platform_services.global_catalog.v1.utils; +import java.util.Base64; import java.util.Map; import java.util.Set; import java.util.List; @@ -115,8 +117,8 @@ public static List creatMockListFileWithMetadata() { return list; } - public static byte[] createMockByteArray(String bytes) { - return bytes.getBytes(); + public static byte[] createMockByteArray(String encodedString) throws Exception { + return Base64.getDecoder().decode(encodedString); } public static Date createMockDate(String date) throws Exception { From db8ac030f1b71ab16400f65b010b9cc44d126c00 Mon Sep 17 00:00:00 2001 From: Ben Buchanan Date: Thu, 13 Mar 2025 15:38:06 -0400 Subject: [PATCH 2/2] fix: add pricing test back Signed-off-by: Ben Buchanan --- .../v1/GlobalCatalogExamples.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/modules/examples/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/GlobalCatalogExamples.java b/modules/examples/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/GlobalCatalogExamples.java index 6ab2fb7add..45f480f980 100644 --- a/modules/examples/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/GlobalCatalogExamples.java +++ b/modules/examples/src/main/java/com/ibm/cloud/platform_services/global_catalog/v1/GlobalCatalogExamples.java @@ -35,12 +35,14 @@ import com.ibm.cloud.platform_services.global_catalog.v1.model.GetAuditLogsOptions; import com.ibm.cloud.platform_services.global_catalog.v1.model.GetCatalogEntryOptions; import com.ibm.cloud.platform_services.global_catalog.v1.model.GetChildObjectsOptions; +import com.ibm.cloud.platform_services.global_catalog.v1.model.GetPricingOptions; import com.ibm.cloud.platform_services.global_catalog.v1.model.GetVisibilityOptions; import com.ibm.cloud.platform_services.global_catalog.v1.model.Image; import com.ibm.cloud.platform_services.global_catalog.v1.model.ListArtifactsOptions; import com.ibm.cloud.platform_services.global_catalog.v1.model.ListCatalogEntriesOptions; import com.ibm.cloud.platform_services.global_catalog.v1.model.ObjectMetadataSet; import com.ibm.cloud.platform_services.global_catalog.v1.model.Overview; +import com.ibm.cloud.platform_services.global_catalog.v1.model.PricingGet; import com.ibm.cloud.platform_services.global_catalog.v1.model.Provider; import com.ibm.cloud.platform_services.global_catalog.v1.model.RestoreCatalogEntryOptions; import com.ibm.cloud.platform_services.global_catalog.v1.model.UpdateCatalogEntryOptions; @@ -325,6 +327,28 @@ public static void main(String[] args) throws Exception { System.out.println("updateVisibility returned the following error: " + e.getMessage()); } + + try { + System.out.println("getPricing() result:"); + + // begin-get_pricing + + GetPricingOptions getPricingOptions = new GetPricingOptions.Builder() + .id(catalogEntryId).build(); + + Response response = service.getPricing(getPricingOptions).execute(); + PricingGet pricingGet = response.getResult(); + + System.out.println(pricingGet); + + // end-get_pricing + + } catch (ServiceResponseException e) { + logger.error(String.format("Service returned status code %s: %s\nError details: %s", e.getStatusCode(), + e.getMessage(), e.getDebuggingInfo()), e); + } + + try { System.out.println("getAuditLogs() result:");