From 5e8eb26fd07d8ffa81293dd24530be69e8c3bb10 Mon Sep 17 00:00:00 2001 From: Pubudu Gunatilaka Date: Tue, 26 Sep 2023 12:01:17 +0530 Subject: [PATCH] Changing to new schemas --- .../envoyconf/routes_with_clusters_test.go | 38 +++++++++---------- .../tests/resources/basicAPI.apk-conf | 4 +- .../tests/resources/multiEnv.apk-conf | 4 +- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/adapter/internal/oasparser/envoyconf/routes_with_clusters_test.go b/adapter/internal/oasparser/envoyconf/routes_with_clusters_test.go index 842c09b9de..c59dc4b33a 100644 --- a/adapter/internal/oasparser/envoyconf/routes_with_clusters_test.go +++ b/adapter/internal/oasparser/envoyconf/routes_with_clusters_test.go @@ -40,9 +40,9 @@ func TestCreateRoutesWithClustersWithExactAndRegularExpressionRules(t *testing.T Name: "test-api-2", }, Spec: v1alpha1.APISpec{ - APIName: "test-api-2", - APIVersion: "2.0.0", - BasePath: "/test-api/2.0.0", + APIName: "test-api-2", + APIVersion: "2.0.0", + BasePath: "/test-api/2.0.0", Production: []v1alpha1.EnvConfig{ { HTTPRouteRefs: []string{ @@ -179,7 +179,7 @@ func TestGenerateAdapterInternalAPIForSpecificEnvironment(t *testing.T) { assert.Equal(t, "dev", adapterInternalAPI.GetEnvironment(), "Environment is incorrect.") } -func generateSampleAPI(apiName string, apiVersion string, apiContext string) synchronizer.APIState { +func generateSampleAPI(apiName string, apiVersion string, basePath string) synchronizer.APIState { apiState := synchronizer.APIState{} apiDefinition := v1alpha1.API{ @@ -188,9 +188,9 @@ func generateSampleAPI(apiName string, apiVersion string, apiContext string) syn Name: apiName, }, Spec: v1alpha1.APISpec{ - APIDisplayName: apiName, - APIVersion: apiVersion, - Context: apiContext, + APIName: apiName, + APIVersion: apiVersion, + BasePath: basePath, Production: []v1alpha1.EnvConfig{ { HTTPRouteRefs: []string{ @@ -251,9 +251,9 @@ func TestCreateRoutesWithClustersWithMultiplePathPrefixRules(t *testing.T) { Name: "test-api-1", }, Spec: v1alpha1.APISpec{ - APIName: "test-api", - APIVersion: "1.0.0", - BasePath: "/test-api/1.0.0", + APIName: "test-api", + APIVersion: "1.0.0", + BasePath: "/test-api/1.0.0", Production: []v1alpha1.EnvConfig{ { HTTPRouteRefs: []string{ @@ -398,9 +398,9 @@ func TestCreateRoutesWithClustersWithBackendTLSConfigs(t *testing.T) { Name: "test-api-3", }, Spec: v1alpha1.APISpec{ - APIName: "test-api-3", - APIVersion: "1.0.0", - BasePath: "/test-api-3/1.0.0", + APIName: "test-api-3", + APIVersion: "1.0.0", + BasePath: "/test-api-3/1.0.0", Production: []v1alpha1.EnvConfig{ { HTTPRouteRefs: []string{ @@ -704,9 +704,9 @@ func TestCreateRoutesWithClustersDifferentBackendRefs(t *testing.T) { Name: "test-api-different-backendrefs", }, Spec: v1alpha1.APISpec{ - APIName: "test-api-different-backendrefs", - APIVersion: "1.0.0", - BasePath: "/test-api-different-backendrefs/1.0.0", + APIName: "test-api-different-backendrefs", + APIVersion: "1.0.0", + BasePath: "/test-api-different-backendrefs/1.0.0", Production: []v1alpha1.EnvConfig{ { HTTPRouteRefs: []string{ @@ -794,9 +794,9 @@ func TestCreateRoutesWithClustersSameBackendRefs(t *testing.T) { Name: "test-api-same-backendrefs", }, Spec: v1alpha1.APISpec{ - APIName: "test-api-same-backendrefs", - APIVersion: "1.0.0", - BasePath: "/test-api-same-backendrefs/1.0.0", + APIName: "test-api-same-backendrefs", + APIVersion: "1.0.0", + BasePath: "/test-api-same-backendrefs/1.0.0", Production: []v1alpha1.EnvConfig{ { HTTPRouteRefs: []string{ diff --git a/runtime/config-deployer-service/ballerina/tests/resources/basicAPI.apk-conf b/runtime/config-deployer-service/ballerina/tests/resources/basicAPI.apk-conf index 05a9f39437..f6f67c635c 100644 --- a/runtime/config-deployer-service/ballerina/tests/resources/basicAPI.apk-conf +++ b/runtime/config-deployer-service/ballerina/tests/resources/basicAPI.apk-conf @@ -1,6 +1,6 @@ name: api1 version: 1.0.0 -context: /api1/1.0.0 +basePath: /api1/1.0.0 type: REST endpointConfigurations: production: @@ -10,6 +10,6 @@ endpointConfigurations: operations: - target: /get verb: GET - authTypeEnabled: false + secured: false - target: /get verb: POST diff --git a/runtime/config-deployer-service/ballerina/tests/resources/multiEnv.apk-conf b/runtime/config-deployer-service/ballerina/tests/resources/multiEnv.apk-conf index 4af1651c52..76e27b9b37 100644 --- a/runtime/config-deployer-service/ballerina/tests/resources/multiEnv.apk-conf +++ b/runtime/config-deployer-service/ballerina/tests/resources/multiEnv.apk-conf @@ -1,6 +1,6 @@ name: api1 version: 1.0.0 -context: /api1/1.0.0 +basePath: /api1/1.0.0 type: REST defaultVersion: true environment: dev @@ -12,6 +12,6 @@ endpointConfigurations: operations: - target: /get verb: GET - authTypeEnabled: false + secured: false - target: /get verb: POST