From 7d4394e4838dc2abcbb191a3493b67aa327eac03 Mon Sep 17 00:00:00 2001 From: ldclakmal Date: Mon, 31 Jul 2023 10:54:45 -0400 Subject: [PATCH] Fix http BBE assertions --- bbes/http/assert.sh | 2 +- bbes/http/http_basic_auth_file_store.sh | 2 +- bbes/http/http_basic_auth_ldap_store.sh | 2 +- bbes/http/http_jwt_auth.sh | 2 +- bbes/http/http_mtls.sh | 2 +- bbes/http/http_oauth2_bearer_token.sh | 2 +- bbes/http/http_oauth2_client_credentials_grant.sh | 2 +- bbes/http/http_oauth2_jwt_bearer_grant.sh | 2 +- bbes/http/http_oauth2_password_grant.sh | 2 +- bbes/http/http_oauth2_refresh_token_grant.sh | 2 +- bbes/http/http_ssl_tls.sh | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/bbes/http/assert.sh b/bbes/http/assert.sh index fd656c01..e8ccc3f9 100644 --- a/bbes/http/assert.sh +++ b/bbes/http/assert.sh @@ -5,7 +5,7 @@ assertNotEmpty() { } assertEquals() { - if [[ $1 != $2 ]]; then + if [[ "$1" != "$2" ]]; then echo "Expected: '$2'" echo "Actual: '$1'" exit 1 diff --git a/bbes/http/http_basic_auth_file_store.sh b/bbes/http/http_basic_auth_file_store.sh index c5775cc5..d404c8a0 100755 --- a/bbes/http/http_basic_auth_file_store.sh +++ b/bbes/http/http_basic_auth_file_store.sh @@ -15,4 +15,4 @@ bal run bbe/service.bal & sleep 10s response=$(bal run bbe/client.bal 2>&1 | tail -n 1) assertNotEmpty "$response" -assertEquals "$response" "Hello, World!" +assertEquals "$response" "[{\"title\":\"Blue Train\",\"artist\":\"John Coltrane\"},{\"title\":\"Jeru\",\"artist\":\"Gerry Mulligan\"}]" diff --git a/bbes/http/http_basic_auth_ldap_store.sh b/bbes/http/http_basic_auth_ldap_store.sh index fe8fc5e1..716dec5f 100755 --- a/bbes/http/http_basic_auth_ldap_store.sh +++ b/bbes/http/http_basic_auth_ldap_store.sh @@ -16,4 +16,4 @@ bal run bbe/service.bal & sleep 10s response=$(bal run bbe/client.bal 2>&1 | tail -n 1) assertNotEmpty "$response" -assertEquals "$response" "Hello, World!" +assertEquals "$response" "[{\"title\":\"Blue Train\",\"artist\":\"John Coltrane\"},{\"title\":\"Jeru\",\"artist\":\"Gerry Mulligan\"}]" diff --git a/bbes/http/http_jwt_auth.sh b/bbes/http/http_jwt_auth.sh index 3b80dad3..c239e885 100755 --- a/bbes/http/http_jwt_auth.sh +++ b/bbes/http/http_jwt_auth.sh @@ -12,4 +12,4 @@ bal run bbe/service.bal & sleep 10s response=$(bal run bbe/client.bal 2>&1 | tail -n 1) assertNotEmpty "$response" -assertEquals "$response" "Hello, World!" +assertEquals "$response" "[{\"title\":\"Blue Train\",\"artist\":\"John Coltrane\"},{\"title\":\"Jeru\",\"artist\":\"Gerry Mulligan\"}]" diff --git a/bbes/http/http_mtls.sh b/bbes/http/http_mtls.sh index 3d3deeec..f2ace4a2 100755 --- a/bbes/http/http_mtls.sh +++ b/bbes/http/http_mtls.sh @@ -12,4 +12,4 @@ bal run bbe/service.bal & sleep 10s response=$(bal run bbe/client.bal 2>&1 | tail -n 1) assertNotEmpty "$response" -assertEquals "$response" "Hello, World!" +assertEquals "$response" "[{\"title\":\"Blue Train\",\"artist\":\"John Coltrane\"},{\"title\":\"Jeru\",\"artist\":\"Gerry Mulligan\"}]" diff --git a/bbes/http/http_oauth2_bearer_token.sh b/bbes/http/http_oauth2_bearer_token.sh index 238728c3..60e55eab 100755 --- a/bbes/http/http_oauth2_bearer_token.sh +++ b/bbes/http/http_oauth2_bearer_token.sh @@ -16,4 +16,4 @@ bal run bbe/service.bal & sleep 10s response=$(bal run bbe/client.bal 2>&1 | tail -n 1) assertNotEmpty "$response" -assertEquals "$response" "Hello, World!" +assertEquals "$response" "[{\"title\":\"Blue Train\",\"artist\":\"John Coltrane\"},{\"title\":\"Jeru\",\"artist\":\"Gerry Mulligan\"}]" diff --git a/bbes/http/http_oauth2_client_credentials_grant.sh b/bbes/http/http_oauth2_client_credentials_grant.sh index 874e90ec..346e85ab 100755 --- a/bbes/http/http_oauth2_client_credentials_grant.sh +++ b/bbes/http/http_oauth2_client_credentials_grant.sh @@ -16,4 +16,4 @@ bal run bbe/service.bal & sleep 10s response=$(bal run bbe/client.bal 2>&1 | tail -n 1) assertNotEmpty "$response" -assertEquals "$response" "Hello, World!" +assertEquals "$response" "[{\"title\":\"Blue Train\",\"artist\":\"John Coltrane\"},{\"title\":\"Jeru\",\"artist\":\"Gerry Mulligan\"}]" diff --git a/bbes/http/http_oauth2_jwt_bearer_grant.sh b/bbes/http/http_oauth2_jwt_bearer_grant.sh index 4ff510d7..0b72f1d7 100755 --- a/bbes/http/http_oauth2_jwt_bearer_grant.sh +++ b/bbes/http/http_oauth2_jwt_bearer_grant.sh @@ -16,4 +16,4 @@ bal run bbe/service.bal & sleep 10s response=$(bal run bbe/client.bal 2>&1 | tail -n 1) assertNotEmpty "$response" -assertEquals "$response" "Hello, World!" +assertEquals "$response" "[{\"title\":\"Blue Train\",\"artist\":\"John Coltrane\"},{\"title\":\"Jeru\",\"artist\":\"Gerry Mulligan\"}]" diff --git a/bbes/http/http_oauth2_password_grant.sh b/bbes/http/http_oauth2_password_grant.sh index 8f3a4986..411ce928 100755 --- a/bbes/http/http_oauth2_password_grant.sh +++ b/bbes/http/http_oauth2_password_grant.sh @@ -16,4 +16,4 @@ bal run bbe/service.bal & sleep 10s response=$(bal run bbe/client.bal 2>&1 | tail -n 1) assertNotEmpty "$response" -assertEquals "$response" "Hello, World!" +assertEquals "$response" "[{\"title\":\"Blue Train\",\"artist\":\"John Coltrane\"},{\"title\":\"Jeru\",\"artist\":\"Gerry Mulligan\"}]" diff --git a/bbes/http/http_oauth2_refresh_token_grant.sh b/bbes/http/http_oauth2_refresh_token_grant.sh index be180e86..75059870 100755 --- a/bbes/http/http_oauth2_refresh_token_grant.sh +++ b/bbes/http/http_oauth2_refresh_token_grant.sh @@ -16,4 +16,4 @@ bal run bbe/service.bal & sleep 10s response=$(bal run bbe/client.bal 2>&1 | tail -n 1) assertNotEmpty "$response" -assertEquals "$response" "Hello, World!" +assertEquals "$response" "[{\"title\":\"Blue Train\",\"artist\":\"John Coltrane\"},{\"title\":\"Jeru\",\"artist\":\"Gerry Mulligan\"}]" diff --git a/bbes/http/http_ssl_tls.sh b/bbes/http/http_ssl_tls.sh index df3101b8..3e307e61 100755 --- a/bbes/http/http_ssl_tls.sh +++ b/bbes/http/http_ssl_tls.sh @@ -12,4 +12,4 @@ bal run bbe/service.bal & sleep 10s response=$(bal run bbe/client.bal 2>&1 | tail -n 1) assertNotEmpty "$response" -assertEquals "$response" "Hello, World!" +assertEquals "$response" "[{\"title\":\"Blue Train\",\"artist\":\"John Coltrane\"},{\"title\":\"Jeru\",\"artist\":\"Gerry Mulligan\"}]"