+ // Extract the host and port
+ mockKongHost := parsedMockKongURL.Hostname()
+ mockKongControlPlanePort := parsedMockKongURL.Port()
+
+ eCapifWeb = echo.New()
+ capifcore.RegisterHandlers(eCapifWeb, nil, nil)
+ capifServer = httptest.NewServer(eCapifWeb)
+
+ // Parse the server URL
+ parsedCapifURL, err := url.Parse(capifServer.URL)
+ if err != nil {
+ log.Fatalf("error parsing mock Kong URL: %v", err)
+ return err
+ }
+
+ // Extract the host and port
+ capifHost := parsedCapifURL.Hostname()
+ capifPort := parsedCapifURL.Port()
+
+ // Set up the mock config reader with the desired configuration for testing
+ mockConfigReader = &envreader.MockConfigReader{
+ MockedConfig: map[string]string{
+ "KONG_DOMAIN": "kong",
+ "KONG_PROTOCOL": "http",
+ "KONG_IPV4": mockKongHost,
+ "KONG_DATA_PLANE_PORT": "32080",
+ "KONG_CONTROL_PLANE_PORT": mockKongControlPlanePort,
+ "CAPIF_PROTOCOL": "http",
+ "CAPIF_IPV4": capifHost,
+ "CAPIF_PORT": capifPort,
+ "LOG_LEVEL": "Info",
+ "SERVICE_MANAGER_PORT": "8095",
+ "TEST_SERVICE_IPV4": "10.101.1.101",
+ "TEST_SERVICE_PORT": "30951",
+ },
+ }
+
+ myEnv, myPorts, err := mockConfigReader.ReadDotEnv()