diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..ef72694 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,24 @@ +# Force LF line endings for all text files on all platforms +* text=auto eol=lf + +# Java source files +*.java text eol=lf + +# Ballerina source files +*.bal text eol=lf + +# Config and build files +*.xml text eol=lf +*.json text eol=lf +*.yaml text eol=lf +*.yml text eol=lf +*.toml text eol=lf +*.properties text eol=lf +*.gradle text eol=lf + +# Shell scripts +*.sh text eol=lf + +# Windows scripts keep CRLF +*.bat text eol=crlf +*.cmd text eol=crlf diff --git a/.github/workflows/build-with-bal-test-graalvm.yml b/.github/workflows/build-with-bal-test-graalvm.yml index 4f69d4d..f2c5ece 100644 --- a/.github/workflows/build-with-bal-test-graalvm.yml +++ b/.github/workflows/build-with-bal-test-graalvm.yml @@ -1,9 +1,26 @@ name: GraalVM Check on: - schedule: - - cron: "30 18 * * *" workflow_dispatch: + inputs: + lang_tag: + description: Branch/Release Tag of the Ballerina Lang + required: true + default: master + lang_version: + description: Ballerina Lang Version (If given ballerina lang buid will be skipped) + required: false + default: '' + native_image_options: + description: Default native-image options + required: false + default: '' + pull_request: + branches: + - main + types: [ opened, synchronize, reopened, labeled, unlabeled ] + schedule: + - cron: '30 18 * * *' concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} @@ -13,5 +30,9 @@ jobs: call_stdlib_workflow: name: Run StdLib Workflow if: ${{ github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository_owner == 'ballerina-platform') }} - uses: ballerina-platform/ballerina-library/.github/workflows/build-with-bal-test-graalvm-connector-template.yml@main - secrets: inherit + uses: ballerina-platform/ballerina-library/.github/workflows/build-with-bal-test-graalvm-template.yml@main + with: + lang_tag: ${{ inputs.lang_tag }} + lang_version: ${{ inputs.lang_version }} + native_image_options: '-J-Xmx7G ${{ inputs.native_image_options }}' + additional_windows_build_flags: '-x test' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1e56a9b..34ef2cf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,9 +10,7 @@ on: jobs: call_workflow: - name: Run Connector Build Workflow + name: Run Build Workflow if: ${{ github.repository_owner == 'ballerina-platform' }} - uses: ballerina-platform/ballerina-library/.github/workflows/build-connector-template.yml@main + uses: ballerina-platform/ballerina-library/.github/workflows/build-timestamp-master-template.yml@main secrets: inherit - with: - repo-name: module-ballerinax-wso2.apim.catalog diff --git a/.github/workflows/daily-build.yml b/.github/workflows/daily-build.yml index 6e457a0..7ecdb15 100644 --- a/.github/workflows/daily-build.yml +++ b/.github/workflows/daily-build.yml @@ -5,10 +5,45 @@ on: - cron: "30 2 * * *" jobs: - call_workflow: - name: Run Daily Build Workflow + build: + name: Daily Build + runs-on: ubuntu-22.04 if: ${{ github.repository_owner == 'ballerina-platform' }} - uses: ballerina-platform/ballerina-library/.github/workflows/daily-build-connector-template.yml@main - secrets: inherit - with: - repo-name: module-ballerinax-wso2.apim.catalog + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + + - name: Set ENV Variables + run: | + echo "packageUser=${{ secrets.BALLERINA_BOT_USERNAME }}" >> $GITHUB_ENV + echo "packagePAT=${{ secrets.BALLERINA_BOT_TOKEN }}" >> $GITHUB_ENV + + - name: Set up JDK 21 + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '21.0.3' + + - name: Set up Ballerina + uses: ballerina-platform/setup-ballerina@v1.1.3 + with: + version: 2201.13.1 + + - name: Build the Package + run: ./gradlew build -x test + + - name: Run Tests + run: ./gradlew test + + - name: Notify Build Failure + if: ${{ failure() }} + run: | + curl -X POST \ + -H "Accept: application/vnd.github.v3+json" \ + -H "Authorization: token ${{ secrets.BALLERINA_BOT_TOKEN }}" \ + https://api.github.com/repos/ballerina-platform/ballerina-release/dispatches \ + -d '{"event_type": "notify-build-failure", "client_payload": {"repoName": "module-ballerinax-wso2.apim.catalog"}}' diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 47662b5..5cca270 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -10,5 +10,7 @@ jobs: call_workflow: name: Run PR Build Workflow if: ${{ github.repository_owner == 'ballerina-platform' }} - uses: ballerina-platform/ballerina-library/.github/workflows/pr-build-connector-template.yml@main + uses: ballerina-platform/ballerina-library/.github/workflows/pull-request-build-template.yml@main secrets: inherit + with: + additional-windows-test-flags: "-x test" diff --git a/ballerina-tests/Ballerina.toml b/ballerina-tests/Ballerina.toml index c097545..94bfadf 100644 --- a/ballerina-tests/Ballerina.toml +++ b/ballerina-tests/Ballerina.toml @@ -1,12 +1,12 @@ [package] org = "ballerinax" name = "apim_catalog_tests" -version = "1.1.0" +version = "1.2.0" [[dependency]] org = "ballerinax" name = "wso2.apim.catalog" -version = "1.1.0" +version = "1.2.0" repository="local" [build-options] @@ -18,5 +18,5 @@ graalvmCompatible = true [[platform.java21.dependency]] groupId = "io.ballerina" artifactId = "wso2.apim.catalog-native" -version = "1.1.0" -path = "../native/build/libs/wso2.apim.catalog-native-1.1.0-SNAPSHOT.jar" +version = "1.2.0" +path = "../native/build/libs/wso2.apim.catalog-native-1.2.0-SNAPSHOT.jar" diff --git a/ballerina-tests/Dependencies.toml b/ballerina-tests/Dependencies.toml index 179b1ce..68e0710 100644 --- a/ballerina-tests/Dependencies.toml +++ b/ballerina-tests/Dependencies.toml @@ -5,7 +5,7 @@ [ballerina] dependencies-toml-version = "2" -distribution-version = "2201.12.0" +distribution-version = "2201.13.1" [[package]] org = "ballerina" @@ -47,7 +47,7 @@ modules = [ [[package]] org = "ballerina" name = "crypto" -version = "2.9.0" +version = "2.10.1" scope = "testOnly" dependencies = [ {org = "ballerina", name = "jballerina.java"}, @@ -57,7 +57,7 @@ dependencies = [ [[package]] org = "ballerina" name = "data.jsondata" -version = "1.1.0" +version = "1.1.3" scope = "testOnly" dependencies = [ {org = "ballerina", name = "jballerina.java"}, @@ -82,7 +82,7 @@ modules = [ [[package]] org = "ballerina" name = "http" -version = "2.14.0" +version = "2.15.4" scope = "testOnly" dependencies = [ {org = "ballerina", name = "auth"}, @@ -135,7 +135,7 @@ scope = "testOnly" [[package]] org = "ballerina" name = "jwt" -version = "2.15.0" +version = "2.15.1" scope = "testOnly" dependencies = [ {org = "ballerina", name = "cache"}, @@ -220,6 +220,9 @@ scope = "testOnly" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] +modules = [ + {org = "ballerina", packageName = "lang.runtime", moduleName = "lang.runtime"} +] [[package]] org = "ballerina" @@ -243,7 +246,7 @@ dependencies = [ [[package]] org = "ballerina" name = "log" -version = "2.12.0" +version = "2.16.1" scope = "testOnly" dependencies = [ {org = "ballerina", name = "io"}, @@ -258,7 +261,7 @@ modules = [ [[package]] org = "ballerina" name = "mime" -version = "2.12.0" +version = "2.12.1" scope = "testOnly" dependencies = [ {org = "ballerina", name = "io"}, @@ -273,7 +276,7 @@ modules = [ [[package]] org = "ballerina" name = "oauth2" -version = "2.14.0" +version = "2.15.0" scope = "testOnly" dependencies = [ {org = "ballerina", name = "cache"}, @@ -287,7 +290,7 @@ dependencies = [ [[package]] org = "ballerina" name = "observe" -version = "1.5.0" +version = "1.7.1" scope = "testOnly" dependencies = [ {org = "ballerina", name = "jballerina.java"} @@ -296,7 +299,7 @@ dependencies = [ [[package]] org = "ballerina" name = "os" -version = "1.10.0" +version = "1.10.1" scope = "testOnly" dependencies = [ {org = "ballerina", name = "io"}, @@ -309,11 +312,12 @@ modules = [ [[package]] org = "ballerina" name = "task" -version = "2.7.0" +version = "2.11.1" scope = "testOnly" dependencies = [ {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "time"} + {org = "ballerina", name = "time"}, + {org = "ballerina", name = "uuid"} ] [[package]] @@ -333,7 +337,7 @@ modules = [ [[package]] org = "ballerina" name = "time" -version = "2.7.0" +version = "2.8.0" scope = "testOnly" dependencies = [ {org = "ballerina", name = "jballerina.java"} @@ -342,21 +346,34 @@ dependencies = [ [[package]] org = "ballerina" name = "url" -version = "2.6.0" +version = "2.6.1" scope = "testOnly" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] +[[package]] +org = "ballerina" +name = "uuid" +version = "1.10.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.int"}, + {org = "ballerina", name = "time"} +] + [[package]] org = "ballerinax" name = "apim_catalog_tests" -version = "1.1.0" +version = "1.2.0" dependencies = [ {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "file"}, {org = "ballerina", name = "http"}, {org = "ballerina", name = "io"}, + {org = "ballerina", name = "lang.runtime"}, {org = "ballerina", name = "log"}, {org = "ballerina", name = "mime"}, {org = "ballerina", name = "os"}, diff --git a/ballerina-tests/build.gradle b/ballerina-tests/build.gradle index 2cc552d..a9cefc5 100644 --- a/ballerina-tests/build.gradle +++ b/ballerina-tests/build.gradle @@ -92,6 +92,36 @@ task initializeVariables { def ballerinaPackagePath = "ballerina" +// --------------------------------------------------------------------------- +// Build Docker images for the mock catalog API server and the OAuth2 token +// server. Both images are built from standalone Ballerina programs under +// ballerina-tests/mock-server/ and ballerina-tests/token-server/. +// The images are used by the test suite to spin up one container per port. +// --------------------------------------------------------------------------- + +task buildMockServerDockerImage { + doLast { + exec { + workingDir "${project.projectDir}/mock-server" + commandLine 'docker', 'build', '-t', 'ballerinax/apim-catalog-mock-server:latest', '.' + } + } +} + +task buildTokenServerDockerImage { + doLast { + exec { + workingDir "${project.projectDir}/token-server" + commandLine 'docker', 'build', '-t', 'ballerinax/apim-catalog-token-server:latest', '.' + } + } +} + +task buildDockerImages { + dependsOn(buildMockServerDockerImage) + dependsOn(buildTokenServerDockerImage) +} + task publishTestResourcePackageToLocal { dependsOn("::${packageName}-ballerina:build") doLast { @@ -121,6 +151,7 @@ task ballerinaTest { dependsOn(updateTomlVerions) dependsOn(initializeVariables) dependsOn(publishTestResourcePackageToLocal) + dependsOn(buildDockerImages) finalizedBy(commitTomlFiles) doLast { diff --git a/ballerina-tests/mock-server/Ballerina.toml b/ballerina-tests/mock-server/Ballerina.toml new file mode 100644 index 0000000..8059e9f --- /dev/null +++ b/ballerina-tests/mock-server/Ballerina.toml @@ -0,0 +1,5 @@ +[package] +org = "ballerinax" +name = "apim_catalog_mock_server" +version = "1.0.0" +distribution = "2201.13.1" diff --git a/ballerina-tests/mock-server/Dockerfile b/ballerina-tests/mock-server/Dockerfile new file mode 100644 index 0000000..27c112a --- /dev/null +++ b/ballerina-tests/mock-server/Dockerfile @@ -0,0 +1,35 @@ +# Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com). +# +# WSO2 LLC. licenses this file to you 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. + +# Stage 1: Build the Ballerina fat JAR +FROM ballerina/ballerina:2201.13.1 AS builder +WORKDIR /app +COPY . . +RUN bal build + +# Stage 2: Minimal runtime image +FROM eclipse-temurin:21-jre +WORKDIR /app +COPY --from=builder /app/target/bin/apim_catalog_mock_server.jar /app/mock-server.jar + +ENV PORT=8080 +ENV ARTIFACT_INDEX=0 +ENV UNAUTHORIZED=false +ENV OUTPUT_DIR=/artifacts + +EXPOSE ${PORT} + +ENTRYPOINT ["java", "-jar", "/app/mock-server.jar"] diff --git a/ballerina-tests/mock-server/main.bal b/ballerina-tests/mock-server/main.bal new file mode 100644 index 0000000..3030175 --- /dev/null +++ b/ballerina-tests/mock-server/main.bal @@ -0,0 +1,116 @@ +// Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com). +// +// WSO2 LLC. licenses this file to you 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. + +import ballerina/http; +import ballerina/io; +import ballerina/lang.runtime; +import ballerina/log; +import ballerina/mime; +import ballerina/os; + +type ServiceItem record { + string id?; + string name; + string description?; + string version; + string serviceKey?; + string serviceUrl; + string definitionType; + string securityType = "NONE"; + boolean mutualSSLEnabled = false; + int usage?; + string createdTime?; + string lastUpdatedTime?; + string md5?; + string definitionUrl?; +}; + +type ServiceSchema record { + ServiceItem serviceMetadata; + string inlineContent?; +}; + +public function main() returns error? { + string portStr = os:getEnv("PORT"); + string artifactIndexStr = os:getEnv("ARTIFACT_INDEX"); + string unauthorizedStr = os:getEnv("UNAUTHORIZED"); + string outputDir = os:getEnv("OUTPUT_DIR"); + + int port = portStr.trim() == "" ? 8080 : check int:fromString(portStr.trim()); + int artifactIndex = artifactIndexStr.trim() == "" ? 0 : check int:fromString(artifactIndexStr.trim()); + boolean unauthorized = unauthorizedStr.trim() == "true"; + string artifactsDir = outputDir.trim() == "" ? "/artifacts" : outputDir.trim(); + + string artifactFile = string `${artifactsDir}/artifacts_${artifactIndex}.json`; + map artifacts = {}; + + http:Listener httpListener = check new (port); + http:Service svc; + + if unauthorized { + svc = service object { + resource function get health() returns http:Ok { + return {body: {status: "ok"}}; + } + + resource function get services(string? 'key = (), string? name = (), string? version = (), + string? definitionType = (), boolean shrink = false, string? sortBy = (), + string? sortOrder = (), int 'limit = 25, int offset = 0) returns json { + return {"list": [], "pagination": {}}; + } + + resource function post services(http:Request req) returns http:Unauthorized|error { + ServiceSchema schema = check traverseRequest(req); + string serviceKey = schema.serviceMetadata.serviceKey ?: ""; + artifacts[serviceKey] = schema; + check io:fileWriteJson(artifactFile, artifacts.toJson()); + return {body: {message: "Unauthorized"}}; + } + }; + } else { + svc = service object { + resource function get health() returns http:Ok { + return {body: {status: "ok"}}; + } + + resource function get services(string? 'key = (), string? name = (), string? version = (), + string? definitionType = (), boolean shrink = false, string? sortBy = (), + string? sortOrder = (), int 'limit = 25, int offset = 0) returns json { + return {"list": [], "pagination": {}}; + } + + resource function post services(http:Request req) returns http:InternalServerError|error { + ServiceSchema schema = check traverseRequest(req); + string serviceKey = schema.serviceMetadata.serviceKey ?: ""; + artifacts[serviceKey] = schema; + check io:fileWriteJson(artifactFile, artifacts.toJson()); + return {body: {message: "Return 500 Status code after completing the task"}}; + } + }; + } + + check httpListener.attach(svc, "/"); + check httpListener.'start(); + runtime:registerListener(httpListener); + log:printInfo(string `Mock catalog server started on port ${port}, artifactIndex=${artifactIndex}, unauthorized=${unauthorized}`); +} + +function traverseRequest(http:Request req) returns ServiceSchema|error { + mime:Entity[] bodyParts = check req.getBodyParts(); + ServiceItem serviceMetadata = check (check bodyParts[0].getJson()).cloneWithType(); + string inlineContent = check bodyParts[1].getText(); + return {serviceMetadata, inlineContent}; +} diff --git a/ballerina-tests/tests/asserts/assert_0.json b/ballerina-tests/tests/asserts/assert_0.json index aa571e1..5978c67 100644 --- a/ballerina-tests/tests/asserts/assert_0.json +++ b/ballerina-tests/tests/asserts/assert_0.json @@ -1,15 +1,15 @@ { "Sales0:localhost:9000/sales0": { "serviceMetadata": { - "name": "/sales0AEB9B235D2", + "name": "/sales0", "description": "", "version": "0.1.0", "serviceKey": "Sales0:localhost:9000/sales0", - "serviceUrl": "localhost:9000/sales0", + "serviceUrl": "http://localhost:9000/sales0", "definitionType": "OAS3", "securityType": "NONE", "mutualSSLEnabled": false, - "definitionUrl": "localhost:9000/sales0" + "definitionUrl": "http://localhost:9000/sales0" }, "inlineContent": "openapi: 3.0.1\ninfo:\n title: Sales0\n version: 0.1.0\nservers:\n- url: \"{server}:{port}\/sales0\"\n variables:\n server:\n default: http:\/\/localhost\n port:\n default: \"9000\"\npaths: {}\n" } diff --git a/ballerina-tests/tests/asserts/assert_1.json b/ballerina-tests/tests/asserts/assert_1.json index 8675606..21e8248 100644 --- a/ballerina-tests/tests/asserts/assert_1.json +++ b/ballerina-tests/tests/asserts/assert_1.json @@ -1,57 +1,57 @@ { "Sales0:b7a.default:9101/sales0": { "serviceMetadata": { - "name": "/sales0713336CFF7", + "name": "/sales0", "description": "", "version": "0.1.0", "serviceKey": "Sales0:b7a.default:9101/sales0", - "serviceUrl": "b7a.default:9101/sales0", + "serviceUrl": "http://b7a.default:9101/sales0", "definitionType": "OAS3", "securityType": "NONE", "mutualSSLEnabled": false, - "definitionUrl": "b7a.default:9101/sales0" + "definitionUrl": "http://b7a.default:9101/sales0" }, "inlineContent": "openapi: 3.0.1\ninfo:\n title: Sales0\n version: 0.1.0\nservers:\n- url: \"{server}:{port}\/sales0\"\n variables:\n server:\n default: http:\/\/localhost\n port:\n default: \"9101\"\npaths: {}\n" }, "Sales0:b7a.default:9102/sales0": { "serviceMetadata": { - "name": "/sales0331CCC2CDB", + "name": "/sales0", "description": "", "version": "0.1.0", "serviceKey": "Sales0:b7a.default:9102/sales0", - "serviceUrl": "b7a.default:9102/sales0", + "serviceUrl": "http://b7a.default:9102/sales0", "definitionType": "OAS3", "securityType": "NONE", "mutualSSLEnabled": false, - "definitionUrl": "b7a.default:9102/sales0" + "definitionUrl": "http://b7a.default:9102/sales0" }, "inlineContent": "openapi: 3.0.1\ninfo:\n title: Sales0\n version: 0.1.0\nservers:\n- url: \"{server}:{port}\/sales0\"\n variables:\n server:\n default: http:\/\/localhost\n port:\n default: \"9102\"\npaths: {}\n" }, "Sales0:b7a.default:9103/sales0": { "serviceMetadata": { - "name": "/sales00ECBCD6942", + "name": "/sales0", "description": "", "version": "0.1.0", "serviceKey": "Sales0:b7a.default:9103/sales0", - "serviceUrl": "b7a.default:9103/sales0", + "serviceUrl": "http://b7a.default:9103/sales0", "definitionType": "OAS3", "securityType": "NONE", "mutualSSLEnabled": false, - "definitionUrl": "b7a.default:9103/sales0" + "definitionUrl": "http://b7a.default:9103/sales0" }, "inlineContent": "openapi: 3.0.1\ninfo:\n title: Sales0\n version: 0.1.0\nservers:\n- url: \"{server}:{port}\/sales0\"\n variables:\n server:\n default: http:\/\/localhost\n port:\n default: \"9103\"\npaths: {}\n" }, "Sales0:b7a.default:9100/sales0": { "serviceMetadata": { - "name": "/sales0ED713FBCC4", + "name": "/sales0", "description": "", "version": "0.1.0", "serviceKey": "Sales0:b7a.default:9100/sales0", - "serviceUrl": "b7a.default:9100/sales0", + "serviceUrl": "http://b7a.default:9100/sales0", "definitionType": "OAS3", "securityType": "NONE", "mutualSSLEnabled": false, - "definitionUrl": "b7a.default:9100/sales0" + "definitionUrl": "http://b7a.default:9100/sales0" }, "inlineContent": "openapi: 3.0.1\ninfo:\n title: Sales0\n version: 0.1.0\nservers:\n- url: \"{server}:{port}\/sales0\"\n variables:\n server:\n default: http:\/\/localhost\n port:\n default: \"9100\"\npaths: {}\n" } diff --git a/ballerina-tests/tests/asserts/assert_12.json b/ballerina-tests/tests/asserts/assert_12.json new file mode 100644 index 0000000..1f4c14b --- /dev/null +++ b/ballerina-tests/tests/asserts/assert_12.json @@ -0,0 +1,16 @@ +{ + "Healthcare:localhost:9090/healthcare":{ + "serviceMetadata":{ + "name":"/healthcare", + "description":"", + "version":"0.1.0", + "serviceKey":"Healthcare:localhost:9090/healthcare", + "serviceUrl":"http://localhost:9090/healthcare", + "definitionType":"OAS3", + "securityType":"NONE", + "mutualSSLEnabled":false, + "definitionUrl":"http://localhost:9090/healthcare" + }, + "inlineContent":"openapi: 3.0.1\ninfo:\n title: Healthcare\n version: 0.1.0\nservers:\n- url: \"http:\/\/{server}:{port}\/healthcare\"\n variables:\n server:\n default: localhost\n port:\n default: \"9090\"\npaths: {}\n" + } +} diff --git a/ballerina-tests/tests/asserts/assert_2.json b/ballerina-tests/tests/asserts/assert_2.json index 1284a2e..f80f13c 100644 --- a/ballerina-tests/tests/asserts/assert_2.json +++ b/ballerina-tests/tests/asserts/assert_2.json @@ -1,29 +1,29 @@ { "Sales0:localhost:9202/sales0": { "serviceMetadata": { - "name": "/sales030FC9ECE69", + "name": "/sales0", "description": "", "version": "0.1.0", "serviceKey": "Sales0:localhost:9202/sales0", - "serviceUrl": "localhost:9202/sales0", + "serviceUrl": "http://localhost:9202/sales0", "definitionType": "OAS3", "securityType": "NONE", "mutualSSLEnabled": false, - "definitionUrl": "localhost:9202/sales0" + "definitionUrl": "http://localhost:9202/sales0" }, "inlineContent": "openapi: 3.0.1\ninfo:\n title: Sales0\n version: 0.1.0\nservers:\n- url: \"{server}:{port}\/sales0\"\n variables:\n server:\n default: http:\/\/localhost\n port:\n default: \"9202\"\npaths:\n \/orders:\n get:\n operationId: getOrders\n responses:\n \"202\":\n description: Accepted\n post:\n operationId: postOrders\n responses:\n \"202\":\n description: Accepted\n" }, "Sales0 Base:localhost:9200/sales0/base": { "serviceMetadata": { - "name": "/sales0/base5D5B5BF802", + "name": "/sales0/base", "description": "", "version": "0.1.0", "serviceKey": "Sales0 Base:localhost:9200/sales0/base", - "serviceUrl": "localhost:9200/sales0/base", + "serviceUrl": "http://localhost:9200/sales0/base", "definitionType": "OAS3", "securityType": "NONE", "mutualSSLEnabled": false, - "definitionUrl": "localhost:9200/sales0/base" + "definitionUrl": "http://localhost:9200/sales0/base" }, "inlineContent": "openapi: 3.0.1\ninfo:\n title: Sales0 Base\n version: 0.1.0\nservers:\n- url: \"{server}:{port}\/sales0\/base\"\n variables:\n server:\n default: http:\/\/localhost\n port:\n default: \"9200\"\npaths:\n \/orders:\n get:\n operationId: getOrders\n responses:\n \"202\":\n description: Accepted\n post:\n operationId: postOrders\n responses:\n \"202\":\n description: Accepted\n" } diff --git a/ballerina-tests/tests/asserts/assert_3.json b/ballerina-tests/tests/asserts/assert_3.json index 907d9d6..e52a155 100644 --- a/ballerina-tests/tests/asserts/assert_3.json +++ b/ballerina-tests/tests/asserts/assert_3.json @@ -1,43 +1,43 @@ { "Sales0:localhost:9301/sales0": { "serviceMetadata": { - "name": "/sales02212A7A2A4", + "name": "/sales0", "description": "", "version": "0.1.0", "serviceKey": "Sales0:localhost:9301/sales0", - "serviceUrl": "localhost:9301/sales0", + "serviceUrl": "http://localhost:9301/sales0", "definitionType": "OAS3", "securityType": "NONE", "mutualSSLEnabled": false, - "definitionUrl": "localhost:9301/sales0" + "definitionUrl": "http://localhost:9301/sales0" }, "inlineContent": "openapi: 3.0.1\ninfo:\n title: Sales0\n version: 0.1.0\nservers:\n- url: \"{server}:{port}\/sales0\"\n variables:\n server:\n default: http:\/\/localhost\n port:\n default: \"9301\"\npaths: {}\n" }, "Sales0:localhost:9300/sales0": { "serviceMetadata": { - "name": "/sales0A8AD0DE076", + "name": "/sales0", "description": "", "version": "0.1.0", "serviceKey": "Sales0:localhost:9300/sales0", - "serviceUrl": "localhost:9300/sales0", + "serviceUrl": "http://localhost:9300/sales0", "definitionType": "OAS3", "securityType": "NONE", "mutualSSLEnabled": false, - "definitionUrl": "localhost:9300/sales0" + "definitionUrl": "http://localhost:9300/sales0" }, "inlineContent": "openapi: 3.0.1\ninfo:\n title: Sales0\n version: 0.1.0\nservers:\n- url: \"{server}:{port}\/sales0\"\n variables:\n server:\n default: http:\/\/localhost\n port:\n default: \"9300\"\npaths: {}\n" }, "Sales0:localhost:9302/sales0": { "serviceMetadata": { - "name": "/sales0D107C8E2FD", + "name": "/sales0", "description": "", "version": "0.1.0", "serviceKey": "Sales0:localhost:9302/sales0", - "serviceUrl": "localhost:9302/sales0", + "serviceUrl": "http://localhost:9302/sales0", "definitionType": "OAS3", "securityType": "NONE", "mutualSSLEnabled": false, - "definitionUrl": "localhost:9302/sales0" + "definitionUrl": "http://localhost:9302/sales0" }, "inlineContent": "openapi: 3.0.1\ninfo:\n title: Sales0\n version: 0.1.0\nservers:\n- url: \"{server}:{port}\/sales0\"\n variables:\n server:\n default: http:\/\/localhost\n port:\n default: \"9302\"\npaths: {}\n" } diff --git a/ballerina-tests/tests/asserts/assert_4.json b/ballerina-tests/tests/asserts/assert_4.json index 1a2179e..2b02594 100644 --- a/ballerina-tests/tests/asserts/assert_4.json +++ b/ballerina-tests/tests/asserts/assert_4.json @@ -1,85 +1,85 @@ { "Sales0:www.example.com:9400/sales0": { "serviceMetadata": { - "name": "/sales084CC1DC557", + "name": "/sales0", "description": "", "version": "0.1.0", "serviceKey": "Sales0:www.example.com:9400/sales0", - "serviceUrl": "www.example.com:9400/sales0", + "serviceUrl": "http://www.example.com:9400/sales0", "definitionType": "OAS3", "securityType": "NONE", "mutualSSLEnabled": false, - "definitionUrl": "www.example.com:9400/sales0" + "definitionUrl": "http://www.example.com:9400/sales0" }, "inlineContent": "openapi: 3.0.1\ninfo:\n title: Sales0\n version: 0.1.0\nservers:\n- url: \"{server}:{port}\/sales0\"\n variables:\n server:\n default: http:\/\/localhost\n port:\n default: \"9400\"\npaths: {}\n" }, "Sales0:www.example.com:9403/sales0": { "serviceMetadata": { - "name": "/sales07569B63C70", + "name": "/sales0", "description": "", "version": "0.1.0", "serviceKey": "Sales0:www.example.com:9403/sales0", - "serviceUrl": "www.example.com:9403/sales0", + "serviceUrl": "http://www.example.com:9403/sales0", "definitionType": "OAS3", "securityType": "BASIC", "mutualSSLEnabled": false, - "definitionUrl": "www.example.com:9403/sales0" + "definitionUrl": "http://www.example.com:9403/sales0" }, "inlineContent": "openapi: 3.0.1\ninfo:\n title: Sales0\n version: 0.1.0\nservers:\n- url: \"{server}:{port}\/sales0\"\n variables:\n server:\n default: http:\/\/localhost\n port:\n default: \"9403\"\npaths: {}\n" }, "Sales0:b7a.default:9405/sales0": { "serviceMetadata": { - "name": "/sales011D9245FEA", + "name": "/sales0", "description": "", "version": "0.1.0", "serviceKey": "Sales0:b7a.default:9405/sales0", - "serviceUrl": "b7a.default:9405/sales0", + "serviceUrl": "http://b7a.default:9405/sales0", "definitionType": "OAS3", "securityType": "OAUTH2", "mutualSSLEnabled": false, - "definitionUrl": "b7a.default:9405/sales0" + "definitionUrl": "http://b7a.default:9405/sales0" }, "inlineContent": "openapi: 3.0.1\ninfo:\n title: Sales0\n version: 0.1.0\nservers:\n- url: \"{server}:{port}\/sales0\"\n variables:\n server:\n default: http:\/\/localhost\n port:\n default: \"9405\"\npaths: {}\n" }, "Sales0:www.example.com:9402/sales0": { "serviceMetadata": { - "name": "/sales014BE89C11D", + "name": "/sales0", "description": "", "version": "0.1.0", "serviceKey": "Sales0:www.example.com:9402/sales0", - "serviceUrl": "www.example.com:9402/sales0", + "serviceUrl": "http://www.example.com:9402/sales0", "definitionType": "OAS3", "securityType": "BASIC", "mutualSSLEnabled": false, - "definitionUrl": "www.example.com:9402/sales0" + "definitionUrl": "http://www.example.com:9402/sales0" }, "inlineContent": "openapi: 3.0.1\ninfo:\n title: Sales0\n version: 0.1.0\nservers:\n- url: \"{server}:{port}\/sales0\"\n variables:\n server:\n default: http:\/\/localhost\n port:\n default: \"9402\"\npaths: {}\n" }, "Sales0 Base:www.example.com:9401/sales0/base": { "serviceMetadata": { - "name": "/sales0/base11E2F34644", + "name": "/sales0/base", "description": "", "version": "0.1.0", "serviceKey": "Sales0 Base:www.example.com:9401/sales0/base", - "serviceUrl": "www.example.com:9401/sales0/base", + "serviceUrl": "http://www.example.com:9401/sales0/base", "definitionType": "OAS3", "securityType": "BASIC", "mutualSSLEnabled": false, - "definitionUrl": "www.example.com:9401/sales0/base" + "definitionUrl": "http://www.example.com:9401/sales0/base" }, "inlineContent": "openapi: 3.0.1\ninfo:\n title: Sales0 Base\n version: 0.1.0\nservers:\n- url: \"{server}:{port}\/sales0\/base\"\n variables:\n server:\n default: http:\/\/localhost\n port:\n default: \"9401\"\npaths: {}\n" }, "Sales0:b7a.default:9404/sales0": { "serviceMetadata": { - "name": "/sales0DAA200ED62", + "name": "/sales0", "description": "", "version": "0.1.0", "serviceKey": "Sales0:b7a.default:9404/sales0", - "serviceUrl": "b7a.default:9404/sales0", + "serviceUrl": "http://b7a.default:9404/sales0", "definitionType": "OAS3", "securityType": "OAUTH2", "mutualSSLEnabled": false, - "definitionUrl": "b7a.default:9404/sales0" + "definitionUrl": "http://b7a.default:9404/sales0" }, "inlineContent": "openapi: 3.0.1\ninfo:\n title: Sales0\n version: 0.1.0\nservers:\n- url: \"{server}:{port}\/sales0\"\n variables:\n server:\n default: http:\/\/localhost\n port:\n default: \"9404\"\npaths: {}\n" } diff --git a/ballerina-tests/tests/asserts/assert_5.json b/ballerina-tests/tests/asserts/assert_5.json index f130157..785c58a 100644 --- a/ballerina-tests/tests/asserts/assert_5.json +++ b/ballerina-tests/tests/asserts/assert_5.json @@ -1,85 +1,85 @@ { "Sales0:www.example.com:9500/sales0": { "serviceMetadata": { - "name": "/sales0D5A3765F90", + "name": "/sales0", "description": "", "version": "0.1.0", "serviceKey": "Sales0:www.example.com:9500/sales0", - "serviceUrl": "www.example.com:9500/sales0", + "serviceUrl": "http://www.example.com:9500/sales0", "definitionType": "OAS3", "securityType": "NONE", "mutualSSLEnabled": false, - "definitionUrl": "www.example.com:9500/sales0" + "definitionUrl": "http://www.example.com:9500/sales0" }, "inlineContent": "openapi: 3.0.1\ninfo:\n title: Sales0\n version: 0.1.0\nservers:\n- url: \"{server}:{port}\/sales0\"\n variables:\n server:\n default: http:\/\/localhost\n port:\n default: \"9500\"\npaths: {}\n" }, "Sales0:localhost:9506/sales0": { "serviceMetadata": { - "name": "/sales029E7BE3621", + "name": "/sales0", "description": "", "version": "0.1.0", "serviceKey": "Sales0:localhost:9506/sales0", - "serviceUrl": "localhost:9506/sales0", + "serviceUrl": "http://localhost:9506/sales0", "definitionType": "OAS3", "securityType": "NONE", "mutualSSLEnabled": false, - "definitionUrl": "localhost:9506/sales0" + "definitionUrl": "http://localhost:9506/sales0" }, "inlineContent": "openapi: 3.0.1\ninfo:\n title: Sales0\n version: 0.1.0\nservers:\n- url: \"{server}:{port}\/sales0\"\n variables:\n server:\n default: http:\/\/localhost\n port:\n default: \"9506\"\npaths: {}\n" }, "Sales0:localhost:9501/sales0": { "serviceMetadata": { - "name": "/sales04F3CC69644", + "name": "/sales0", "description": "", "version": "0.1.0", "serviceKey": "Sales0:localhost:9501/sales0", - "serviceUrl": "localhost:9501/sales0", + "serviceUrl": "http://localhost:9501/sales0", "definitionType": "OAS3", "securityType": "NONE", "mutualSSLEnabled": false, - "definitionUrl": "localhost:9501/sales0" + "definitionUrl": "http://localhost:9501/sales0" }, "inlineContent": "openapi: 3.0.1\ninfo:\n title: Sales0\n version: 0.1.0\nservers:\n- url: \"{server}:{port}\/sales0\"\n variables:\n server:\n default: http:\/\/localhost\n port:\n default: \"9501\"\npaths: {}\n" }, "Sales0:www.example.com:9504/sales0": { "serviceMetadata": { - "name": "/sales0BF34EAC386", + "name": "/sales0", "description": "", "version": "0.1.0", "serviceKey": "Sales0:www.example.com:9504/sales0", - "serviceUrl": "www.example.com:9504/sales0", + "serviceUrl": "http://www.example.com:9504/sales0", "definitionType": "OAS3", "securityType": "NONE", "mutualSSLEnabled": false, - "definitionUrl": "www.example.com:9504/sales0" + "definitionUrl": "http://www.example.com:9504/sales0" }, "inlineContent": "openapi: 3.0.1\ninfo:\n title: Sales0\n version: 0.1.0\nservers:\n- url: \"{server}:{port}\/sales0\"\n variables:\n server:\n default: http:\/\/localhost\n port:\n default: \"9504\"\npaths: {}\n" }, "Sales0::9502/sales0": { "serviceMetadata": { - "name": "/sales07AF1125C78", + "name": "/sales0", "description": "", "version": "0.1.0", "serviceKey": "Sales0::9502/sales0", - "serviceUrl": ":9502/sales0", + "serviceUrl": "http://:9502/sales0", "definitionType": "OAS3", "securityType": "NONE", "mutualSSLEnabled": false, - "definitionUrl": ":9502/sales0" + "definitionUrl": "http://:9502/sales0" }, "inlineContent": "openapi: 3.0.1\ninfo:\n title: Sales0\n version: 0.1.0\nservers:\n- url: \"{server}:{port}\/sales0\"\n variables:\n server:\n default: http:\/\/localhost\n port:\n default: \"9502\"\npaths: {}\n" }, "Sales0:localhost:9503/sales0": { "serviceMetadata": { - "name": "/sales010AB235A47", + "name": "/sales0", "description": "", "version": "0.1.0", "serviceKey": "Sales0:localhost:9503/sales0", - "serviceUrl": "localhost:9503/sales0", + "serviceUrl": "http://localhost:9503/sales0", "definitionType": "OAS3", "securityType": "NONE", "mutualSSLEnabled": false, - "definitionUrl": "localhost:9503/sales0" + "definitionUrl": "http://localhost:9503/sales0" }, "inlineContent": "openapi: 3.0.1\ninfo:\n title: Sales0\n version: 0.1.0\nservers:\n- url: \"{server}:{port}\/sales0\"\n variables:\n server:\n default: http:\/\/localhost\n port:\n default: \"9503\"\npaths: {}\n" } diff --git a/ballerina-tests/tests/asserts/assert_6.json b/ballerina-tests/tests/asserts/assert_6.json index 07fbc4f..fc7f1f4 100644 --- a/ballerina-tests/tests/asserts/assert_6.json +++ b/ballerina-tests/tests/asserts/assert_6.json @@ -1,71 +1,71 @@ { "Sales0:localhost:9601/sales0": { "serviceMetadata": { - "name": "/sales0FC87DCDD39", + "name": "/sales0", "description": "", "version": "0.1.0", "serviceKey": "Sales0:localhost:9601/sales0", - "serviceUrl": "localhost:9601/sales0", + "serviceUrl": "http://localhost:9601/sales0", "definitionType": "OAS3", "securityType": "NONE", "mutualSSLEnabled": false, - "definitionUrl": "localhost:9601/sales0" + "definitionUrl": "http://localhost:9601/sales0" }, "inlineContent": "openapi: 3.0.1\ninfo:\n title: Sales0\n version: 0.1.0\nservers:\n- url: \"{server}:{port}\/sales0\"\n variables:\n server:\n default: http:\/\/localhost\n port:\n default: \"9601\"\npaths: {}\n" }, "Sales0:www.example.com:9604/sales0": { "serviceMetadata": { - "name": "/sales0CF77B68F0C", + "name": "/sales0", "description": "", "version": "0.1.0", "serviceKey": "Sales0:www.example.com:9604/sales0", - "serviceUrl": "www.example.com:9604/sales0", + "serviceUrl": "http://www.example.com:9604/sales0", "definitionType": "OAS3", "securityType": "BASIC", "mutualSSLEnabled": false, - "definitionUrl": "www.example.com:9604/sales0" + "definitionUrl": "http://www.example.com:9604/sales0" }, "inlineContent": "openapi: 3.0.1\ninfo:\n title: Sales0\n version: 0.1.0\nservers:\n- url: \"{server}:{port}\/sales0\"\n variables:\n server:\n default: http:\/\/localhost\n port:\n default: \"9604\"\npaths:\n \/path:\n get:\n summary: Example resource doc\n operationId: getPath\n responses:\n \"202\":\n description: Accepted\n" }, "Sales0:www.example.com:9600/sales0": { "serviceMetadata": { - "name": "/sales0941E9D523E", + "name": "/sales0", "description": "", "version": "0.1.0", "serviceKey": "Sales0:www.example.com:9600/sales0", - "serviceUrl": "www.example.com:9600/sales0", + "serviceUrl": "http://www.example.com:9600/sales0", "definitionType": "OAS3", "securityType": "BASIC", "mutualSSLEnabled": false, - "definitionUrl": "www.example.com:9600/sales0" + "definitionUrl": "http://www.example.com:9600/sales0" }, "inlineContent": "openapi: 3.0.1\ninfo:\n title: Sales0\n version: 0.1.0\nservers:\n- url: \"{server}:{port}\/sales0\"\n variables:\n server:\n default: http:\/\/localhost\n port:\n default: \"9600\"\npaths: {}\n" }, "Sales0:www.example.com:9603/sales0": { "serviceMetadata": { - "name": "/sales0FDB2ADFEE8", + "name": "/sales0", "description": "", "version": "0.1.0", "serviceKey": "Sales0:www.example.com:9603/sales0", - "serviceUrl": "www.example.com:9603/sales0", + "serviceUrl": "http://www.example.com:9603/sales0", "definitionType": "OAS3", "securityType": "BASIC", "mutualSSLEnabled": false, - "definitionUrl": "www.example.com:9603/sales0" + "definitionUrl": "http://www.example.com:9603/sales0" }, "inlineContent": "openapi: 3.0.1\ninfo:\n title: Sales0\n version: 0.1.0\nservers:\n- url: \"{server}:{port}\/sales0\"\n variables:\n server:\n default: http:\/\/localhost\n port:\n default: \"9603\"\npaths: {}\n" }, "Sales0:www.example.com:9602/sales0": { "serviceMetadata": { - "name": "/sales0197509A70C", + "name": "/sales0", "description": "", "version": "0.1.0", "serviceKey": "Sales0:www.example.com:9602/sales0", - "serviceUrl": "www.example.com:9602/sales0", + "serviceUrl": "http://www.example.com:9602/sales0", "definitionType": "OAS3", "securityType": "BASIC", "mutualSSLEnabled": false, - "definitionUrl": "www.example.com:9602/sales0" + "definitionUrl": "http://www.example.com:9602/sales0" }, "inlineContent": "openapi: 3.0.1\ninfo:\n title: Sales0\n version: 0.1.0\nservers:\n- url: \"{server}:{port}\/sales0\"\n variables:\n server:\n default: http:\/\/localhost\n port:\n default: \"9602\"\npaths: {}\n" } diff --git a/ballerina-tests/tests/asserts/assert_7.json b/ballerina-tests/tests/asserts/assert_7.json index 1b13f5f..c87c9d1 100644 --- a/ballerina-tests/tests/asserts/assert_7.json +++ b/ballerina-tests/tests/asserts/assert_7.json @@ -1,29 +1,29 @@ { "Main Openapi Yaml:localhost:9702/": { "serviceMetadata": { - "name": "/88DE0EE5AE", + "name": "/", "description": "", "version": "0.1.0", "serviceKey": "Main Openapi Yaml:localhost:9702/", - "serviceUrl": "localhost:9702/", + "serviceUrl": "http://localhost:9702/", "definitionType": "OAS3", "securityType": "NONE", "mutualSSLEnabled": false, - "definitionUrl": "localhost:9702/" + "definitionUrl": "http://localhost:9702/" }, "inlineContent": "openapi: 3.0.1\ninfo:\n title: Main Openapi Yaml\n version: 0.1.0\nservers:\n- url: \"{server}:{port}\/\"\n variables:\n server:\n default: http:\/\/localhost\n port:\n default: \"9702\"\npaths: {}\n" }, "Main Openapi Yaml:localhost:9700/": { "serviceMetadata": { - "name": "/984DFB643A", + "name": "/", "description": "", "version": "0.1.0", "serviceKey": "Main Openapi Yaml:localhost:9700/", - "serviceUrl": "localhost:9700/", + "serviceUrl": "http://localhost:9700/", "definitionType": "OAS3", "securityType": "NONE", "mutualSSLEnabled": false, - "definitionUrl": "localhost:9700/" + "definitionUrl": "http://localhost:9700/" }, "inlineContent": "openapi: 3.0.1\ninfo:\n title: Main Openapi Yaml\n version: 0.1.0\nservers:\n- url: \"{server}:{port}\/\"\n variables:\n server:\n default: http:\/\/localhost\n port:\n default: \"9700\"\npaths: {}\n" } diff --git a/ballerina-tests/tests/asserts/assert_8.json b/ballerina-tests/tests/asserts/assert_8.json index e1152a0..63d6600 100644 --- a/ballerina-tests/tests/asserts/assert_8.json +++ b/ballerina-tests/tests/asserts/assert_8.json @@ -1,43 +1,43 @@ { "Sales0:www.example.com:9081/sales0": { "serviceMetadata": { - "name": "/sales0B803085FB8", + "name": "/sales0", "description": "", "version": "0.1.0", "serviceKey": "Sales0:www.example.com:9081/sales0", - "serviceUrl": "www.example.com:9081/sales0", + "serviceUrl": "http://www.example.com:9081/sales0", "definitionType": "OAS3", "securityType": "BASIC", "mutualSSLEnabled": true, - "definitionUrl": "www.example.com:9081/sales0" + "definitionUrl": "http://www.example.com:9081/sales0" }, "inlineContent": "openapi: 3.0.1\ninfo:\n title: Sales0\n version: 0.1.0\nservers:\n- url: \"{server}:{port}\/sales0\"\n variables:\n server:\n default: http:\/\/localhost\n port:\n default: \"9081\"\npaths: {}\n" }, "Sales0:www.example.com:9082/sales0": { "serviceMetadata": { - "name": "/sales093A7349429", + "name": "/sales0", "description": "", "version": "0.1.0", "serviceKey": "Sales0:www.example.com:9082/sales0", - "serviceUrl": "www.example.com:9082/sales0", + "serviceUrl": "http://www.example.com:9082/sales0", "definitionType": "OAS3", "securityType": "BASIC", "mutualSSLEnabled": true, - "definitionUrl": "www.example.com:9082/sales0" + "definitionUrl": "http://www.example.com:9082/sales0" }, "inlineContent": "openapi: 3.0.1\ninfo:\n title: Sales0\n version: 0.1.0\nservers:\n- url: \"{server}:{port}\/sales0\"\n variables:\n server:\n default: http:\/\/localhost\n port:\n default: \"9082\"\npaths: {}\n" }, "Sales0:www.example.com:9080/sales0": { "serviceMetadata": { - "name": "/sales0583E34E28D", + "name": "/sales0", "description": "", "version": "0.1.0", "serviceKey": "Sales0:www.example.com:9080/sales0", - "serviceUrl": "www.example.com:9080/sales0", + "serviceUrl": "http://www.example.com:9080/sales0", "definitionType": "OAS3", "securityType": "BASIC", "mutualSSLEnabled": true, - "definitionUrl": "www.example.com:9080/sales0" + "definitionUrl": "http://www.example.com:9080/sales0" }, "inlineContent": "openapi: 3.0.1\ninfo:\n title: Sales0\n version: 0.1.0\nservers:\n- url: \"{server}:{port}\/sales0\"\n variables:\n server:\n default: http:\/\/localhost\n port:\n default: \"9080\"\npaths: {}\n" } diff --git a/ballerina-tests/tests/generated_artifacts/.gitkeep b/ballerina-tests/tests/generated_artifacts/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/ballerina-tests/tests/test_service_impl.bal b/ballerina-tests/tests/test_service_impl.bal deleted file mode 100644 index 5727063..0000000 --- a/ballerina-tests/tests/test_service_impl.bal +++ /dev/null @@ -1,162 +0,0 @@ -// Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). -// -// WSO2 LLC. licenses this file to you 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. - -import ballerina/http; -import ballerina/io; -import ballerina/log; - -final string artifactPath = string `${ballerinaTestDir}${sep}generated_artifacts`; - -service / on new http:Listener(8080) { - ServiceSchema[] artifacts = []; - final string artifactJsonFilename = string `${artifactPath}${sep}artifacts_0.json`; - - function init() returns error? { - log:printInfo("Starting the test server on port 8080"); - } - - resource function post services(http:Request req) returns Service|http:InternalServerError|error { - return getSchemaAndReturnResponse(req, self.artifactJsonFilename, self.artifacts); - } -} - -service / on new http:Listener(8081) { - ServiceSchema[] artifacts = []; - final string artifactJsonFilename = string `${artifactPath}${sep}artifacts_1.json`; - - function init() returns error? { - log:printInfo("Starting the test server on port 8081"); - } - - resource function post services(http:Request req) returns Service|http:InternalServerError|error { - return getSchemaAndReturnResponse(req, self.artifactJsonFilename, self.artifacts); - } -} - -service / on new http:Listener(8082) { - ServiceSchema[] artifacts = []; - final string artifactJsonFilename = string `${artifactPath}${sep}artifacts_2.json`; - - function init() returns error? { - log:printInfo("Starting the test server on port 8082"); - } - - resource function post services(http:Request req) returns Service|http:InternalServerError|error { - return getSchemaAndReturnResponse(req, self.artifactJsonFilename, self.artifacts); - } -} - -service / on new http:Listener(8083) { - ServiceSchema[] artifacts = []; - final string artifactJsonFilename = string `${artifactPath}${sep}artifacts_3.json`; - - function init() returns error? { - log:printInfo("Starting the test server on port 8083"); - } - - resource function post services(http:Request req) returns Service|http:InternalServerError|error { - return getSchemaAndReturnResponse(req, self.artifactJsonFilename, self.artifacts); - } -} - -service / on new http:Listener(8092) { - ServiceSchema[] artifacts = []; - final string artifactJsonFilename = string `${artifactPath}${sep}artifacts_4.json`; - - function init() returns error? { - log:printInfo("Starting the test server on port 8092"); - } - - resource function post services(http:Request req) returns Service|http:InternalServerError|error { - return getSchemaAndReturnResponse(req, self.artifactJsonFilename, self.artifacts); - } -} - -service / on new http:Listener(8085) { - ServiceSchema[] artifacts = []; - final string artifactJsonFilename = string `${artifactPath}${sep}artifacts_5.json`; - - function init() returns error? { - log:printInfo("Starting the test server on port 8085"); - } - - resource function post services(http:Request req) returns Service|http:InternalServerError|error { - return getSchemaAndReturnResponse(req, self.artifactJsonFilename, self.artifacts); - } -} - -service / on new http:Listener(8086) { - ServiceSchema[] artifacts = []; - final string artifactJsonFilename = string `${artifactPath}${sep}artifacts_6.json`; - - function init() returns error? { - log:printInfo("Starting the test server on port 8086"); - } - - resource function post services(http:Request req) returns Service|http:InternalServerError|error { - return getSchemaAndReturnResponse(req, self.artifactJsonFilename, self.artifacts); - } -} - -service / on new http:Listener(8087) { - ServiceSchema[] artifacts = []; - final string artifactJsonFilename = string `${artifactPath}${sep}artifacts_7.json`; - - function init() returns error? { - log:printInfo("Starting the test server on port 8087"); - } - - resource function post services(http:Request req) returns Service|http:InternalServerError|error { - return getSchemaAndReturnResponse(req, self.artifactJsonFilename, self.artifacts); - } -} - -service / on new http:Listener(8088) { - ServiceSchema[] artifacts = []; - final string artifactJsonFilename = string `${artifactPath}${sep}artifacts_8.json`; - - function init() returns error? { - log:printInfo("Starting the test server on port 8088"); - } - - resource function post services(http:Request req) returns Service|http:InternalServerError|error { - return getSchemaAndReturnResponse(req, self.artifactJsonFilename, self.artifacts); - } -} - -service / on new http:Listener(8091) { - ServiceSchema[] artifacts = []; - final string artifactJsonFilename = string `${artifactPath}${sep}artifacts_11.json`; - - function init() returns error? { - log:printInfo("Starting the test server on port 8091"); - } - - resource function post services(http:Request req) returns Service|http:Unauthorized|error { - ServiceSchema schema = check traverseMultiPartRequest(req); - self.artifacts.push(schema); - check io:fileWriteJson(self.artifactJsonFilename, self.artifacts.toJson()); - return {body: {message: "Unauthorized"}}; - } -} - -function getSchemaAndReturnResponse(http:Request req, - string artifactJsonFilename, ServiceSchema[] artifacts) returns http:InternalServerError|error { - ServiceSchema schema = check traverseMultiPartRequest(req); - artifacts.push(schema); - check io:fileWriteJson(artifactJsonFilename, artifacts.toJson()); - return returnDummyResponse(); -} diff --git a/ballerina-tests/tests/test_services.bal b/ballerina-tests/tests/test_services.bal index 626f661..1c53932 100644 --- a/ballerina-tests/tests/test_services.bal +++ b/ballerina-tests/tests/test_services.bal @@ -16,18 +16,223 @@ import ballerina/test; -@test:Config{dataProvider: testdataGen} -function testSingleService(int index) returns error? { - string file = string `artifacts_${index}.json`; - - // In here error will be the expected behaviour since currently it is the only way to terminate the processes. - // Currently ballerina/os module does not support a way to terminate the processes. +// --------------------------------------------------------------------------- +// Token server — started once before all groups, stopped after all groups +// --------------------------------------------------------------------------- + +@test:BeforeSuite +function initTokenServerContainer() returns error? { + check initializeTokenServerContainer("apim-catalog-token", 9444); +} + +@test:AfterSuite {} +function cleanTokenServerContainer() returns error? { + check cleanDockerContainer("apim-catalog-token"); +} + +// --------------------------------------------------------------------------- +// sample0 — port 8080, artifact index 0 +// --------------------------------------------------------------------------- + +@test:BeforeGroups {value: ["sample0"]} +function initSample0Container() returns error? { + check initializeMockServerContainer("apim-catalog-mock-0", 8080, 0); +} + +@test:AfterGroups {value: ["sample0"]} +function cleanSample0Container() returns error? { + check cleanDockerContainer("apim-catalog-mock-0"); +} + +@test:Config {groups: ["sample0"]} +function testSample0() returns error? { + int index = 0; + error? result = runOSCommand(getProjName(index), getProjPath(index), getConfigFilePath(index)); + test:assertTrue(result is error); + readAndValidateArtifacts(string `artifacts_${index}.json`, index); +} + +// --------------------------------------------------------------------------- +// sample1 — port 8081, artifact index 1 +// --------------------------------------------------------------------------- + +@test:BeforeGroups {value: ["sample1"]} +function initSample1Container() returns error? { + check initializeMockServerContainer("apim-catalog-mock-1", 8081, 1); +} + +@test:AfterGroups {value: ["sample1"]} +function cleanSample1Container() returns error? { + check cleanDockerContainer("apim-catalog-mock-1"); +} + +@test:Config {groups: ["sample1"]} +function testSample1() returns error? { + int index = 1; + error? result = runOSCommand(getProjName(index), getProjPath(index), getConfigFilePath(index)); + test:assertTrue(result is error); + readAndValidateArtifacts(string `artifacts_${index}.json`, index); +} + +// --------------------------------------------------------------------------- +// sample2 — port 8082, artifact index 2 +// --------------------------------------------------------------------------- + +@test:BeforeGroups {value: ["sample2"]} +function initSample2Container() returns error? { + check initializeMockServerContainer("apim-catalog-mock-2", 8082, 2); +} + +@test:AfterGroups {value: ["sample2"]} +function cleanSample2Container() returns error? { + check cleanDockerContainer("apim-catalog-mock-2"); +} + +@test:Config {groups: ["sample2"]} +function testSample2() returns error? { + int index = 2; + error? result = runOSCommand(getProjName(index), getProjPath(index), getConfigFilePath(index)); + test:assertTrue(result is error); + readAndValidateArtifacts(string `artifacts_${index}.json`, index); +} + +// --------------------------------------------------------------------------- +// sample3 — port 8083, artifact index 3 +// --------------------------------------------------------------------------- + +@test:BeforeGroups {value: ["sample3"]} +function initSample3Container() returns error? { + check initializeMockServerContainer("apim-catalog-mock-3", 8083, 3); +} + +@test:AfterGroups {value: ["sample3"]} +function cleanSample3Container() returns error? { + check cleanDockerContainer("apim-catalog-mock-3"); +} + +@test:Config {groups: ["sample3"]} +function testSample3() returns error? { + int index = 3; + error? result = runOSCommand(getProjName(index), getProjPath(index), getConfigFilePath(index)); + test:assertTrue(result is error); + readAndValidateArtifacts(string `artifacts_${index}.json`, index); +} + +// --------------------------------------------------------------------------- +// sample4 — port 8092, artifact index 4 +// --------------------------------------------------------------------------- + +@test:BeforeGroups {value: ["sample4"]} +function initSample4Container() returns error? { + check initializeMockServerContainer("apim-catalog-mock-4", 8092, 4); +} + +@test:AfterGroups {value: ["sample4"]} +function cleanSample4Container() returns error? { + check cleanDockerContainer("apim-catalog-mock-4"); +} + +@test:Config {groups: ["sample4"]} +function testSample4() returns error? { + int index = 4; + error? result = runOSCommand(getProjName(index), getProjPath(index), getConfigFilePath(index)); + test:assertTrue(result is error); + readAndValidateArtifacts(string `artifacts_${index}.json`, index); +} + +// --------------------------------------------------------------------------- +// sample5 — port 8085, artifact index 5 +// --------------------------------------------------------------------------- + +@test:BeforeGroups {value: ["sample5"]} +function initSample5Container() returns error? { + check initializeMockServerContainer("apim-catalog-mock-5", 8085, 5); +} + +@test:AfterGroups {value: ["sample5"]} +function cleanSample5Container() returns error? { + check cleanDockerContainer("apim-catalog-mock-5"); +} + +@test:Config {groups: ["sample5"]} +function testSample5() returns error? { + int index = 5; + error? result = runOSCommand(getProjName(index), getProjPath(index), getConfigFilePath(index)); + test:assertTrue(result is error); + readAndValidateArtifacts(string `artifacts_${index}.json`, index); +} + +// --------------------------------------------------------------------------- +// sample6 — port 8086, artifact index 6 +// --------------------------------------------------------------------------- + +@test:BeforeGroups {value: ["sample6"]} +function initSample6Container() returns error? { + check initializeMockServerContainer("apim-catalog-mock-6", 8086, 6); +} + +@test:AfterGroups {value: ["sample6"]} +function cleanSample6Container() returns error? { + check cleanDockerContainer("apim-catalog-mock-6"); +} + +@test:Config {groups: ["sample6"]} +function testSample6() returns error? { + int index = 6; + error? result = runOSCommand(getProjName(index), getProjPath(index), getConfigFilePath(index)); + test:assertTrue(result is error); + readAndValidateArtifacts(string `artifacts_${index}.json`, index); +} + +// --------------------------------------------------------------------------- +// sample7 — port 8087, artifact index 7 (basepath "/") +// --------------------------------------------------------------------------- + +@test:BeforeGroups {value: ["sample7"]} +function initSample7Container() returns error? { + check initializeMockServerContainer("apim-catalog-mock-7", 8087, 7); +} + +@test:AfterGroups {value: ["sample7"]} +function cleanSample7Container() returns error? { + check cleanDockerContainer("apim-catalog-mock-7"); +} + +@test:Config {groups: ["sample7"]} +function testSingleServiceWithBasepathAsSlash() returns error? { + int index = 7; error? result = runOSCommand(getProjName(index), getProjPath(index), getConfigFilePath(index)); test:assertTrue(result is error); - readAndValidateArtifacts(file, index); + readAndValidateArtifacts(string `artifacts_${index}.json`, index, "/"); } -@test:Config{} +// --------------------------------------------------------------------------- +// sample8 — port 8088, artifact index 8 +// --------------------------------------------------------------------------- + +@test:BeforeGroups {value: ["sample8"]} +function initSample8Container() returns error? { + check initializeMockServerContainer("apim-catalog-mock-8", 8088, 8); +} + +@test:AfterGroups {value: ["sample8"]} +function cleanSample8Container() returns error? { + check cleanDockerContainer("apim-catalog-mock-8"); +} + +@test:Config {groups: ["sample8"]} +function testSample8() returns error? { + int index = 8; + error? result = runOSCommand(getProjName(index), getProjPath(index), getConfigFilePath(index)); + test:assertTrue(result is error); + readAndValidateArtifacts(string `artifacts_${index}.json`, index); +} + +// --------------------------------------------------------------------------- +// sample9 — port 1111 (no container — tests connection-refused handling) +// --------------------------------------------------------------------------- + +@test:Config {groups: ["sample9"]} function testSingleServiceWithConnectionRefuse() returns error? { int index = 9; error? result = runOSCommand(getProjName(index), getProjPath(index), getConfigFilePath(index)); @@ -35,15 +240,34 @@ function testSingleServiceWithConnectionRefuse() returns error? { test:assertTrue((result).message().includes("Something wrong with the connection")); } -@test:Config{} -function testSingleServiceWithTokenCallfailure() returns error? { +// --------------------------------------------------------------------------- +// sample10 — port 8080 catalog, port 9441 token (wrong token URL — no container) +// Tests that a bad token endpoint causes a clear error before the catalog is called. +// --------------------------------------------------------------------------- + +@test:Config {groups: ["sample10"]} +function testSingleServiceWithTokenCallFailure() returns error? { int index = 10; error? result = runOSCommand(getProjName(index), getProjPath(index), getConfigFilePath(index)); test:assertTrue(result is error); test:assertTrue((result).message().includes("Failed to call the token endpoint")); } -@test:Config{} +// --------------------------------------------------------------------------- +// sample11 — port 8091, artifact index 11 (Unauthorized response) +// --------------------------------------------------------------------------- + +@test:BeforeGroups {value: ["sample11"]} +function initSample11Container() returns error? { + check initializeMockServerContainer("apim-catalog-mock-11", 8091, 11, true); +} + +@test:AfterGroups {value: ["sample11"]} +function cleanSample11Container() returns error? { + check cleanDockerContainer("apim-catalog-mock-11"); +} + +@test:Config {groups: ["sample11"]} function testSingleUnauthorizedService() returns error? { int index = 11; error? result = runOSCommand(getProjName(index), getProjPath(index), getConfigFilePath(index)); @@ -51,15 +275,24 @@ function testSingleUnauthorizedService() returns error? { test:assertTrue((result).message().includes("Unauthorized")); } -@test:Config{} -function testSingleServiceWithBasepathAsSlash() returns error? { - int index = 7; - string file = string `artifacts_${index}.json`; - error? result = runOSCommand(getProjName(index), getProjPath(index), getConfigFilePath(index)); - test:assertTrue(result is error); - readAndValidateArtifacts(file, index, "/"); +// --------------------------------------------------------------------------- +// sample12 — port 8089, artifact index 12 +// --------------------------------------------------------------------------- + +@test:BeforeGroups {value: ["sample12"]} +function initSample12Container() returns error? { + check initializeMockServerContainer("apim-catalog-mock-12", 8089, 12); +} + +@test:AfterGroups {value: ["sample12"]} +function cleanSample12Container() returns error? { + check cleanDockerContainer("apim-catalog-mock-12"); } -function testdataGen() returns int[][] { - return [[0], [1], [2], [3], [4], [5], [6], [8]]; +@test:Config {groups: ["sample12"]} +function testSample12() returns error? { + int index = 12; + error? result = runOSCommand(getProjName(index), getProjPath(index), getConfigFilePath(index)); + test:assertTrue(result is error); + readAndValidateArtifacts(string `artifacts_${index}.json`, index, "/healthcare"); } diff --git a/ballerina-tests/tests/test_token_service.bal b/ballerina-tests/tests/test_token_service.bal deleted file mode 100644 index 5b563be..0000000 --- a/ballerina-tests/tests/test_token_service.bal +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). -// -// WSO2 LLC. licenses this file to you 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. - -import ballerina/http; -import ballerina/log; - -const ACCESS_TOKEN_1 = "2YotnFZFEjr1zCsicMWpAA"; -const keyStorePassword = "ballerina"; - -string keystorePath = string `${currentDir}${sep}tests${sep}resources${sep}ballerinaKeystore.p12`; -public type AuthResponse record {| - *http:Ok; - json body?; -|}; - -listener http:Listener sts = new (9444, { - secureSocket: { - key: { - path: keystorePath, - password: keyStorePassword - } - } -}); - -service /oauth2 on sts { - function init() { - log:printInfo("Start the token server for tests on http://localhost:9444"); - } - - resource function post token(http:Request req) returns AuthResponse { - return { - body: { - "access_token": ACCESS_TOKEN_1, - "token_type": "example", - "expires_in": 3600, - "example_parameter": "example_value" - } - }; - } - - resource function post introspect(http:Request request) returns AuthResponse { - return { - body: {"active": true, "exp": 3600, "scp": "write update"} - }; - } -} diff --git a/ballerina-tests/tests/test_utils.bal b/ballerina-tests/tests/test_utils.bal index 03116d6..8c8e92e 100644 --- a/ballerina-tests/tests/test_utils.bal +++ b/ballerina-tests/tests/test_utils.bal @@ -17,16 +17,141 @@ import ballerina/file; import ballerina/http; import ballerina/io; +import ballerina/lang.runtime; import ballerina/log; import ballerina/mime; import ballerina/os; import ballerina/test; +const decimal DOCKER_START_TIMEOUT = 15; +const int DOCKER_RETRY_COUNT = 10; +const decimal DOCKER_RETRY_DELAY = 2; + string sep = file:pathSeparator; string currentDir = file:getCurrentDir(); string rootDir = check file:parentPath(currentDir); string ballerinaTestDir = string `${rootDir}${sep}ballerina-tests${sep}tests`; string bal = string `${rootDir}${sep}target${sep}ballerina-runtime${sep}bin${sep}bal`; +string artifactsHostPath = string `${ballerinaTestDir}${sep}generated_artifacts`; + +// --------------------------------------------------------------------------- +// Docker container management — mirrors the module-ballerina-sql pattern +// --------------------------------------------------------------------------- + +// Start a catalog API mock server container on the given port. +// Mounts the shared generated_artifacts directory so the test process can +// read the artifact JSON files written by the container. +function initializeMockServerContainer(string containerName, int port, int artifactIndex, + boolean unauthorized = false) returns error? { + if !check file:test(artifactsHostPath, file:EXISTS) { + check file:createDir(artifactsHostPath); + } + + os:Process result = check os:exec({ + value: "docker", + arguments: [ + "run", + "--rm", + "-d", + "--name", containerName, + "-e", string `PORT=${port}`, + "-e", string `ARTIFACT_INDEX=${artifactIndex}`, + "-e", string `UNAUTHORIZED=${unauthorized}`, + "-v", string `${toDockerPath(artifactsHostPath)}:/artifacts`, + "-p", string `${port}:${port}`, + "ballerinax/apim-catalog-mock-server:latest" + ] + }); + + int exitCode = check result.waitForExit(); + if exitCode > 0 { + return error(string `Docker container '${containerName}' failed to start. Exit code: ${exitCode}`); + } + io:println(string `Docker container '${containerName}' created, waiting for readiness...`); + runtime:sleep(DOCKER_START_TIMEOUT); + + // Health-check the mock server via GET /health + int counter = 0; + while counter < DOCKER_RETRY_COUNT { + http:Client|error httpClient = new (string `http://localhost:${port}`, {timeout: 3}); + if httpClient is http:Client { + http:Response|error response = httpClient->get("/health"); + if response is http:Response && response.statusCode == 200 { + break; + } + } + counter += 1; + runtime:sleep(DOCKER_RETRY_DELAY); + } + test:assertNotEquals(counter, DOCKER_RETRY_COUNT, + string `Docker container '${containerName}' health check exceeded timeout!`); + io:println(string `Docker container '${containerName}' is ready on port ${port}.`); +} + +// Start the OAuth2 token server container (HTTPS). +// Mounts the test keystore into the container. +function initializeTokenServerContainer(string containerName, int port) returns error? { + string keystoreAbsPath = check file:getAbsolutePath( + string `${ballerinaTestDir}${sep}resources${sep}ballerinaKeystore.p12`); + + os:Process result = check os:exec({ + value: "docker", + arguments: [ + "run", + "--rm", + "-d", + "--name", containerName, + "-e", string `PORT=${port}`, + "-e", "KEYSTORE_PATH=/resources/ballerinaKeystore.p12", + "-e", "KEYSTORE_PASSWORD=ballerina", + "-v", string `${toDockerPath(keystoreAbsPath)}:/resources/ballerinaKeystore.p12:ro`, + "-p", string `${port}:${port}`, + "ballerinax/apim-catalog-token-server:latest" + ] + }); + + int exitCode = check result.waitForExit(); + if exitCode > 0 { + return error(string `Docker container '${containerName}' failed to start. Exit code: ${exitCode}`); + } + io:println(string `Docker container '${containerName}' created, waiting for readiness...`); + runtime:sleep(DOCKER_START_TIMEOUT); + + // Health-check via HTTPS (skip certificate verification for the self-signed test cert) + int counter = 0; + while counter < DOCKER_RETRY_COUNT { + http:Client|error httpClient = new (string `https://localhost:${port}`, { + secureSocket: {enable: false}, + timeout: 3 + }); + if httpClient is http:Client { + http:Response|error response = httpClient->post("/oauth2/token", {}); + if response is http:Response && response.statusCode == 200 { + break; + } + } + counter += 1; + runtime:sleep(DOCKER_RETRY_DELAY); + } + test:assertNotEquals(counter, DOCKER_RETRY_COUNT, + string `Docker container '${containerName}' health check exceeded timeout!`); + io:println(string `Docker container '${containerName}' is ready on port ${port}.`); +} + +// Stop and remove a Docker container. +function cleanDockerContainer(string containerName) returns error? { + os:Process result = check os:exec({ + value: "docker", + arguments: ["stop", containerName] + }); + int exitCode = check result.waitForExit(); + test:assertExactEquals(exitCode, 0, string `Docker container '${containerName}' stop failed!`); + io:println(string `Cleaned docker container '${containerName}'.`); +} + +// --------------------------------------------------------------------------- +// Test helper utilities +// --------------------------------------------------------------------------- function runOSCommand(string projName, string projPath, string configFilePath) returns error? { os:Process|os:Error process = os:exec({ @@ -78,9 +203,8 @@ function traverseMultiPartRequest(http:Request req) returns ServiceSchema|error }; } -function returnDummyResponse(string message = "Return 500 Status code after completing the task") +function returnDummyResponse(string message = "Return 500 Status code after completing the task") returns http:InternalServerError { - // Return error to terminate the test process return { body: { message @@ -89,13 +213,14 @@ function returnDummyResponse(string message = "Return 500 Status code after comp } function readAndValidateArtifacts(string file, int index, string basePathPrefix = "/sales") { + string artifactPath = string `${ballerinaTestDir}${sep}generated_artifacts`; json|error artifactJson = io:fileReadJson(string `${artifactPath}${sep}${file}`); if artifactJson is error { test:assertFail(string `Error while reading the ${file}`); } - ServiceSchema[]|error artifacts = artifactJson.cloneWithType(); + map|error artifacts = artifactJson.cloneWithType(); if artifacts is error { test:assertFail(string `Error while cloning the artifacts in ${file}`); } @@ -103,7 +228,7 @@ function readAndValidateArtifacts(string file, int index, string basePathPrefix validateArtifacts(artifacts, index, basePathPrefix); } -function validateArtifacts(ServiceSchema[] artifacts, int index, string basePathPrefix) { +function validateArtifacts(map artifacts, int index, string basePathPrefix) { string assertPath = string `${ballerinaTestDir}${sep}asserts`; string assertFile = string `assert_${index}.json`; json|error assertJson = io:fileReadJson(string `${assertPath}${sep}${assertFile}`); @@ -118,15 +243,14 @@ function validateArtifacts(ServiceSchema[] artifacts, int index, string basePath string `Error while cloning the assertArtifacts in ${assertFile}, error = ${assertArtifacts.message()}, detail = ${assertArtifacts.detail().toBalString()}` ); } - - foreach ServiceSchema schema in artifacts { - string serviceKey = (schema.serviceMetadata.serviceKey); + + foreach [string, ServiceSchema] [serviceKey, schema] in artifacts.entries() { if !assertArtifacts.hasKey(serviceKey) { test:assertFail(string `Service key ${serviceKey} not found in assert file ${assertFile}`); } ServiceSchema assertSchema = assertArtifacts.get(serviceKey); - if isNameStartWithSamePrefix(assertSchema.serviceMetadata.name, + if isNameStartWithSamePrefix(assertSchema.serviceMetadata.name, schema.serviceMetadata.name, basePathPrefix) { assertSchema.serviceMetadata.name = schema.serviceMetadata.name; test:assertEquals(assertSchema, schema); @@ -139,3 +263,9 @@ function validateArtifacts(ServiceSchema[] artifacts, int index, string basePath function isNameStartWithSamePrefix(string assertSchemaName, string schemaName, string basePathPrefix) returns boolean { return assertSchemaName.startsWith(basePathPrefix) && schemaName.startsWith(basePathPrefix); } + +// Convert a host path to a Docker-compatible volume mount path. +// On Windows, Docker requires forward slashes in volume mount paths. +function toDockerPath(string path) returns string { + return re`\\`.replaceAll(path, "/"); +} diff --git a/ballerina-tests/token-server/Ballerina.toml b/ballerina-tests/token-server/Ballerina.toml new file mode 100644 index 0000000..9687758 --- /dev/null +++ b/ballerina-tests/token-server/Ballerina.toml @@ -0,0 +1,5 @@ +[package] +org = "ballerinax" +name = "apim_catalog_token_server" +version = "1.0.0" +distribution = "2201.13.1" diff --git a/ballerina-tests/token-server/Dockerfile b/ballerina-tests/token-server/Dockerfile new file mode 100644 index 0000000..1cf128e --- /dev/null +++ b/ballerina-tests/token-server/Dockerfile @@ -0,0 +1,34 @@ +# Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com). +# +# WSO2 LLC. licenses this file to you 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. + +# Stage 1: Build the Ballerina fat JAR +FROM ballerina/ballerina:2201.13.1 AS builder +WORKDIR /app +COPY . . +RUN bal build + +# Stage 2: Minimal runtime image +FROM eclipse-temurin:21-jre +WORKDIR /app +COPY --from=builder /app/target/bin/apim_catalog_token_server.jar /app/token-server.jar + +ENV PORT=9444 +ENV KEYSTORE_PATH=/resources/ballerinaKeystore.p12 +ENV KEYSTORE_PASSWORD=ballerina + +EXPOSE ${PORT} + +ENTRYPOINT ["java", "-jar", "/app/token-server.jar"] diff --git a/ballerina-tests/token-server/main.bal b/ballerina-tests/token-server/main.bal new file mode 100644 index 0000000..f9a8db1 --- /dev/null +++ b/ballerina-tests/token-server/main.bal @@ -0,0 +1,65 @@ +// Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com). +// +// WSO2 LLC. licenses this file to you 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. + +import ballerina/http; +import ballerina/lang.runtime; +import ballerina/log; +import ballerina/os; + +const ACCESS_TOKEN = "2YotnFZFEjr1zCsicMWpAA"; + +public function main() returns error? { + string portStr = os:getEnv("PORT"); + string keystorePath = os:getEnv("KEYSTORE_PATH"); + string keystorePassword = os:getEnv("KEYSTORE_PASSWORD"); + + int port = portStr.trim() == "" ? 9444 : check int:fromString(portStr.trim()); + string ksPath = keystorePath.trim() == "" ? "/resources/ballerinaKeystore.p12" : keystorePath.trim(); + string ksPassword = keystorePassword.trim() == "" ? "ballerina" : keystorePassword.trim(); + + http:Listener tokenListener = check new (port, { + secureSocket: { + key: { + path: ksPath, + password: ksPassword + } + } + }); + + http:Service svc = service object { + resource function post token(http:Request req) returns http:Ok { + return { + body: { + "access_token": ACCESS_TOKEN, + "token_type": "example", + "expires_in": 3600, + "example_parameter": "example_value" + } + }; + } + + resource function post introspect(http:Request request) returns http:Ok { + return { + body: {"active": true, "exp": 3600, "scp": "write update"} + }; + } + }; + + check tokenListener.attach(svc, "/oauth2"); + check tokenListener.'start(); + runtime:registerListener(tokenListener); + log:printInfo(string `Token server started on port ${port}`); +} diff --git a/ballerina/Ballerina.toml b/ballerina/Ballerina.toml index 706b70a..5ad43d8 100644 --- a/ballerina/Ballerina.toml +++ b/ballerina/Ballerina.toml @@ -1,8 +1,8 @@ [package] org = "ballerinax" name = "wso2.apim.catalog" -version = "1.1.2" -distribution = "2201.12.0" +version = "1.2.0" +distribution = "2201.13.1" [platform.java21] graalvmCompatible = true @@ -10,8 +10,8 @@ graalvmCompatible = true [[platform.java21.dependency]] groupId = "io.ballerina" artifactId = "wso2.apim.catalog-native" -version = "1.1.2" -path = "../native/build/libs/wso2.apim.catalog-native-1.1.2.jar" +version = "1.2.0" +path = "../native/build/libs/wso2.apim.catalog-native-1.2.0-SNAPSHOT.jar" [[platform.java21.dependency]] groupId = "com.fasterxml.jackson.core" diff --git a/ballerina/CompilerPlugin.toml b/ballerina/CompilerPlugin.toml index a0cced4..5d4e47f 100644 --- a/ballerina/CompilerPlugin.toml +++ b/ballerina/CompilerPlugin.toml @@ -3,10 +3,10 @@ id = "wso2.apim.catalog-compiler-plugin" class = "io.ballerina.wso2.apim.catalog.ServiceCatalogCompilerPlugin" [[dependency]] -path = "../compiler-plugin/build/libs/wso2.apim.catalog-compiler-plugin-1.1.2.jar" +path = "../compiler-plugin/build/libs/wso2.apim.catalog-compiler-plugin-1.2.0-SNAPSHOT.jar" [[dependency]] -path = "lib/ballerina-to-openapi-2.0.3.jar" +path = "lib/ballerina-to-openapi-2.4.0.jar" [platform.java21] graalvmCompatible = true diff --git a/ballerina/Dependencies.toml b/ballerina/Dependencies.toml index e7c5a54..080206a 100644 --- a/ballerina/Dependencies.toml +++ b/ballerina/Dependencies.toml @@ -5,7 +5,7 @@ [ballerina] dependencies-toml-version = "2" -distribution-version = "2201.12.0" +distribution-version = "2201.13.1" [[package]] org = "ballerina" @@ -44,7 +44,7 @@ modules = [ [[package]] org = "ballerina" name = "crypto" -version = "2.9.0" +version = "2.10.1" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "time"} @@ -53,7 +53,7 @@ dependencies = [ [[package]] org = "ballerina" name = "data.jsondata" -version = "1.1.0" +version = "1.1.3" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "lang.object"} @@ -73,7 +73,7 @@ dependencies = [ [[package]] org = "ballerina" name = "http" -version = "2.14.0" +version = "2.15.4" dependencies = [ {org = "ballerina", name = "auth"}, {org = "ballerina", name = "cache"}, @@ -123,7 +123,7 @@ modules = [ [[package]] org = "ballerina" name = "jwt" -version = "2.15.0" +version = "2.15.1" dependencies = [ {org = "ballerina", name = "cache"}, {org = "ballerina", name = "crypto"}, @@ -212,21 +212,18 @@ dependencies = [ [[package]] org = "ballerina" name = "log" -version = "2.12.0" +version = "2.16.1" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "lang.value"}, {org = "ballerina", name = "observe"} ] -modules = [ - {org = "ballerina", packageName = "log", moduleName = "log"} -] [[package]] org = "ballerina" name = "mime" -version = "2.12.0" +version = "2.12.1" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -240,7 +237,7 @@ modules = [ [[package]] org = "ballerina" name = "oauth2" -version = "2.14.0" +version = "2.15.0" dependencies = [ {org = "ballerina", name = "cache"}, {org = "ballerina", name = "crypto"}, @@ -256,7 +253,7 @@ modules = [ [[package]] org = "ballerina" name = "observe" -version = "1.5.0" +version = "1.7.1" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -264,7 +261,7 @@ dependencies = [ [[package]] org = "ballerina" name = "os" -version = "1.10.0" +version = "1.10.1" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"} @@ -273,16 +270,17 @@ dependencies = [ [[package]] org = "ballerina" name = "task" -version = "2.7.0" +version = "2.11.1" dependencies = [ {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "time"} + {org = "ballerina", name = "time"}, + {org = "ballerina", name = "uuid"} ] [[package]] org = "ballerina" name = "time" -version = "2.7.0" +version = "2.8.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -290,7 +288,7 @@ dependencies = [ [[package]] org = "ballerina" name = "url" -version = "2.6.0" +version = "2.6.1" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -298,15 +296,25 @@ modules = [ {org = "ballerina", packageName = "url", moduleName = "url"} ] +[[package]] +org = "ballerina" +name = "uuid" +version = "1.10.0" +dependencies = [ + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.int"}, + {org = "ballerina", name = "time"} +] + [[package]] org = "ballerinax" name = "wso2.apim.catalog" -version = "1.1.2" +version = "1.2.0" dependencies = [ {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "http"}, {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "log"}, {org = "ballerina", name = "mime"}, {org = "ballerina", name = "oauth2"}, {org = "ballerina", name = "url"} diff --git a/ballerina/service.bal b/ballerina/service.bal index 09fd94d..f7a2a42 100644 --- a/ballerina/service.bal +++ b/ballerina/service.bal @@ -45,6 +45,16 @@ Client apimClient = check new (serviceUrl = serviceUrl, config = { secureSocket: getServerCert(serverCert) }); +// function publishArtifacts(ServiceArtifact[] artifacts) returns error? { +// error? lastError = (); +// foreach ServiceArtifact artifact in artifacts { +// Service|error result = publishOrUpdateService(artifact); +// if result is error { +// lastError = result; +// } +// } +// return lastError; +// } function publishArtifacts(ServiceArtifact[] artifacts) returns error? { foreach ServiceArtifact artifact in artifacts { _ = check publishOrUpdateService(artifact); diff --git a/build-config/resources/Ballerina.toml b/build-config/resources/Ballerina.toml index abc04a2..df4f17e 100644 --- a/build-config/resources/Ballerina.toml +++ b/build-config/resources/Ballerina.toml @@ -2,7 +2,7 @@ org = "ballerinax" name = "wso2.apim.catalog" version = "@toml.version@" -distribution = "2201.12.0" +distribution = "2201.13.1" [platform.java21] graalvmCompatible = true diff --git a/build.gradle b/build.gradle index 1e793c9..ec327a6 100644 --- a/build.gradle +++ b/build.gradle @@ -99,6 +99,7 @@ subprojects { // Transitive dependencies ballerinaStdLibs "io.ballerina.stdlib:os-ballerina:${stdlibOsVersion}" ballerinaStdLibs "io.ballerina.stdlib:task-ballerina:${stdlibTaskVersion}" + ballerinaStdLibs "io.ballerina.stdlib:uuid-ballerina:${stdlibUuidVersion}" } } @@ -119,7 +120,7 @@ release { } build.dependsOn("${packageName}-ballerina:build") -// build.dependsOn("${packageName}-ballerina-tests:build") +build.dependsOn("${packageName}-ballerina-tests:build") publishToMavenLocal.dependsOn build publish.dependsOn build diff --git a/gradle.properties b/gradle.properties index 56146e2..ccf92c3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ group=io.ballerina.wso2.apim.catalog -version=1.1.3-SNAPSHOT +version=1.2.0-SNAPSHOT -ballerinaLangVersion=2201.12.0 +ballerinaLangVersion=2201.13.1 puppycrawlCheckstyleVersion=10.12.0 checkstyleToolVersion=10.12.0 @@ -18,27 +18,28 @@ fasterxmlJacksonCoreVersion=2.15.2 commonsVersion=2.15.1 stdlibIoVersion=1.8.0 -stdlibTimeVersion=2.7.0 -stdlibUrlVersion=2.6.0 +stdlibTimeVersion=2.8.0 +stdlibUrlVersion=2.6.1 +stdlibUuidVersion=1.10.0 stdlibConstraintVersion=1.7.0 -stdlibOsVersion=1.10.0 -stdlibTaskVersion=2.7.0 -stdlibLogVersion=2.12.0 -stdlibCryptoVersion=2.9.0 +stdlibOsVersion=1.10.1 +stdlibTaskVersion=2.11.1 +stdlibLogVersion=2.16.1 +stdlibCryptoVersion=2.10.1 stdlibFileVersion=1.12.0 -stdlibMimeVersion=2.12.0 +stdlibMimeVersion=2.12.1 stdlibCacheVersion=3.10.0 stdlibAuthVersion=2.14.0 -stdlibJwtVersion=2.15.0 -stdlibOAuth2Version=2.14.0 -stdlibDataJsonDataVersion=1.1.0 +stdlibJwtVersion=2.15.1 +stdlibOAuth2Version=2.15.0 +stdlibDataJsonDataVersion=1.1.3 -stdlibHttpVersion=2.14.0 +stdlibHttpVersion=2.15.4 -openapiVersion=2.0.3 +openapiVersion=2.4.0 -observeVersion=1.5.0 -observeInternalVersion=1.5.0 +observeVersion=1.7.1-20260213-094900-5124eb4 +observeInternalVersion=1.7.1-20260213-102300-6dc6d7a diff --git a/gradlew.bat b/gradlew.bat index ac1b06f..107acd3 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,89 +1,89 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/native/src/main/java/io/ballerina/wso2/apim/catalog/ServiceCatalog.java b/native/src/main/java/io/ballerina/wso2/apim/catalog/ServiceCatalog.java index 087bf99..4bd2abd 100644 --- a/native/src/main/java/io/ballerina/wso2/apim/catalog/ServiceCatalog.java +++ b/native/src/main/java/io/ballerina/wso2/apim/catalog/ServiceCatalog.java @@ -41,8 +41,9 @@ import java.util.Objects; import static io.ballerina.wso2.apim.catalog.utils.Constants.BALLERINA; +import static io.ballerina.wso2.apim.catalog.utils.Constants.CONTROL_PLANE_PACKAGE_NAME; import static io.ballerina.wso2.apim.catalog.utils.Constants.HTTP_PACKAGE_NAME; -import static io.ballerina.wso2.apim.catalog.utils.Constants.SLASH; +import static io.ballerina.wso2.apim.catalog.utils.Constants.MODULE_NAME; import static io.ballerina.wso2.apim.catalog.utils.Utils.createMd5Hash; import static io.ballerina.wso2.apim.catalog.utils.Utils.generateBasePath; import static io.ballerina.wso2.apim.catalog.utils.Utils.getDefinitionType; @@ -52,13 +53,15 @@ import static io.ballerina.wso2.apim.catalog.utils.Utils.getOpenApiDefinition; import static io.ballerina.wso2.apim.catalog.utils.Utils.getSecurityType; import static io.ballerina.wso2.apim.catalog.utils.Constants.COLON; +import static io.ballerina.wso2.apim.catalog.utils.Constants.HTTP_PREFIX; +import static io.ballerina.wso2.apim.catalog.utils.Constants.LOCALHOST; +import static io.ballerina.wso2.apim.catalog.utils.Constants.SLASH; import static io.ballerina.wso2.apim.catalog.utils.Constants.CONFIG; import static io.ballerina.wso2.apim.catalog.utils.Constants.DEFAULT_STRING; import static io.ballerina.wso2.apim.catalog.utils.Constants.DEFINITION_FILE_CONTENT; import static io.ballerina.wso2.apim.catalog.utils.Constants.DEFINITION_TYPE; import static io.ballerina.wso2.apim.catalog.utils.Constants.DEFINITION_URL; import static io.ballerina.wso2.apim.catalog.utils.Constants.DESCRIPTION; -import static io.ballerina.wso2.apim.catalog.utils.Constants.LOCALHOST; import static io.ballerina.wso2.apim.catalog.utils.Constants.MD5; import static io.ballerina.wso2.apim.catalog.utils.Constants.MUTUAL_SSL; import static io.ballerina.wso2.apim.catalog.utils.Constants.MUTUAL_SSL_ENABLED; @@ -94,6 +97,10 @@ public static BArray getArtifacts(Environment env) { if (module != null && module.equals(currentModule)) { continue; } + if (module != null && MODULE_NAME.equals(module.getOrg()) + && CONTROL_PLANE_PACKAGE_NAME.equals(module.getName())) { + continue; + } Object listenerDetails = artifact.getDetail(Constants.LISTENERS); if (!isHttpServiceNode(listenerDetails)) { @@ -179,15 +186,13 @@ private static void updateServiceName(BMap artifactValues, Http StringUtils.fromString(httpServiceConfig.basePath)); } - private static void updateServiceUrl(BMap artifactValues, HttpServiceConfig httpServiceConfig) { + private static void updateServiceUrl(BMap artifactValues, HttpServiceConfig httpServiceConfig) { String basePathConfig = httpServiceConfig.basePath; String basePath = basePathConfig.equals(SLASH) ? "" : basePathConfig; boolean isLocalHost = Objects.equals(httpServiceConfig.host, LOCALHOST); - artifactValues.put(StringUtils.fromString(SERVICE_URL), - StringUtils.fromString(httpServiceConfig.host + - (isLocalHost ? (COLON + httpServiceConfig.port) : "") + basePath)); - artifactValues.put(StringUtils.fromString(DEFINITION_URL), - StringUtils.fromString(httpServiceConfig.definitionUrl)); + String serviceUrl = httpServiceConfig.host + (isLocalHost ? (COLON + httpServiceConfig.port) : "") + basePath; + artifactValues.put(StringUtils.fromString(SERVICE_URL), StringUtils.fromString(serviceUrl)); + artifactValues.put(StringUtils.fromString(DEFINITION_URL), StringUtils.fromString(serviceUrl)); } private static HttpServiceConfig updateHostAndPortAndBasePath(Object listenerDetails, Object attachPointDetails, @@ -254,16 +259,17 @@ private static void updateModuleAnnotationDetails(BMap moduleAn } static class HttpServiceConfig { + String basePath; String host; String port; - String basePath; String definitionUrl; HttpServiceConfig(String host, String port, String basePath) { + this.basePath = basePath; this.host = host; this.port = port; - this.basePath = basePath; - this.definitionUrl = host + COLON + port + basePath; + String hostWithoutProtocol = host.startsWith(HTTP_PREFIX) ? host.substring(HTTP_PREFIX.length()) : host; + this.definitionUrl = hostWithoutProtocol + COLON + port + basePath; } } } diff --git a/native/src/main/java/io/ballerina/wso2/apim/catalog/utils/Constants.java b/native/src/main/java/io/ballerina/wso2/apim/catalog/utils/Constants.java index bcfdf18..413bf4b 100644 --- a/native/src/main/java/io/ballerina/wso2/apim/catalog/utils/Constants.java +++ b/native/src/main/java/io/ballerina/wso2/apim/catalog/utils/Constants.java @@ -38,6 +38,7 @@ public final class Constants { public static final String DEFINITION_URL = "definitionUrl"; public static final String SLASH = "/"; public static final String SERVICE_CATALOG_PACKAGE_NAME = "wso2.apim.catalog"; + public static final String CONTROL_PLANE_PACKAGE_NAME = "wso2.controlplane"; public static final String SERVICE_CATALOG_METADATA_ANNOTATION_IDENTIFIER = "ServiceCatalogConfig"; public static final String COLON = ":"; public static final String MODULE_NAME = "ballerinax"; @@ -46,8 +47,9 @@ public final class Constants { public static final String COMPLETE_MODULE_NAME = MODULE_NAME + SLASH + SERVICE_CATALOG_PACKAGE_NAME; public static final String HTTP_MODULE_NAME = "ballerina/http"; public static final String HTTP_ANNOTATION_NAME = "ServiceConfig"; + public static final String HTTP_PREFIX = "http://"; public static final String HOST = "host"; - public static final String LOCALHOST = "http://localhost"; + public static final String LOCALHOST = "http://localhost"; public static final String PORT = "port"; public static final String OAS3 = "OAS3"; public static final String BASIC = "BASIC"; diff --git a/native/src/main/java/io/ballerina/wso2/apim/catalog/utils/Utils.java b/native/src/main/java/io/ballerina/wso2/apim/catalog/utils/Utils.java index 9d9639b..aeb15d3 100644 --- a/native/src/main/java/io/ballerina/wso2/apim/catalog/utils/Utils.java +++ b/native/src/main/java/io/ballerina/wso2/apim/catalog/utils/Utils.java @@ -36,6 +36,7 @@ import static io.ballerina.wso2.apim.catalog.utils.Constants.COMPLETE_MODULE_NAME; import static io.ballerina.wso2.apim.catalog.utils.Constants.HOST; import static io.ballerina.wso2.apim.catalog.utils.Constants.HTTP_ANNOTATION_NAME; +import static io.ballerina.wso2.apim.catalog.utils.Constants.HTTP_PREFIX; import static io.ballerina.wso2.apim.catalog.utils.Constants.HTTP_MODULE_NAME; import static io.ballerina.wso2.apim.catalog.utils.Constants.JWT_AUTH; import static io.ballerina.wso2.apim.catalog.utils.Constants.LOCALHOST; @@ -91,7 +92,7 @@ public static String getHostname(BMap annotation) { if (annotation == null || !annotation.containsKey(StringUtils.fromString(HOST))) { return LOCALHOST; } - return StringUtils.getStringValue(annotation.get(StringUtils.fromString(HOST))); + return HTTP_PREFIX + StringUtils.getStringValue(annotation.get(StringUtils.fromString(HOST))); } public static OpenAPI getOpenApiDefinition(BMap annotation) { diff --git a/settings.gradle b/settings.gradle index c42aa12..af1b268 100644 --- a/settings.gradle +++ b/settings.gradle @@ -36,14 +36,14 @@ rootProject.name = 'ballerinax-wso2.apim.catalog' include ':checkstyle' include ':wso2.apim.catalog-native' include ':wso2.apim.catalog-compiler-plugin' -// include ':wso2.apim.catalog-ballerina-tests' +include ':wso2.apim.catalog-ballerina-tests' include ':wso2.apim.catalog-ballerina' project(':checkstyle').projectDir = file("build-config${File.separator}checkstyle") project(':wso2.apim.catalog-native').projectDir = file('native') project(':wso2.apim.catalog-compiler-plugin').projectDir = file('compiler-plugin') project(':wso2.apim.catalog-ballerina').projectDir = file('ballerina') -// project(':wso2.apim.catalog-ballerina-tests').projectDir = file("ballerina-tests") +project(':wso2.apim.catalog-ballerina-tests').projectDir = file("ballerina-tests") gradleEnterprise { buildScan { diff --git a/test-resources/sample_project_0/Ballerina.toml b/test-resources/sample_project_0/Ballerina.toml index 4d201f1..a605457 100644 --- a/test-resources/sample_project_0/Ballerina.toml +++ b/test-resources/sample_project_0/Ballerina.toml @@ -7,7 +7,7 @@ distribution = "2201.10.0" [[dependency]] org = "ballerinax" name = "wso2.apim.catalog" -version = "1.1.0" +version = "1.2.0" repository="local" [build-options] diff --git a/test-resources/sample_project_0/Dependencies.toml b/test-resources/sample_project_0/Dependencies.toml index 1cb5b83..264cb2b 100644 --- a/test-resources/sample_project_0/Dependencies.toml +++ b/test-resources/sample_project_0/Dependencies.toml @@ -5,7 +5,7 @@ [ballerina] dependencies-toml-version = "2" -distribution-version = "2201.12.0" +distribution-version = "2201.13.1" [[package]] org = "admin" @@ -53,7 +53,7 @@ dependencies = [ [[package]] org = "ballerina" name = "crypto" -version = "2.9.0" +version = "2.10.1" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "time"} @@ -62,7 +62,7 @@ dependencies = [ [[package]] org = "ballerina" name = "data.jsondata" -version = "1.1.0" +version = "1.1.3" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "lang.object"} @@ -82,7 +82,7 @@ dependencies = [ [[package]] org = "ballerina" name = "http" -version = "2.14.0" +version = "2.15.4" dependencies = [ {org = "ballerina", name = "auth"}, {org = "ballerina", name = "cache"}, @@ -129,7 +129,7 @@ version = "0.0.0" [[package]] org = "ballerina" name = "jwt" -version = "2.15.0" +version = "2.15.1" dependencies = [ {org = "ballerina", name = "cache"}, {org = "ballerina", name = "crypto"}, @@ -218,7 +218,7 @@ dependencies = [ [[package]] org = "ballerina" name = "log" -version = "2.12.0" +version = "2.16.1" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -229,7 +229,7 @@ dependencies = [ [[package]] org = "ballerina" name = "mime" -version = "2.12.0" +version = "2.12.1" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -240,7 +240,7 @@ dependencies = [ [[package]] org = "ballerina" name = "oauth2" -version = "2.14.0" +version = "2.15.0" dependencies = [ {org = "ballerina", name = "cache"}, {org = "ballerina", name = "crypto"}, @@ -253,7 +253,7 @@ dependencies = [ [[package]] org = "ballerina" name = "observe" -version = "1.5.0" +version = "1.7.1" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -261,7 +261,7 @@ dependencies = [ [[package]] org = "ballerina" name = "os" -version = "1.10.0" +version = "1.10.1" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"} @@ -270,16 +270,17 @@ dependencies = [ [[package]] org = "ballerina" name = "task" -version = "2.7.0" +version = "2.11.1" dependencies = [ {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "time"} + {org = "ballerina", name = "time"}, + {org = "ballerina", name = "uuid"} ] [[package]] org = "ballerina" name = "time" -version = "2.7.0" +version = "2.8.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -287,20 +288,30 @@ dependencies = [ [[package]] org = "ballerina" name = "url" -version = "2.6.0" +version = "2.6.1" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] +[[package]] +org = "ballerina" +name = "uuid" +version = "1.10.0" +dependencies = [ + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.int"}, + {org = "ballerina", name = "time"} +] + [[package]] org = "ballerinax" name = "wso2.apim.catalog" -version = "1.1.0" +version = "1.2.0" dependencies = [ {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "http"}, {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "log"}, {org = "ballerina", name = "mime"}, {org = "ballerina", name = "oauth2"}, {org = "ballerina", name = "url"} diff --git a/test-resources/sample_project_1/Ballerina.toml b/test-resources/sample_project_1/Ballerina.toml index 4d201f1..a605457 100644 --- a/test-resources/sample_project_1/Ballerina.toml +++ b/test-resources/sample_project_1/Ballerina.toml @@ -7,7 +7,7 @@ distribution = "2201.10.0" [[dependency]] org = "ballerinax" name = "wso2.apim.catalog" -version = "1.1.0" +version = "1.2.0" repository="local" [build-options] diff --git a/test-resources/sample_project_1/Dependencies.toml b/test-resources/sample_project_1/Dependencies.toml index 7bbe26f..f553823 100644 --- a/test-resources/sample_project_1/Dependencies.toml +++ b/test-resources/sample_project_1/Dependencies.toml @@ -5,7 +5,7 @@ [ballerina] dependencies-toml-version = "2" -distribution-version = "2201.12.0" +distribution-version = "2201.13.1" [[package]] org = "admin" @@ -55,7 +55,7 @@ dependencies = [ [[package]] org = "ballerina" name = "crypto" -version = "2.9.0" +version = "2.10.1" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "time"} @@ -64,7 +64,7 @@ dependencies = [ [[package]] org = "ballerina" name = "data.jsondata" -version = "1.1.0" +version = "1.1.3" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "lang.object"} @@ -84,7 +84,7 @@ dependencies = [ [[package]] org = "ballerina" name = "graphql" -version = "1.16.1" +version = "1.17.0" dependencies = [ {org = "ballerina", name = "auth"}, {org = "ballerina", name = "cache"}, @@ -116,7 +116,7 @@ modules = [ [[package]] org = "ballerina" name = "http" -version = "2.14.0" +version = "2.15.4" dependencies = [ {org = "ballerina", name = "auth"}, {org = "ballerina", name = "cache"}, @@ -163,7 +163,7 @@ version = "0.0.0" [[package]] org = "ballerina" name = "jwt" -version = "2.15.0" +version = "2.15.1" dependencies = [ {org = "ballerina", name = "cache"}, {org = "ballerina", name = "crypto"}, @@ -252,7 +252,7 @@ dependencies = [ [[package]] org = "ballerina" name = "log" -version = "2.12.0" +version = "2.16.1" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -263,7 +263,7 @@ dependencies = [ [[package]] org = "ballerina" name = "mime" -version = "2.12.0" +version = "2.12.1" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -274,7 +274,7 @@ dependencies = [ [[package]] org = "ballerina" name = "oauth2" -version = "2.14.0" +version = "2.15.0" dependencies = [ {org = "ballerina", name = "cache"}, {org = "ballerina", name = "crypto"}, @@ -287,7 +287,7 @@ dependencies = [ [[package]] org = "ballerina" name = "observe" -version = "1.5.0" +version = "1.7.1" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -295,7 +295,7 @@ dependencies = [ [[package]] org = "ballerina" name = "os" -version = "1.10.0" +version = "1.10.1" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"} @@ -304,16 +304,17 @@ dependencies = [ [[package]] org = "ballerina" name = "task" -version = "2.7.0" +version = "2.11.1" dependencies = [ {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "time"} + {org = "ballerina", name = "time"}, + {org = "ballerina", name = "uuid"} ] [[package]] org = "ballerina" name = "time" -version = "2.7.0" +version = "2.8.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -321,7 +322,7 @@ dependencies = [ [[package]] org = "ballerina" name = "url" -version = "2.6.0" +version = "2.6.1" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -340,7 +341,7 @@ dependencies = [ [[package]] org = "ballerina" name = "websocket" -version = "2.14.0" +version = "2.15.1" dependencies = [ {org = "ballerina", name = "auth"}, {org = "ballerina", name = "constraint"}, @@ -363,12 +364,11 @@ modules = [ [[package]] org = "ballerinax" name = "wso2.apim.catalog" -version = "1.1.0" +version = "1.2.0" dependencies = [ {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "http"}, {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "log"}, {org = "ballerina", name = "mime"}, {org = "ballerina", name = "oauth2"}, {org = "ballerina", name = "url"} diff --git a/test-resources/sample_project_10/Ballerina.toml b/test-resources/sample_project_10/Ballerina.toml index f7f1402..585bd39 100644 --- a/test-resources/sample_project_10/Ballerina.toml +++ b/test-resources/sample_project_10/Ballerina.toml @@ -7,7 +7,7 @@ distribution = "2201.10.0" [[dependency]] org = "ballerinax" name = "wso2.apim.catalog" -version = "1.1.0" +version = "1.2.0" repository="local" [build-options] diff --git a/test-resources/sample_project_10/Dependencies.toml b/test-resources/sample_project_10/Dependencies.toml index 531cbba..9106fbd 100644 --- a/test-resources/sample_project_10/Dependencies.toml +++ b/test-resources/sample_project_10/Dependencies.toml @@ -5,7 +5,7 @@ [ballerina] dependencies-toml-version = "2" -distribution-version = "2201.10.0" +distribution-version = "2201.13.1" [[package]] org = "admin" @@ -22,7 +22,7 @@ modules = [ [[package]] org = "ballerina" name = "auth" -version = "2.12.0" +version = "2.14.0" dependencies = [ {org = "ballerina", name = "crypto"}, {org = "ballerina", name = "jballerina.java"}, @@ -34,7 +34,7 @@ dependencies = [ [[package]] org = "ballerina" name = "cache" -version = "3.8.0" +version = "3.10.0" dependencies = [ {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "jballerina.java"}, @@ -45,7 +45,7 @@ dependencies = [ [[package]] org = "ballerina" name = "constraint" -version = "1.5.0" +version = "1.7.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -53,16 +53,25 @@ dependencies = [ [[package]] org = "ballerina" name = "crypto" -version = "2.7.2" +version = "2.10.1" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "time"} ] +[[package]] +org = "ballerina" +name = "data.jsondata" +version = "1.1.3" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.object"} +] + [[package]] org = "ballerina" name = "file" -version = "1.10.0" +version = "1.12.0" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -73,12 +82,13 @@ dependencies = [ [[package]] org = "ballerina" name = "http" -version = "2.12.1" +version = "2.15.4" dependencies = [ {org = "ballerina", name = "auth"}, {org = "ballerina", name = "cache"}, {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "data.jsondata"}, {org = "ballerina", name = "file"}, {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -105,7 +115,7 @@ modules = [ [[package]] org = "ballerina" name = "io" -version = "1.6.1" +version = "1.8.0" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "lang.value"} @@ -119,7 +129,7 @@ version = "0.0.0" [[package]] org = "ballerina" name = "jwt" -version = "2.13.0" +version = "2.15.1" dependencies = [ {org = "ballerina", name = "cache"}, {org = "ballerina", name = "crypto"}, @@ -208,7 +218,7 @@ dependencies = [ [[package]] org = "ballerina" name = "log" -version = "2.10.0" +version = "2.16.1" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -219,7 +229,7 @@ dependencies = [ [[package]] org = "ballerina" name = "mime" -version = "2.10.0" +version = "2.12.1" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -230,7 +240,7 @@ dependencies = [ [[package]] org = "ballerina" name = "oauth2" -version = "2.12.0" +version = "2.15.0" dependencies = [ {org = "ballerina", name = "cache"}, {org = "ballerina", name = "crypto"}, @@ -243,7 +253,7 @@ dependencies = [ [[package]] org = "ballerina" name = "observe" -version = "1.3.0" +version = "1.7.1" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -251,7 +261,7 @@ dependencies = [ [[package]] org = "ballerina" name = "os" -version = "1.8.0" +version = "1.10.1" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"} @@ -260,16 +270,17 @@ dependencies = [ [[package]] org = "ballerina" name = "task" -version = "2.5.0" +version = "2.11.1" dependencies = [ {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "time"} + {org = "ballerina", name = "time"}, + {org = "ballerina", name = "uuid"} ] [[package]] org = "ballerina" name = "time" -version = "2.5.0" +version = "2.8.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -277,20 +288,30 @@ dependencies = [ [[package]] org = "ballerina" name = "url" -version = "2.4.0" +version = "2.6.1" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] +[[package]] +org = "ballerina" +name = "uuid" +version = "1.10.0" +dependencies = [ + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.int"}, + {org = "ballerina", name = "time"} +] + [[package]] org = "ballerinax" name = "wso2.apim.catalog" -version = "1.1.0" +version = "1.2.0" dependencies = [ {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "http"}, {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "log"}, {org = "ballerina", name = "mime"}, {org = "ballerina", name = "oauth2"}, {org = "ballerina", name = "url"} diff --git a/test-resources/sample_project_11/Ballerina.toml b/test-resources/sample_project_11/Ballerina.toml index ca9f04a..3ec2437 100644 --- a/test-resources/sample_project_11/Ballerina.toml +++ b/test-resources/sample_project_11/Ballerina.toml @@ -7,7 +7,7 @@ distribution = "2201.10.0" [[dependency]] org = "ballerinax" name = "wso2.apim.catalog" -version = "1.1.0" +version = "1.2.0" repository="local" [build-options] diff --git a/test-resources/sample_project_11/Dependencies.toml b/test-resources/sample_project_11/Dependencies.toml index 4ba1ddc..a6b3481 100644 --- a/test-resources/sample_project_11/Dependencies.toml +++ b/test-resources/sample_project_11/Dependencies.toml @@ -5,7 +5,7 @@ [ballerina] dependencies-toml-version = "2" -distribution-version = "2201.10.0" +distribution-version = "2201.13.1" [[package]] org = "admin" @@ -22,7 +22,7 @@ modules = [ [[package]] org = "ballerina" name = "auth" -version = "2.12.0" +version = "2.14.0" dependencies = [ {org = "ballerina", name = "crypto"}, {org = "ballerina", name = "jballerina.java"}, @@ -34,7 +34,7 @@ dependencies = [ [[package]] org = "ballerina" name = "cache" -version = "3.8.0" +version = "3.10.0" dependencies = [ {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "jballerina.java"}, @@ -45,7 +45,7 @@ dependencies = [ [[package]] org = "ballerina" name = "constraint" -version = "1.5.0" +version = "1.7.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -53,16 +53,25 @@ dependencies = [ [[package]] org = "ballerina" name = "crypto" -version = "2.7.2" +version = "2.10.1" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "time"} ] +[[package]] +org = "ballerina" +name = "data.jsondata" +version = "1.1.3" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.object"} +] + [[package]] org = "ballerina" name = "file" -version = "1.10.0" +version = "1.12.0" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -73,12 +82,13 @@ dependencies = [ [[package]] org = "ballerina" name = "http" -version = "2.12.1" +version = "2.15.4" dependencies = [ {org = "ballerina", name = "auth"}, {org = "ballerina", name = "cache"}, {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "data.jsondata"}, {org = "ballerina", name = "file"}, {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -105,7 +115,7 @@ modules = [ [[package]] org = "ballerina" name = "io" -version = "1.6.1" +version = "1.8.0" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "lang.value"} @@ -119,7 +129,7 @@ version = "0.0.0" [[package]] org = "ballerina" name = "jwt" -version = "2.13.0" +version = "2.15.1" dependencies = [ {org = "ballerina", name = "cache"}, {org = "ballerina", name = "crypto"}, @@ -208,7 +218,7 @@ dependencies = [ [[package]] org = "ballerina" name = "log" -version = "2.10.0" +version = "2.16.1" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -219,7 +229,7 @@ dependencies = [ [[package]] org = "ballerina" name = "mime" -version = "2.10.0" +version = "2.12.1" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -230,7 +240,7 @@ dependencies = [ [[package]] org = "ballerina" name = "oauth2" -version = "2.12.0" +version = "2.15.0" dependencies = [ {org = "ballerina", name = "cache"}, {org = "ballerina", name = "crypto"}, @@ -243,7 +253,7 @@ dependencies = [ [[package]] org = "ballerina" name = "observe" -version = "1.3.0" +version = "1.7.1" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -251,7 +261,7 @@ dependencies = [ [[package]] org = "ballerina" name = "os" -version = "1.8.0" +version = "1.10.1" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"} @@ -260,16 +270,17 @@ dependencies = [ [[package]] org = "ballerina" name = "task" -version = "2.5.0" +version = "2.11.1" dependencies = [ {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "time"} + {org = "ballerina", name = "time"}, + {org = "ballerina", name = "uuid"} ] [[package]] org = "ballerina" name = "time" -version = "2.5.0" +version = "2.8.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -277,20 +288,30 @@ dependencies = [ [[package]] org = "ballerina" name = "url" -version = "2.4.0" +version = "2.6.1" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] +[[package]] +org = "ballerina" +name = "uuid" +version = "1.10.0" +dependencies = [ + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.int"}, + {org = "ballerina", name = "time"} +] + [[package]] org = "ballerinax" name = "wso2.apim.catalog" -version = "1.1.0" +version = "1.2.0" dependencies = [ {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "http"}, {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "log"}, {org = "ballerina", name = "mime"}, {org = "ballerina", name = "oauth2"}, {org = "ballerina", name = "url"} diff --git a/test-resources/sample_project_12/Ballerina.toml b/test-resources/sample_project_12/Ballerina.toml new file mode 100644 index 0000000..948eac8 --- /dev/null +++ b/test-resources/sample_project_12/Ballerina.toml @@ -0,0 +1,14 @@ +[package] +org = "admin" +name = "sample_project_12" +version = "0.1.0" +distribution = "2201.10.0" + +[[dependency]] +org = "ballerinax" +name = "wso2.apim.catalog" +version = "1.2.0" +repository="local" + +[build-options] +remoteManagement=true diff --git a/test-resources/sample_project_12/Dependencies.toml b/test-resources/sample_project_12/Dependencies.toml new file mode 100644 index 0000000..3c75e70 --- /dev/null +++ b/test-resources/sample_project_12/Dependencies.toml @@ -0,0 +1,342 @@ +# AUTO-GENERATED FILE. DO NOT MODIFY. + +# This file is auto-generated by Ballerina for managing dependency versions. +# It should not be modified by hand. + +[ballerina] +dependencies-toml-version = "2" +distribution-version = "2201.13.1" + +[[package]] +org = "admin" +name = "sample_project_12" +version = "0.1.0" +dependencies = [ + {org = "ballerina", name = "http"}, + {org = "ballerinax", name = "wso2.apim.catalog"}, + {org = "ballerinax", name = "wso2.controlplane"} +] +modules = [ + {org = "admin", packageName = "sample_project_12", moduleName = "sample_project_12"} +] + +[[package]] +org = "ballerina" +name = "auth" +version = "2.14.0" +dependencies = [ + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.array"}, + {org = "ballerina", name = "lang.string"}, + {org = "ballerina", name = "log"} +] + +[[package]] +org = "ballerina" +name = "cache" +version = "3.10.0" +dependencies = [ + {org = "ballerina", name = "constraint"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "task"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "constraint" +version = "1.7.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "crypto" +version = "2.10.1" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "data.jsondata" +version = "1.1.3" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.object"} +] + +[[package]] +org = "ballerina" +name = "file" +version = "1.12.0" +dependencies = [ + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "os"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "http" +version = "2.15.4" +dependencies = [ + {org = "ballerina", name = "auth"}, + {org = "ballerina", name = "cache"}, + {org = "ballerina", name = "constraint"}, + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "data.jsondata"}, + {org = "ballerina", name = "file"}, + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "jwt"}, + {org = "ballerina", name = "lang.array"}, + {org = "ballerina", name = "lang.decimal"}, + {org = "ballerina", name = "lang.int"}, + {org = "ballerina", name = "lang.regexp"}, + {org = "ballerina", name = "lang.runtime"}, + {org = "ballerina", name = "lang.string"}, + {org = "ballerina", name = "lang.value"}, + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "mime"}, + {org = "ballerina", name = "oauth2"}, + {org = "ballerina", name = "observe"}, + {org = "ballerina", name = "time"}, + {org = "ballerina", name = "url"} +] +modules = [ + {org = "ballerina", packageName = "http", moduleName = "http"}, + {org = "ballerina", packageName = "http", moduleName = "http.httpscerr"} +] + +[[package]] +org = "ballerina" +name = "io" +version = "1.8.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.value"} +] + +[[package]] +org = "ballerina" +name = "jballerina.java" +version = "0.0.0" + +[[package]] +org = "ballerina" +name = "jwt" +version = "2.15.1" +dependencies = [ + {org = "ballerina", name = "cache"}, + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.int"}, + {org = "ballerina", name = "lang.string"}, + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "lang.__internal" +version = "0.0.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.object"} +] + +[[package]] +org = "ballerina" +name = "lang.array" +version = "0.0.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.__internal"} +] + +[[package]] +org = "ballerina" +name = "lang.decimal" +version = "0.0.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "lang.int" +version = "0.0.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.__internal"}, + {org = "ballerina", name = "lang.object"} +] + +[[package]] +org = "ballerina" +name = "lang.object" +version = "0.0.0" + +[[package]] +org = "ballerina" +name = "lang.regexp" +version = "0.0.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "lang.runtime" +version = "0.0.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "lang.string" +version = "0.0.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.regexp"} +] + +[[package]] +org = "ballerina" +name = "lang.value" +version = "0.0.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "log" +version = "2.16.1" +dependencies = [ + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.value"}, + {org = "ballerina", name = "observe"} +] + +[[package]] +org = "ballerina" +name = "mime" +version = "2.12.1" +dependencies = [ + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.int"}, + {org = "ballerina", name = "log"} +] + +[[package]] +org = "ballerina" +name = "oauth2" +version = "2.15.0" +dependencies = [ + {org = "ballerina", name = "cache"}, + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "time"}, + {org = "ballerina", name = "url"} +] + +[[package]] +org = "ballerina" +name = "observe" +version = "1.7.1" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "os" +version = "1.10.1" +dependencies = [ + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "task" +version = "2.11.1" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "time"}, + {org = "ballerina", name = "uuid"} +] + +[[package]] +org = "ballerina" +name = "time" +version = "2.8.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "url" +version = "2.6.1" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "uuid" +version = "1.10.0" +dependencies = [ + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.int"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerinax" +name = "wso2.apim.catalog" +version = "1.2.0" +dependencies = [ + {org = "ballerina", name = "constraint"}, + {org = "ballerina", name = "http"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "mime"}, + {org = "ballerina", name = "oauth2"}, + {org = "ballerina", name = "url"} +] +modules = [ + {org = "ballerinax", packageName = "wso2.apim.catalog", moduleName = "wso2.apim.catalog"} +] + +[[package]] +org = "ballerinax" +name = "wso2.controlplane" +version = "1.1.0" +dependencies = [ + {org = "ballerina", name = "file"}, + {org = "ballerina", name = "http"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "jwt"}, + {org = "ballerina", name = "lang.array"}, + {org = "ballerina", name = "lang.runtime"}, + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "os"}, + {org = "ballerina", name = "uuid"} +] +modules = [ + {org = "ballerinax", packageName = "wso2.controlplane", moduleName = "wso2.controlplane"} +] + diff --git a/test-resources/sample_project_12/main.bal b/test-resources/sample_project_12/main.bal new file mode 100644 index 0000000..7987dbf --- /dev/null +++ b/test-resources/sample_project_12/main.bal @@ -0,0 +1,25 @@ +// Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com). +// +// WSO2 LLC. licenses this file to you 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. + +import ballerina/http; +import ballerinax/wso2.apim.catalog as _; +import ballerinax/wso2.controlplane as _; + +listener http:Listener httpDefaultListener = http:getDefaultListener(); + +service /healthcare on httpDefaultListener { + +} diff --git a/test-resources/sample_project_2/Ballerina.toml b/test-resources/sample_project_2/Ballerina.toml index f98dae6..6bbdeab 100644 --- a/test-resources/sample_project_2/Ballerina.toml +++ b/test-resources/sample_project_2/Ballerina.toml @@ -7,7 +7,7 @@ distribution = "2201.10.0" [[dependency]] org = "ballerinax" name = "wso2.apim.catalog" -version = "1.1.0" +version = "1.2.0" repository="local" [build-options] diff --git a/test-resources/sample_project_2/Dependencies.toml b/test-resources/sample_project_2/Dependencies.toml index 9715f83..5c4abbc 100644 --- a/test-resources/sample_project_2/Dependencies.toml +++ b/test-resources/sample_project_2/Dependencies.toml @@ -5,7 +5,7 @@ [ballerina] dependencies-toml-version = "2" -distribution-version = "2201.12.0" +distribution-version = "2201.13.1" [[package]] org = "admin" @@ -53,7 +53,7 @@ dependencies = [ [[package]] org = "ballerina" name = "crypto" -version = "2.9.0" +version = "2.10.1" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "time"} @@ -62,7 +62,7 @@ dependencies = [ [[package]] org = "ballerina" name = "data.jsondata" -version = "1.1.0" +version = "1.1.3" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "lang.object"} @@ -82,7 +82,7 @@ dependencies = [ [[package]] org = "ballerina" name = "http" -version = "2.14.0" +version = "2.15.4" dependencies = [ {org = "ballerina", name = "auth"}, {org = "ballerina", name = "cache"}, @@ -129,7 +129,7 @@ version = "0.0.0" [[package]] org = "ballerina" name = "jwt" -version = "2.15.0" +version = "2.15.1" dependencies = [ {org = "ballerina", name = "cache"}, {org = "ballerina", name = "crypto"}, @@ -218,7 +218,7 @@ dependencies = [ [[package]] org = "ballerina" name = "log" -version = "2.12.0" +version = "2.16.1" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -229,7 +229,7 @@ dependencies = [ [[package]] org = "ballerina" name = "mime" -version = "2.12.0" +version = "2.12.1" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -240,7 +240,7 @@ dependencies = [ [[package]] org = "ballerina" name = "oauth2" -version = "2.14.0" +version = "2.15.0" dependencies = [ {org = "ballerina", name = "cache"}, {org = "ballerina", name = "crypto"}, @@ -253,7 +253,7 @@ dependencies = [ [[package]] org = "ballerina" name = "observe" -version = "1.5.0" +version = "1.7.1" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -261,7 +261,7 @@ dependencies = [ [[package]] org = "ballerina" name = "os" -version = "1.10.0" +version = "1.10.1" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"} @@ -270,16 +270,17 @@ dependencies = [ [[package]] org = "ballerina" name = "task" -version = "2.7.0" +version = "2.11.1" dependencies = [ {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "time"} + {org = "ballerina", name = "time"}, + {org = "ballerina", name = "uuid"} ] [[package]] org = "ballerina" name = "time" -version = "2.7.0" +version = "2.8.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -287,20 +288,30 @@ dependencies = [ [[package]] org = "ballerina" name = "url" -version = "2.6.0" +version = "2.6.1" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] +[[package]] +org = "ballerina" +name = "uuid" +version = "1.10.0" +dependencies = [ + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.int"}, + {org = "ballerina", name = "time"} +] + [[package]] org = "ballerinax" name = "wso2.apim.catalog" -version = "1.1.0" +version = "1.2.0" dependencies = [ {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "http"}, {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "log"}, {org = "ballerina", name = "mime"}, {org = "ballerina", name = "oauth2"}, {org = "ballerina", name = "url"} diff --git a/test-resources/sample_project_3/Ballerina.toml b/test-resources/sample_project_3/Ballerina.toml index 802f5c1..b201b56 100644 --- a/test-resources/sample_project_3/Ballerina.toml +++ b/test-resources/sample_project_3/Ballerina.toml @@ -7,7 +7,7 @@ distribution = "2201.10.0" [[dependency]] org = "ballerinax" name = "wso2.apim.catalog" -version = "1.1.0" +version = "1.2.0" repository="local" [build-options] diff --git a/test-resources/sample_project_3/Dependencies.toml b/test-resources/sample_project_3/Dependencies.toml index f1fd4cf..6376eb1 100644 --- a/test-resources/sample_project_3/Dependencies.toml +++ b/test-resources/sample_project_3/Dependencies.toml @@ -5,7 +5,7 @@ [ballerina] dependencies-toml-version = "2" -distribution-version = "2201.12.0" +distribution-version = "2201.13.1" [[package]] org = "admin" @@ -53,7 +53,7 @@ dependencies = [ [[package]] org = "ballerina" name = "crypto" -version = "2.9.0" +version = "2.10.1" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "time"} @@ -62,7 +62,7 @@ dependencies = [ [[package]] org = "ballerina" name = "data.jsondata" -version = "1.1.0" +version = "1.1.3" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "lang.object"} @@ -82,7 +82,7 @@ dependencies = [ [[package]] org = "ballerina" name = "http" -version = "2.14.0" +version = "2.15.4" dependencies = [ {org = "ballerina", name = "auth"}, {org = "ballerina", name = "cache"}, @@ -129,7 +129,7 @@ version = "0.0.0" [[package]] org = "ballerina" name = "jwt" -version = "2.15.0" +version = "2.15.1" dependencies = [ {org = "ballerina", name = "cache"}, {org = "ballerina", name = "crypto"}, @@ -218,7 +218,7 @@ dependencies = [ [[package]] org = "ballerina" name = "log" -version = "2.12.0" +version = "2.16.1" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -229,7 +229,7 @@ dependencies = [ [[package]] org = "ballerina" name = "mime" -version = "2.12.0" +version = "2.12.1" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -240,7 +240,7 @@ dependencies = [ [[package]] org = "ballerina" name = "oauth2" -version = "2.14.0" +version = "2.15.0" dependencies = [ {org = "ballerina", name = "cache"}, {org = "ballerina", name = "crypto"}, @@ -253,7 +253,7 @@ dependencies = [ [[package]] org = "ballerina" name = "observe" -version = "1.5.0" +version = "1.7.1" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -261,7 +261,7 @@ dependencies = [ [[package]] org = "ballerina" name = "os" -version = "1.10.0" +version = "1.10.1" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"} @@ -270,16 +270,17 @@ dependencies = [ [[package]] org = "ballerina" name = "task" -version = "2.7.0" +version = "2.11.1" dependencies = [ {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "time"} + {org = "ballerina", name = "time"}, + {org = "ballerina", name = "uuid"} ] [[package]] org = "ballerina" name = "time" -version = "2.7.0" +version = "2.8.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -287,20 +288,30 @@ dependencies = [ [[package]] org = "ballerina" name = "url" -version = "2.6.0" +version = "2.6.1" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] +[[package]] +org = "ballerina" +name = "uuid" +version = "1.10.0" +dependencies = [ + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.int"}, + {org = "ballerina", name = "time"} +] + [[package]] org = "ballerinax" name = "wso2.apim.catalog" -version = "1.1.0" +version = "1.2.0" dependencies = [ {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "http"}, {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "log"}, {org = "ballerina", name = "mime"}, {org = "ballerina", name = "oauth2"}, {org = "ballerina", name = "url"} diff --git a/test-resources/sample_project_4/Ballerina.toml b/test-resources/sample_project_4/Ballerina.toml index 4ecd3b6..41fd1fc 100644 --- a/test-resources/sample_project_4/Ballerina.toml +++ b/test-resources/sample_project_4/Ballerina.toml @@ -7,7 +7,7 @@ distribution = "2201.10.0" [[dependency]] org = "ballerinax" name = "wso2.apim.catalog" -version = "1.1.0" +version = "1.2.0" repository="local" [build-options] diff --git a/test-resources/sample_project_4/Dependencies.toml b/test-resources/sample_project_4/Dependencies.toml index 696b4b6..03c73f1 100644 --- a/test-resources/sample_project_4/Dependencies.toml +++ b/test-resources/sample_project_4/Dependencies.toml @@ -5,7 +5,7 @@ [ballerina] dependencies-toml-version = "2" -distribution-version = "2201.12.0" +distribution-version = "2201.13.1" [[package]] org = "admin" @@ -53,7 +53,7 @@ dependencies = [ [[package]] org = "ballerina" name = "crypto" -version = "2.9.0" +version = "2.10.1" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "time"} @@ -62,7 +62,7 @@ dependencies = [ [[package]] org = "ballerina" name = "data.jsondata" -version = "1.1.0" +version = "1.1.3" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "lang.object"} @@ -82,7 +82,7 @@ dependencies = [ [[package]] org = "ballerina" name = "http" -version = "2.14.0" +version = "2.15.4" dependencies = [ {org = "ballerina", name = "auth"}, {org = "ballerina", name = "cache"}, @@ -129,7 +129,7 @@ version = "0.0.0" [[package]] org = "ballerina" name = "jwt" -version = "2.15.0" +version = "2.15.1" dependencies = [ {org = "ballerina", name = "cache"}, {org = "ballerina", name = "crypto"}, @@ -218,7 +218,7 @@ dependencies = [ [[package]] org = "ballerina" name = "log" -version = "2.12.0" +version = "2.16.1" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -229,7 +229,7 @@ dependencies = [ [[package]] org = "ballerina" name = "mime" -version = "2.12.0" +version = "2.12.1" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -240,7 +240,7 @@ dependencies = [ [[package]] org = "ballerina" name = "oauth2" -version = "2.14.0" +version = "2.15.0" dependencies = [ {org = "ballerina", name = "cache"}, {org = "ballerina", name = "crypto"}, @@ -253,7 +253,7 @@ dependencies = [ [[package]] org = "ballerina" name = "observe" -version = "1.5.0" +version = "1.7.1" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -261,7 +261,7 @@ dependencies = [ [[package]] org = "ballerina" name = "os" -version = "1.10.0" +version = "1.10.1" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"} @@ -270,16 +270,17 @@ dependencies = [ [[package]] org = "ballerina" name = "task" -version = "2.7.0" +version = "2.11.1" dependencies = [ {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "time"} + {org = "ballerina", name = "time"}, + {org = "ballerina", name = "uuid"} ] [[package]] org = "ballerina" name = "time" -version = "2.7.0" +version = "2.8.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -287,20 +288,30 @@ dependencies = [ [[package]] org = "ballerina" name = "url" -version = "2.6.0" +version = "2.6.1" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] +[[package]] +org = "ballerina" +name = "uuid" +version = "1.10.0" +dependencies = [ + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.int"}, + {org = "ballerina", name = "time"} +] + [[package]] org = "ballerinax" name = "wso2.apim.catalog" -version = "1.1.0" +version = "1.2.0" dependencies = [ {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "http"}, {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "log"}, {org = "ballerina", name = "mime"}, {org = "ballerina", name = "oauth2"}, {org = "ballerina", name = "url"} diff --git a/test-resources/sample_project_5/Ballerina.toml b/test-resources/sample_project_5/Ballerina.toml index 26cb1a2..39eb347 100644 --- a/test-resources/sample_project_5/Ballerina.toml +++ b/test-resources/sample_project_5/Ballerina.toml @@ -7,7 +7,7 @@ distribution = "2201.10.0" [[dependency]] org = "ballerinax" name = "wso2.apim.catalog" -version = "1.1.0" +version = "1.2.0" repository="local" [build-options] diff --git a/test-resources/sample_project_5/Dependencies.toml b/test-resources/sample_project_5/Dependencies.toml index d912708..5376967 100644 --- a/test-resources/sample_project_5/Dependencies.toml +++ b/test-resources/sample_project_5/Dependencies.toml @@ -5,7 +5,7 @@ [ballerina] dependencies-toml-version = "2" -distribution-version = "2201.12.0" +distribution-version = "2201.13.1" [[package]] org = "admin" @@ -54,7 +54,7 @@ dependencies = [ [[package]] org = "ballerina" name = "crypto" -version = "2.9.0" +version = "2.10.1" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "time"} @@ -63,7 +63,7 @@ dependencies = [ [[package]] org = "ballerina" name = "data.jsondata" -version = "1.1.0" +version = "1.1.3" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "lang.object"} @@ -83,7 +83,7 @@ dependencies = [ [[package]] org = "ballerina" name = "http" -version = "2.14.0" +version = "2.15.4" dependencies = [ {org = "ballerina", name = "auth"}, {org = "ballerina", name = "cache"}, @@ -130,7 +130,7 @@ version = "0.0.0" [[package]] org = "ballerina" name = "jwt" -version = "2.15.0" +version = "2.15.1" dependencies = [ {org = "ballerina", name = "cache"}, {org = "ballerina", name = "crypto"}, @@ -219,7 +219,7 @@ dependencies = [ [[package]] org = "ballerina" name = "log" -version = "2.12.0" +version = "2.16.1" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -230,7 +230,7 @@ dependencies = [ [[package]] org = "ballerina" name = "mime" -version = "2.12.0" +version = "2.12.1" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -241,7 +241,7 @@ dependencies = [ [[package]] org = "ballerina" name = "oauth2" -version = "2.14.0" +version = "2.15.0" dependencies = [ {org = "ballerina", name = "cache"}, {org = "ballerina", name = "crypto"}, @@ -254,7 +254,7 @@ dependencies = [ [[package]] org = "ballerina" name = "observe" -version = "1.5.0" +version = "1.7.1" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -262,7 +262,7 @@ dependencies = [ [[package]] org = "ballerina" name = "openapi" -version = "2.3.0" +version = "2.4.0" modules = [ {org = "ballerina", packageName = "openapi", moduleName = "openapi"} ] @@ -270,7 +270,7 @@ modules = [ [[package]] org = "ballerina" name = "os" -version = "1.10.0" +version = "1.10.1" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"} @@ -279,16 +279,17 @@ dependencies = [ [[package]] org = "ballerina" name = "task" -version = "2.7.0" +version = "2.11.1" dependencies = [ {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "time"} + {org = "ballerina", name = "time"}, + {org = "ballerina", name = "uuid"} ] [[package]] org = "ballerina" name = "time" -version = "2.7.0" +version = "2.8.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -296,20 +297,30 @@ dependencies = [ [[package]] org = "ballerina" name = "url" -version = "2.6.0" +version = "2.6.1" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] +[[package]] +org = "ballerina" +name = "uuid" +version = "1.10.0" +dependencies = [ + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.int"}, + {org = "ballerina", name = "time"} +] + [[package]] org = "ballerinax" name = "wso2.apim.catalog" -version = "1.1.0" +version = "1.2.0" dependencies = [ {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "http"}, {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "log"}, {org = "ballerina", name = "mime"}, {org = "ballerina", name = "oauth2"}, {org = "ballerina", name = "url"} diff --git a/test-resources/sample_project_6/Ballerina.toml b/test-resources/sample_project_6/Ballerina.toml index 9d5ff70..9bc571d 100644 --- a/test-resources/sample_project_6/Ballerina.toml +++ b/test-resources/sample_project_6/Ballerina.toml @@ -7,7 +7,7 @@ distribution = "2201.10.0" [[dependency]] org = "ballerinax" name = "wso2.apim.catalog" -version = "1.1.0" +version = "1.2.0" repository="local" [build-options] diff --git a/test-resources/sample_project_6/Dependencies.toml b/test-resources/sample_project_6/Dependencies.toml index 961b7bd..a87fe38 100644 --- a/test-resources/sample_project_6/Dependencies.toml +++ b/test-resources/sample_project_6/Dependencies.toml @@ -5,7 +5,7 @@ [ballerina] dependencies-toml-version = "2" -distribution-version = "2201.12.0" +distribution-version = "2201.13.1" [[package]] org = "admin" @@ -53,7 +53,7 @@ dependencies = [ [[package]] org = "ballerina" name = "crypto" -version = "2.9.0" +version = "2.10.1" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "time"} @@ -62,7 +62,7 @@ dependencies = [ [[package]] org = "ballerina" name = "data.jsondata" -version = "1.1.0" +version = "1.1.3" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "lang.object"} @@ -82,7 +82,7 @@ dependencies = [ [[package]] org = "ballerina" name = "http" -version = "2.14.0" +version = "2.15.4" dependencies = [ {org = "ballerina", name = "auth"}, {org = "ballerina", name = "cache"}, @@ -129,7 +129,7 @@ version = "0.0.0" [[package]] org = "ballerina" name = "jwt" -version = "2.15.0" +version = "2.15.1" dependencies = [ {org = "ballerina", name = "cache"}, {org = "ballerina", name = "crypto"}, @@ -218,7 +218,7 @@ dependencies = [ [[package]] org = "ballerina" name = "log" -version = "2.12.0" +version = "2.16.1" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -229,7 +229,7 @@ dependencies = [ [[package]] org = "ballerina" name = "mime" -version = "2.12.0" +version = "2.12.1" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -240,7 +240,7 @@ dependencies = [ [[package]] org = "ballerina" name = "oauth2" -version = "2.14.0" +version = "2.15.0" dependencies = [ {org = "ballerina", name = "cache"}, {org = "ballerina", name = "crypto"}, @@ -253,7 +253,7 @@ dependencies = [ [[package]] org = "ballerina" name = "observe" -version = "1.5.0" +version = "1.7.1" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -261,7 +261,7 @@ dependencies = [ [[package]] org = "ballerina" name = "os" -version = "1.10.0" +version = "1.10.1" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"} @@ -270,16 +270,17 @@ dependencies = [ [[package]] org = "ballerina" name = "task" -version = "2.7.0" +version = "2.11.1" dependencies = [ {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "time"} + {org = "ballerina", name = "time"}, + {org = "ballerina", name = "uuid"} ] [[package]] org = "ballerina" name = "time" -version = "2.7.0" +version = "2.8.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -287,20 +288,30 @@ dependencies = [ [[package]] org = "ballerina" name = "url" -version = "2.6.0" +version = "2.6.1" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] +[[package]] +org = "ballerina" +name = "uuid" +version = "1.10.0" +dependencies = [ + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.int"}, + {org = "ballerina", name = "time"} +] + [[package]] org = "ballerinax" name = "wso2.apim.catalog" -version = "1.1.0" +version = "1.2.0" dependencies = [ {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "http"}, {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "log"}, {org = "ballerina", name = "mime"}, {org = "ballerina", name = "oauth2"}, {org = "ballerina", name = "url"} diff --git a/test-resources/sample_project_7/Ballerina.toml b/test-resources/sample_project_7/Ballerina.toml index 8507a03..0694d29 100644 --- a/test-resources/sample_project_7/Ballerina.toml +++ b/test-resources/sample_project_7/Ballerina.toml @@ -7,7 +7,7 @@ distribution = "2201.10.0" [[dependency]] org = "ballerinax" name = "wso2.apim.catalog" -version = "1.1.0" +version = "1.2.0" repository="local" [build-options] diff --git a/test-resources/sample_project_7/Dependencies.toml b/test-resources/sample_project_7/Dependencies.toml index 0ebddca..0031745 100644 --- a/test-resources/sample_project_7/Dependencies.toml +++ b/test-resources/sample_project_7/Dependencies.toml @@ -5,7 +5,7 @@ [ballerina] dependencies-toml-version = "2" -distribution-version = "2201.10.0" +distribution-version = "2201.13.1" [[package]] org = "admin" @@ -23,7 +23,7 @@ modules = [ [[package]] org = "ballerina" name = "auth" -version = "2.12.0" +version = "2.14.0" dependencies = [ {org = "ballerina", name = "crypto"}, {org = "ballerina", name = "jballerina.java"}, @@ -35,7 +35,7 @@ dependencies = [ [[package]] org = "ballerina" name = "cache" -version = "3.8.0" +version = "3.10.0" dependencies = [ {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "jballerina.java"}, @@ -46,7 +46,7 @@ dependencies = [ [[package]] org = "ballerina" name = "constraint" -version = "1.5.0" +version = "1.7.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -54,16 +54,25 @@ dependencies = [ [[package]] org = "ballerina" name = "crypto" -version = "2.7.2" +version = "2.10.1" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "time"} ] +[[package]] +org = "ballerina" +name = "data.jsondata" +version = "1.1.3" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.object"} +] + [[package]] org = "ballerina" name = "file" -version = "1.10.0" +version = "1.12.0" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -74,7 +83,7 @@ dependencies = [ [[package]] org = "ballerina" name = "graphql" -version = "1.14.0" +version = "1.17.0" dependencies = [ {org = "ballerina", name = "auth"}, {org = "ballerina", name = "cache"}, @@ -106,12 +115,13 @@ modules = [ [[package]] org = "ballerina" name = "http" -version = "2.12.1" +version = "2.15.4" dependencies = [ {org = "ballerina", name = "auth"}, {org = "ballerina", name = "cache"}, {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "data.jsondata"}, {org = "ballerina", name = "file"}, {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -138,7 +148,7 @@ modules = [ [[package]] org = "ballerina" name = "io" -version = "1.6.1" +version = "1.8.0" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "lang.value"} @@ -152,7 +162,7 @@ version = "0.0.0" [[package]] org = "ballerina" name = "jwt" -version = "2.13.0" +version = "2.15.1" dependencies = [ {org = "ballerina", name = "cache"}, {org = "ballerina", name = "crypto"}, @@ -241,7 +251,7 @@ dependencies = [ [[package]] org = "ballerina" name = "log" -version = "2.10.0" +version = "2.16.1" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -252,7 +262,7 @@ dependencies = [ [[package]] org = "ballerina" name = "mime" -version = "2.10.0" +version = "2.12.1" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -263,7 +273,7 @@ dependencies = [ [[package]] org = "ballerina" name = "oauth2" -version = "2.12.0" +version = "2.15.0" dependencies = [ {org = "ballerina", name = "cache"}, {org = "ballerina", name = "crypto"}, @@ -276,7 +286,7 @@ dependencies = [ [[package]] org = "ballerina" name = "observe" -version = "1.3.0" +version = "1.7.1" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -284,7 +294,7 @@ dependencies = [ [[package]] org = "ballerina" name = "os" -version = "1.8.0" +version = "1.10.1" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"} @@ -293,16 +303,17 @@ dependencies = [ [[package]] org = "ballerina" name = "task" -version = "2.5.0" +version = "2.11.1" dependencies = [ {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "time"} + {org = "ballerina", name = "time"}, + {org = "ballerina", name = "uuid"} ] [[package]] org = "ballerina" name = "time" -version = "2.5.0" +version = "2.8.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -310,7 +321,7 @@ dependencies = [ [[package]] org = "ballerina" name = "url" -version = "2.4.0" +version = "2.6.1" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -318,7 +329,7 @@ dependencies = [ [[package]] org = "ballerina" name = "uuid" -version = "1.8.0" +version = "1.10.0" dependencies = [ {org = "ballerina", name = "crypto"}, {org = "ballerina", name = "jballerina.java"}, @@ -329,7 +340,7 @@ dependencies = [ [[package]] org = "ballerina" name = "websocket" -version = "2.12.0" +version = "2.15.1" dependencies = [ {org = "ballerina", name = "auth"}, {org = "ballerina", name = "constraint"}, @@ -349,12 +360,11 @@ dependencies = [ [[package]] org = "ballerinax" name = "wso2.apim.catalog" -version = "1.1.0" +version = "1.2.0" dependencies = [ {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "http"}, {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "log"}, {org = "ballerina", name = "mime"}, {org = "ballerina", name = "oauth2"}, {org = "ballerina", name = "url"} diff --git a/test-resources/sample_project_8/Ballerina.toml b/test-resources/sample_project_8/Ballerina.toml index 4de05db..87e4f83 100644 --- a/test-resources/sample_project_8/Ballerina.toml +++ b/test-resources/sample_project_8/Ballerina.toml @@ -7,7 +7,7 @@ distribution = "2201.10.0" [[dependency]] org = "ballerinax" name = "wso2.apim.catalog" -version = "1.1.0" +version = "1.2.0" repository="local" [build-options] diff --git a/test-resources/sample_project_8/Dependencies.toml b/test-resources/sample_project_8/Dependencies.toml index 67d7656..1fd89e5 100644 --- a/test-resources/sample_project_8/Dependencies.toml +++ b/test-resources/sample_project_8/Dependencies.toml @@ -5,7 +5,7 @@ [ballerina] dependencies-toml-version = "2" -distribution-version = "2201.10.0" +distribution-version = "2201.13.1" [[package]] org = "admin" @@ -23,7 +23,7 @@ modules = [ [[package]] org = "ballerina" name = "auth" -version = "2.12.0" +version = "2.14.0" dependencies = [ {org = "ballerina", name = "crypto"}, {org = "ballerina", name = "jballerina.java"}, @@ -35,7 +35,7 @@ dependencies = [ [[package]] org = "ballerina" name = "cache" -version = "3.8.0" +version = "3.10.0" dependencies = [ {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "jballerina.java"}, @@ -46,7 +46,7 @@ dependencies = [ [[package]] org = "ballerina" name = "constraint" -version = "1.5.0" +version = "1.7.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -54,16 +54,25 @@ dependencies = [ [[package]] org = "ballerina" name = "crypto" -version = "2.7.2" +version = "2.10.1" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "time"} ] +[[package]] +org = "ballerina" +name = "data.jsondata" +version = "1.1.3" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.object"} +] + [[package]] org = "ballerina" name = "file" -version = "1.10.0" +version = "1.12.0" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -77,12 +86,13 @@ modules = [ [[package]] org = "ballerina" name = "http" -version = "2.12.1" +version = "2.15.4" dependencies = [ {org = "ballerina", name = "auth"}, {org = "ballerina", name = "cache"}, {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "data.jsondata"}, {org = "ballerina", name = "file"}, {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -109,7 +119,7 @@ modules = [ [[package]] org = "ballerina" name = "io" -version = "1.6.1" +version = "1.8.0" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "lang.value"} @@ -123,7 +133,7 @@ version = "0.0.0" [[package]] org = "ballerina" name = "jwt" -version = "2.13.0" +version = "2.15.1" dependencies = [ {org = "ballerina", name = "cache"}, {org = "ballerina", name = "crypto"}, @@ -212,7 +222,7 @@ dependencies = [ [[package]] org = "ballerina" name = "log" -version = "2.10.0" +version = "2.16.1" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -223,7 +233,7 @@ dependencies = [ [[package]] org = "ballerina" name = "mime" -version = "2.10.0" +version = "2.12.1" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -234,7 +244,7 @@ dependencies = [ [[package]] org = "ballerina" name = "oauth2" -version = "2.12.0" +version = "2.15.0" dependencies = [ {org = "ballerina", name = "cache"}, {org = "ballerina", name = "crypto"}, @@ -247,7 +257,7 @@ dependencies = [ [[package]] org = "ballerina" name = "observe" -version = "1.3.0" +version = "1.7.1" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -255,7 +265,7 @@ dependencies = [ [[package]] org = "ballerina" name = "os" -version = "1.8.0" +version = "1.10.1" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"} @@ -264,16 +274,17 @@ dependencies = [ [[package]] org = "ballerina" name = "task" -version = "2.5.0" +version = "2.11.1" dependencies = [ {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "time"} + {org = "ballerina", name = "time"}, + {org = "ballerina", name = "uuid"} ] [[package]] org = "ballerina" name = "time" -version = "2.5.0" +version = "2.8.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -281,20 +292,30 @@ dependencies = [ [[package]] org = "ballerina" name = "url" -version = "2.4.0" +version = "2.6.1" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] +[[package]] +org = "ballerina" +name = "uuid" +version = "1.10.0" +dependencies = [ + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.int"}, + {org = "ballerina", name = "time"} +] + [[package]] org = "ballerinax" name = "wso2.apim.catalog" -version = "1.1.0" +version = "1.2.0" dependencies = [ {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "http"}, {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "log"}, {org = "ballerina", name = "mime"}, {org = "ballerina", name = "oauth2"}, {org = "ballerina", name = "url"} diff --git a/test-resources/sample_project_9/Ballerina.toml b/test-resources/sample_project_9/Ballerina.toml index 92d9ae8..909e85f 100644 --- a/test-resources/sample_project_9/Ballerina.toml +++ b/test-resources/sample_project_9/Ballerina.toml @@ -7,7 +7,7 @@ distribution = "2201.10.0" [[dependency]] org = "ballerinax" name = "wso2.apim.catalog" -version = "1.1.0" +version = "1.2.0" repository="local" [build-options] diff --git a/test-resources/sample_project_9/Dependencies.toml b/test-resources/sample_project_9/Dependencies.toml index 7e0e3e9..03a5e4c 100644 --- a/test-resources/sample_project_9/Dependencies.toml +++ b/test-resources/sample_project_9/Dependencies.toml @@ -5,7 +5,7 @@ [ballerina] dependencies-toml-version = "2" -distribution-version = "2201.10.0" +distribution-version = "2201.13.1" [[package]] org = "admin" @@ -22,7 +22,7 @@ modules = [ [[package]] org = "ballerina" name = "auth" -version = "2.12.0" +version = "2.14.0" dependencies = [ {org = "ballerina", name = "crypto"}, {org = "ballerina", name = "jballerina.java"}, @@ -34,7 +34,7 @@ dependencies = [ [[package]] org = "ballerina" name = "cache" -version = "3.8.0" +version = "3.10.0" dependencies = [ {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "jballerina.java"}, @@ -45,7 +45,7 @@ dependencies = [ [[package]] org = "ballerina" name = "constraint" -version = "1.5.0" +version = "1.7.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -53,16 +53,25 @@ dependencies = [ [[package]] org = "ballerina" name = "crypto" -version = "2.7.2" +version = "2.10.1" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "time"} ] +[[package]] +org = "ballerina" +name = "data.jsondata" +version = "1.1.3" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.object"} +] + [[package]] org = "ballerina" name = "file" -version = "1.10.0" +version = "1.12.0" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -73,12 +82,13 @@ dependencies = [ [[package]] org = "ballerina" name = "http" -version = "2.12.1" +version = "2.15.4" dependencies = [ {org = "ballerina", name = "auth"}, {org = "ballerina", name = "cache"}, {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "data.jsondata"}, {org = "ballerina", name = "file"}, {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -105,7 +115,7 @@ modules = [ [[package]] org = "ballerina" name = "io" -version = "1.6.1" +version = "1.8.0" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "lang.value"} @@ -119,7 +129,7 @@ version = "0.0.0" [[package]] org = "ballerina" name = "jwt" -version = "2.13.0" +version = "2.15.1" dependencies = [ {org = "ballerina", name = "cache"}, {org = "ballerina", name = "crypto"}, @@ -208,7 +218,7 @@ dependencies = [ [[package]] org = "ballerina" name = "log" -version = "2.10.0" +version = "2.16.1" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -219,7 +229,7 @@ dependencies = [ [[package]] org = "ballerina" name = "mime" -version = "2.10.0" +version = "2.12.1" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -230,7 +240,7 @@ dependencies = [ [[package]] org = "ballerina" name = "oauth2" -version = "2.12.0" +version = "2.15.0" dependencies = [ {org = "ballerina", name = "cache"}, {org = "ballerina", name = "crypto"}, @@ -243,7 +253,7 @@ dependencies = [ [[package]] org = "ballerina" name = "observe" -version = "1.3.0" +version = "1.7.1" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -251,7 +261,7 @@ dependencies = [ [[package]] org = "ballerina" name = "os" -version = "1.8.0" +version = "1.10.1" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"} @@ -260,16 +270,17 @@ dependencies = [ [[package]] org = "ballerina" name = "task" -version = "2.5.0" +version = "2.11.1" dependencies = [ {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "time"} + {org = "ballerina", name = "time"}, + {org = "ballerina", name = "uuid"} ] [[package]] org = "ballerina" name = "time" -version = "2.5.0" +version = "2.8.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -277,20 +288,30 @@ dependencies = [ [[package]] org = "ballerina" name = "url" -version = "2.4.0" +version = "2.6.1" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] +[[package]] +org = "ballerina" +name = "uuid" +version = "1.10.0" +dependencies = [ + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.int"}, + {org = "ballerina", name = "time"} +] + [[package]] org = "ballerinax" name = "wso2.apim.catalog" -version = "1.1.0" +version = "1.2.0" dependencies = [ {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "http"}, {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "log"}, {org = "ballerina", name = "mime"}, {org = "ballerina", name = "oauth2"}, {org = "ballerina", name = "url"} diff --git a/test-resources/sample_project_9/main.bal b/test-resources/sample_project_9/main.bal index ec8cb9c..97f88f2 100644 --- a/test-resources/sample_project_9/main.bal +++ b/test-resources/sample_project_9/main.bal @@ -1,4 +1,4 @@ -// Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). +// Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com). // // WSO2 LLC. licenses this file to you under the Apache License, // Version 2.0 (the "License"); you may not use this file except