diff --git a/cosmosdb/tests/test.bal b/cosmosdb/tests/test.bal index bd8619c..a538c90 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 749cb86..3bbe324 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 00932c6..0c9d488 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);