From a76df577c92f45595ec21808e13afbb5412f9e06 Mon Sep 17 00:00:00 2001 From: lakshanss Date: Fri, 21 Apr 2023 09:42:49 +0530 Subject: [PATCH] Fix compile time warnings --- cosmosdb/tests/test.bal | 1 - cosmosdb/types.bal | 1 + cosmosdb/utils.bal | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cosmosdb/tests/test.bal b/cosmosdb/tests/test.bal index bd8619c4..a538c90e 100644 --- a/cosmosdb/tests/test.bal +++ b/cosmosdb/tests/test.bal @@ -489,7 +489,6 @@ function testGetDocumentList() returns error? { stream result = check azureCosmosClient->getDocumentList(databaseId, containerId, valueOfPartitionKey); check result.forEach(isolated function(Person queryResult) { - test:assertTrue(queryResult is Person); test:assertEquals(1234, queryResult.AccountNumber); }); } diff --git a/cosmosdb/types.bal b/cosmosdb/types.bal index 749cb869..3bbe3246 100644 --- a/cosmosdb/types.bal +++ b/cosmosdb/types.bal @@ -21,6 +21,7 @@ import ballerinax/'client.config; @display {label: "Connection Config"} public type ManagementClientConfig record {| *config:ConnectionConfig; + # Excluded auth configurations (Provide primaryKey or ResourceToken instead) never auth?; # Base URL of the Azure Cosmos DB account string baseUrl; diff --git a/cosmosdb/utils.bal b/cosmosdb/utils.bal index 00932c66..0c9d488a 100644 --- a/cosmosdb/utils.bal +++ b/cosmosdb/utils.bal @@ -40,7 +40,7 @@ isolated function getTokenType(string token) returns string { # + url - The Base URL given by the user from which we want to extract host # + return - String representing the resource id isolated function getHost(string url) returns string { - string replacedString = regex:replaceFirst(url, HTTPS_REGEX, EMPTY_STRING); + string replacedString = regex:replace(url, HTTPS_REGEX, EMPTY_STRING); int? lastIndex = replacedString.lastIndexOf(FORWARD_SLASH); if (lastIndex is int) { replacedString = replacedString.substring(0, lastIndex);