diff --git a/client/client.go b/client/client.go index b145758..248f801 100644 --- a/client/client.go +++ b/client/client.go @@ -81,7 +81,7 @@ func Make(apiParameter ApiParameter) (*Client, error) { result.apiKey = jwtToken.AccessToken } - if apiParameter.ApiKey != "" { + if result.apiKey != "" { result.setApiKeyInRestClient() } else { //it will be set later only when really needed diff --git a/docker/initializer.json b/docker/initializer.json index a73fe8b..81cf42d 100644 --- a/docker/initializer.json +++ b/docker/initializer.json @@ -83,7 +83,7 @@ "httpResponse": { "statusCode": 200, "body": { - "access_token": "yo", + "access_token": "yo_from_login", "refresh_token": "yo", "token_type": "yo", "expires_in": 0 @@ -194,5 +194,23 @@ "httpResponse": { "statusCode": 200 } + }, + { + "httpRequest": { + "method": "Get", + "path": "/public/console/v2/kafka-cluster/my_kafka_cluster", + "headers": { + "Authorization": "Bearer yo_from_login" + } + }, + "httpResponse": { + "statusCode": 200, + "body": {"metadata": {"name": "a"}}, + "headers": { + "Content-Type": [ + "application/json" + ] + } + } } ] \ No newline at end of file diff --git a/test_final_exec.sh b/test_final_exec.sh index f335e55..efacbaf 100755 --- a/test_final_exec.sh +++ b/test_final_exec.sh @@ -19,6 +19,7 @@ main() { docker compose -f docker/docker-compose.yml run conduktor get Topic yolo --cluster=my-cluster docker compose -f docker/docker-compose.yml run conduktor delete Topic yolo -v --cluster=my-cluster docker compose -f docker/docker-compose.yml run -e CDK_USER=admin -e CDK_PASSWORD=secret conduktor login + docker compose -f docker/docker-compose.yml run -e CDK_USER=admin -e CDK_PASSWORD=secret -e CDK_API_KEY="" conduktor get KafkaCluster my_kafka_cluster docker compose -f docker/docker-compose.yml run conduktor token list admin docker compose -f docker/docker-compose.yml run conduktor token list application-instance -i=my_app_instance docker compose -f docker/docker-compose.yml run conduktor token create admin a_admin_token