Skip to content

Commit

Permalink
fix: regen services using latest SDK generator and API definitions (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
padamstx authored Jul 10, 2020
1 parent a0dcfd5 commit 4e6680f
Show file tree
Hide file tree
Showing 66 changed files with 431 additions and 652 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ public void testGetCasesWOptions() throws Throwable {
.limit(Long.valueOf("26"))
.search("testString")
.sort("number")
.status(new ArrayList<String>(Arrays.asList("new")))
.fields(new ArrayList<String>(Arrays.asList("number")))
.status(new java.util.ArrayList<String>(java.util.Arrays.asList("new")))
.fields(new java.util.ArrayList<String>(java.util.Arrays.asList("number")))
.build();

// Invoke operation with valid options model (positive test)
Expand All @@ -157,8 +157,8 @@ public void testGetCasesWOptions() throws Throwable {
assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("26"));
assertEquals(query.get("search"), "testString");
assertEquals(query.get("sort"), "number");
assertEquals(Arrays.asList(query.get("status")), new ArrayList<String>(Arrays.asList("new")));
assertEquals(Arrays.asList(query.get("fields")), new ArrayList<String>(Arrays.asList("number")));
assertEquals(Arrays.asList(query.get("status")), new java.util.ArrayList<String>(java.util.Arrays.asList("new")));
assertEquals(Arrays.asList(query.get("fields")), new java.util.ArrayList<String>(java.util.Arrays.asList("number")));
// Check request path
String parsedPath = TestUtilities.parseReqPath(request);
assertEquals(parsedPath, getCasesPath);
Expand Down Expand Up @@ -219,8 +219,8 @@ public void testCreateCaseWOptions() throws Throwable {
.severity(Long.valueOf("1"))
.eu(casePayloadEuModel)
.offering(offeringModel)
.resources(new ArrayList<ResourcePayload>(Arrays.asList(resourcePayloadModel)))
.watchlist(new ArrayList<User>(Arrays.asList(userModel)))
.resources(new java.util.ArrayList<ResourcePayload>(java.util.Arrays.asList(resourcePayloadModel)))
.watchlist(new java.util.ArrayList<User>(java.util.Arrays.asList(userModel)))
.invoiceNumber("testString")
.slaCreditRequest(true)
.build();
Expand Down Expand Up @@ -273,7 +273,7 @@ public void testGetCaseWOptions() throws Throwable {
// Construct an instance of the GetCaseOptions model
GetCaseOptions getCaseOptionsModel = new GetCaseOptions.Builder()
.caseNumber("testString")
.fields(new ArrayList<String>(Arrays.asList("number")))
.fields(new java.util.ArrayList<String>(java.util.Arrays.asList("number")))
.build();

// Invoke operation with valid options model (positive test)
Expand All @@ -291,7 +291,7 @@ public void testGetCaseWOptions() throws Throwable {
Map<String, String> query = TestUtilities.parseQueryString(request);
assertNotNull(query);
// Get query params
assertEquals(Arrays.asList(query.get("fields")), new ArrayList<String>(Arrays.asList("number")));
assertEquals(Arrays.asList(query.get("fields")), new java.util.ArrayList<String>(java.util.Arrays.asList("number")));
// Check request path
String parsedPath = TestUtilities.parseReqPath(request);
assertEquals(parsedPath, getCasePath);
Expand Down Expand Up @@ -383,7 +383,7 @@ public void testAddCommentWOptions() throws Throwable {
// Construct an instance of the AddCommentOptions model
AddCommentOptions addCommentOptionsModel = new AddCommentOptions.Builder()
.caseNumber("testString")
.comment("testString")
.comment("This is a test comment")
.build();

// Invoke operation with valid options model (positive test)
Expand Down Expand Up @@ -440,7 +440,7 @@ public void testAddWatchlistWOptions() throws Throwable {
// Construct an instance of the AddWatchlistOptions model
AddWatchlistOptions addWatchlistOptionsModel = new AddWatchlistOptions.Builder()
.caseNumber("testString")
.watchlist(new ArrayList<User>(Arrays.asList(userModel)))
.watchlist(new java.util.ArrayList<User>(java.util.Arrays.asList(userModel)))
.build();

// Invoke operation with valid options model (positive test)
Expand Down Expand Up @@ -497,7 +497,7 @@ public void testRemoveWatchlistWOptions() throws Throwable {
// Construct an instance of the RemoveWatchlistOptions model
RemoveWatchlistOptions removeWatchlistOptionsModel = new RemoveWatchlistOptions.Builder()
.caseNumber("testString")
.watchlist(new ArrayList<User>(Arrays.asList(userModel)))
.watchlist(new java.util.ArrayList<User>(java.util.Arrays.asList(userModel)))
.build();

// Invoke operation with valid options model (positive test)
Expand Down Expand Up @@ -640,7 +640,7 @@ public void testUploadFileNoOptions() throws Throwable {
@Test
public void testDownloadFileWOptions() throws Throwable {
// Schedule some responses.
String mockResponseBody = "Contents of response byte-stream...";
String mockResponseBody = "This is a mock binary response.";
String downloadFilePath = "/cases/testString/attachments/testString";

server.enqueue(new MockResponse()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ public void testAddWatchlistOptions() throws Throwable {

AddWatchlistOptions addWatchlistOptionsModel = new AddWatchlistOptions.Builder()
.caseNumber("testString")
.watchlist(new ArrayList<User>(Arrays.asList(userModel)))
.watchlist(new java.util.ArrayList<User>(java.util.Arrays.asList(userModel)))
.build();
assertEquals(addWatchlistOptionsModel.caseNumber(), "testString");
assertEquals(addWatchlistOptionsModel.watchlist(), new ArrayList<User>(Arrays.asList(userModel)));
assertEquals(addWatchlistOptionsModel.watchlist(), new java.util.ArrayList<User>(java.util.Arrays.asList(userModel)));
}

@Test(expectedExceptions = IllegalArgumentException.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ public void testCreateCaseOptions() throws Throwable {
.severity(Long.valueOf("1"))
.eu(casePayloadEuModel)
.offering(offeringModel)
.resources(new ArrayList<ResourcePayload>(Arrays.asList(resourcePayloadModel)))
.watchlist(new ArrayList<User>(Arrays.asList(userModel)))
.resources(new java.util.ArrayList<ResourcePayload>(java.util.Arrays.asList(resourcePayloadModel)))
.watchlist(new java.util.ArrayList<User>(java.util.Arrays.asList(userModel)))
.invoiceNumber("testString")
.slaCreditRequest(true)
.build();
Expand All @@ -102,8 +102,8 @@ public void testCreateCaseOptions() throws Throwable {
assertEquals(createCaseOptionsModel.severity(), Long.valueOf("1"));
assertEquals(createCaseOptionsModel.eu(), casePayloadEuModel);
assertEquals(createCaseOptionsModel.offering(), offeringModel);
assertEquals(createCaseOptionsModel.resources(), new ArrayList<ResourcePayload>(Arrays.asList(resourcePayloadModel)));
assertEquals(createCaseOptionsModel.watchlist(), new ArrayList<User>(Arrays.asList(userModel)));
assertEquals(createCaseOptionsModel.resources(), new java.util.ArrayList<ResourcePayload>(java.util.Arrays.asList(resourcePayloadModel)));
assertEquals(createCaseOptionsModel.watchlist(), new java.util.ArrayList<User>(java.util.Arrays.asList(userModel)));
assertEquals(createCaseOptionsModel.invoiceNumber(), "testString");
assertEquals(createCaseOptionsModel.slaCreditRequest(), Boolean.valueOf(true));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ public class GetCaseOptionsTest {
public void testGetCaseOptions() throws Throwable {
GetCaseOptions getCaseOptionsModel = new GetCaseOptions.Builder()
.caseNumber("testString")
.fields(new ArrayList<String>(Arrays.asList("number")))
.fields(new java.util.ArrayList<String>(java.util.Arrays.asList("number")))
.build();
assertEquals(getCaseOptionsModel.caseNumber(), "testString");
assertEquals(getCaseOptionsModel.fields(), new ArrayList<String>(Arrays.asList("number")));
assertEquals(getCaseOptionsModel.fields(), new java.util.ArrayList<String>(java.util.Arrays.asList("number")));
}

@Test(expectedExceptions = IllegalArgumentException.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ public void testGetCasesOptions() throws Throwable {
.limit(Long.valueOf("26"))
.search("testString")
.sort("number")
.status(new ArrayList<String>(Arrays.asList("new")))
.fields(new ArrayList<String>(Arrays.asList("number")))
.status(new java.util.ArrayList<String>(java.util.Arrays.asList("new")))
.fields(new java.util.ArrayList<String>(java.util.Arrays.asList("number")))
.build();
assertEquals(getCasesOptionsModel.offset(), Long.valueOf("26"));
assertEquals(getCasesOptionsModel.limit(), Long.valueOf("26"));
assertEquals(getCasesOptionsModel.search(), "testString");
assertEquals(getCasesOptionsModel.sort(), "number");
assertEquals(getCasesOptionsModel.status(), new ArrayList<String>(Arrays.asList("new")));
assertEquals(getCasesOptionsModel.fields(), new ArrayList<String>(Arrays.asList("number")));
assertEquals(getCasesOptionsModel.status(), new java.util.ArrayList<String>(java.util.Arrays.asList("new")));
assertEquals(getCasesOptionsModel.fields(), new java.util.ArrayList<String>(java.util.Arrays.asList("number")));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ public void testRemoveWatchlistOptions() throws Throwable {

RemoveWatchlistOptions removeWatchlistOptionsModel = new RemoveWatchlistOptions.Builder()
.caseNumber("testString")
.watchlist(new ArrayList<User>(Arrays.asList(userModel)))
.watchlist(new java.util.ArrayList<User>(java.util.Arrays.asList(userModel)))
.build();
assertEquals(removeWatchlistOptionsModel.caseNumber(), "testString");
assertEquals(removeWatchlistOptionsModel.watchlist(), new ArrayList<User>(Arrays.asList(userModel)));
assertEquals(removeWatchlistOptionsModel.watchlist(), new java.util.ArrayList<User>(java.util.Arrays.asList(userModel)));
}

@Test(expectedExceptions = IllegalArgumentException.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ public void testWatchlist() throws Throwable {
assertEquals(userModel.userId(), "[email protected]");

Watchlist watchlistModel = new Watchlist.Builder()
.watchlist(new ArrayList<User>(Arrays.asList(userModel)))
.watchlist(new java.util.ArrayList<User>(java.util.Arrays.asList(userModel)))
.build();
assertEquals(watchlistModel.watchlist(), new ArrayList<User>(Arrays.asList(userModel)));
assertEquals(watchlistModel.watchlist(), new java.util.ArrayList<User>(java.util.Arrays.asList(userModel)));

String json = TestUtilities.serialize(watchlistModel);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
package com.ibm.cloud.platform_services.global_catalog.v1.model;

import java.util.List;
import java.util.Map;

import com.google.gson.annotations.SerializedName;
import com.ibm.cloud.sdk.core.service.model.GenericModel;
Expand All @@ -38,7 +39,7 @@ public interface Kind {
protected String name;
protected String kind;
@SerializedName("overview_ui")
protected OverviewUI overviewUi;
protected Map<String, Overview> overviewUi;
protected Image images;
@SerializedName("parent_id")
protected String parentId;
Expand Down Expand Up @@ -92,7 +93,7 @@ public String getKind() {
*
* @return the overviewUi
*/
public OverviewUI getOverviewUi() {
public Map<String, Overview> getOverviewUi() {
return overviewUi;
}

Expand Down Expand Up @@ -208,6 +209,8 @@ public Object getCatalogCrn() {
/**
* Gets the url.
*
* URL to get details about this object.
*
* @return the url
*/
public Object getUrl() {
Expand All @@ -217,6 +220,8 @@ public Object getUrl() {
/**
* Gets the childrenUrl.
*
* URL to get details about children of this object.
*
* @return the childrenUrl
*/
public Object getChildrenUrl() {
Expand All @@ -226,6 +231,8 @@ public Object getChildrenUrl() {
/**
* Gets the geoTags.
*
* tags to indicate the locations this service is deployable to.
*
* @return the geoTags
*/
public Object getGeoTags() {
Expand All @@ -235,6 +242,8 @@ public Object getGeoTags() {
/**
* Gets the pricingTags.
*
* tags to indicate the type of pricing plans this service supports.
*
* @return the pricingTags
*/
public Object getPricingTags() {
Expand All @@ -244,6 +253,8 @@ public Object getPricingTags() {
/**
* Gets the created.
*
* Date created.
*
* @return the created
*/
public Object getCreated() {
Expand All @@ -253,6 +264,8 @@ public Object getCreated() {
/**
* Gets the updated.
*
* Date last updated.
*
* @return the updated
*/
public Object getUpdated() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import com.ibm.cloud.sdk.core.service.model.GenericModel;

Expand All @@ -37,7 +38,7 @@ public interface Kind {

protected String name;
protected String kind;
protected OverviewUI overviewUi;
protected Map<String, Overview> overviewUi;
protected Image images;
protected Boolean disabled;
protected List<String> tags;
Expand All @@ -55,7 +56,7 @@ public interface Kind {
public static class Builder {
private String name;
private String kind;
private OverviewUI overviewUi;
private Map<String, Overview> overviewUi;
private Image images;
private Boolean disabled;
private List<String> tags;
Expand Down Expand Up @@ -101,7 +102,7 @@ public Builder() {
* @param provider the provider
* @param id the id
*/
public Builder(String name, String kind, OverviewUI overviewUi, Image images, Boolean disabled, List<String> tags, Provider provider, String id) {
public Builder(String name, String kind, Map<String, Overview> overviewUi, Image images, Boolean disabled, List<String> tags, Provider provider, String id) {
this.name = name;
this.kind = kind;
this.overviewUi = overviewUi;
Expand Down Expand Up @@ -165,7 +166,7 @@ public Builder kind(String kind) {
* @param overviewUi the overviewUi
* @return the CreateCatalogEntryOptions builder
*/
public Builder overviewUi(OverviewUI overviewUi) {
public Builder overviewUi(Map<String, Overview> overviewUi) {
this.overviewUi = overviewUi;
return this;
}
Expand Down Expand Up @@ -354,7 +355,7 @@ public String kind() {
*
* @return the overviewUi
*/
public OverviewUI overviewUi() {
public Map<String, Overview> overviewUi() {
return overviewUi;
}

Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit 4e6680f

Please sign in to comment.