From 75ce98d8c365deb4b4a4d06ecee1a04241165f94 Mon Sep 17 00:00:00 2001 From: chashikajw Date: Wed, 11 Oct 2023 14:41:15 +0530 Subject: [PATCH] Fix unit tests --- .../backoffice-domain-service/ballerina/Dependencies.toml | 2 +- backoffice/backoffice-domain-service/ballerina/types.bal | 8 ++++---- .../devportal-domain-service/ballerina/Dependencies.toml | 2 +- .../devportal-domain-service/ballerina/tests/apiTests.bal | 2 ++ devportal/devportal-domain-service/ballerina/types.bal | 2 +- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/backoffice/backoffice-domain-service/ballerina/Dependencies.toml b/backoffice/backoffice-domain-service/ballerina/Dependencies.toml index 418ee5d3d..74b4bd9c7 100644 --- a/backoffice/backoffice-domain-service/ballerina/Dependencies.toml +++ b/backoffice/backoffice-domain-service/ballerina/Dependencies.toml @@ -80,7 +80,7 @@ dependencies = [ [[package]] org = "ballerina" name = "http" -version = "2.10.1" +version = "2.10.2" dependencies = [ {org = "ballerina", name = "auth"}, {org = "ballerina", name = "cache"}, diff --git a/backoffice/backoffice-domain-service/ballerina/types.bal b/backoffice/backoffice-domain-service/ballerina/types.bal index 6fbe54a0b..13427813f 100644 --- a/backoffice/backoffice-domain-service/ballerina/types.bal +++ b/backoffice/backoffice-domain-service/ballerina/types.bal @@ -74,15 +74,15 @@ public type Document record { string documentId?; @constraint:String {maxLength: 60, minLength: 1} string name; - "HOWTO"|"SAMPLES"|"PUBLIC_FORUM"|"SUPPORT_FORUM"|"API_MESSAGE_FORMAT"|"SWAGGER_DOC"|"OTHER" documentType?; + string documentType?; @constraint:String {maxLength: 32766, minLength: 1} string summary?; - "INLINE"|"MARKDOWN"|"URL"|"FILE" sourceType; + string sourceType; string sourceUrl?; string fileName?; string inlineContent?; string otherTypeName?; - "OWNER_ONLY"|"PRIVATE"|"API_LEVEL" visibility; + string visibility; string createdTime?; string createdBy?; string lastUpdatedTime?; @@ -229,7 +229,7 @@ public type MonetizationAttribute record { }; public type APIDefinition record { - "swagger"|"graphql"|"wsdl"|"async" 'type; + string 'type; string schemaDefinition?; }; diff --git a/devportal/devportal-domain-service/ballerina/Dependencies.toml b/devportal/devportal-domain-service/ballerina/Dependencies.toml index 44d7d0eb7..0295362e0 100644 --- a/devportal/devportal-domain-service/ballerina/Dependencies.toml +++ b/devportal/devportal-domain-service/ballerina/Dependencies.toml @@ -86,7 +86,7 @@ dependencies = [ [[package]] org = "ballerina" name = "http" -version = "2.10.1" +version = "2.10.2" dependencies = [ {org = "ballerina", name = "auth"}, {org = "ballerina", name = "cache"}, diff --git a/devportal/devportal-domain-service/ballerina/tests/apiTests.bal b/devportal/devportal-domain-service/ballerina/tests/apiTests.bal index 5567540ad..ad235f51b 100644 --- a/devportal/devportal-domain-service/ballerina/tests/apiTests.bal +++ b/devportal/devportal-domain-service/ballerina/tests/apiTests.bal @@ -188,6 +188,7 @@ function getAPIDefinitionByIdTest(){ if apiDefResponse is APIDefinition { test:assertTrue(true, "Successfully retrieved API Definition"); } else if apiDefResponse is commons:APKError { + log:printInfo(apiDefResponse.toBalString()); log:printError(apiDefResponse.toString()); test:assertFail("Error occured while retrieving API"); } else if apiDefResponse is NotFoundError { @@ -223,6 +224,7 @@ function generateSDKImplTestNegative(){ if sdk is http:Response { test:assertFail("Successfully generated API SDK"); } else if sdk is sdk:APIClientGenerationException|commons:APKError { + log:printInfo(sdk.toBalString()); test:assertTrue(true,"Error while generating API SDK"); } } diff --git a/devportal/devportal-domain-service/ballerina/types.bal b/devportal/devportal-domain-service/ballerina/types.bal index 1fbf782c1..b65e2d54a 100644 --- a/devportal/devportal-domain-service/ballerina/types.bal +++ b/devportal/devportal-domain-service/ballerina/types.bal @@ -328,7 +328,7 @@ public type ApplicationKeyList record { }; public type APIDefinition record { - "swagger"|"graphql"|"wsdl"|"async" 'type; + string 'type; string schemaDefinition?; };