diff --git a/src/apisix/tests/bk-components/test-bkauth.lua b/src/apisix/tests/bk-components/test-bkauth.lua index 8786364..7e5e756 100644 --- a/src/apisix/tests/bk-components/test-bkauth.lua +++ b/src/apisix/tests/bk-components/test-bkauth.lua @@ -58,7 +58,7 @@ describe( local result, err = bkauth.verify_app_secret("fake-app-code", "fake-app-secret") assert.is_nil(result) assert.is_true(core.string.has_prefix(err, "failed to request third-party api")) - assert.is_true(core.string.has_prefix(err, "request_id")) + assert.is_true(core.string.contains(err, "request_id")) end ) @@ -93,7 +93,7 @@ describe( local result, err = bkauth.verify_app_secret("fake-app-code", "fake-app-secret") assert.is_nil(result) assert.is_true(core.string.has_prefix(err, "failed to request third-party api")) - assert.is_true(core.string.has_prefix(err, "request_id")) + assert.is_true(core.string.contains(err, "request_id")) end ) @@ -116,7 +116,7 @@ describe( local result, err = bkauth.verify_app_secret("fake-app-code", "fake-app-secret") assert.is_nil(result) assert.is_true(core.string.has_prefix(err, "failed to request third-party api")) - assert.is_true(core.string.has_prefix(err, "request_id")) + assert.is_true(core.string.contains(err, "request_id")) end ) @@ -176,7 +176,7 @@ describe( local result, err = bkauth.list_app_secrets("fake-app-code") assert.is_nil(result) assert.is_true(core.string.has_prefix(err, "failed to request third-party api")) - assert.is_true(core.string.has_prefix(err, "request_id")) + assert.is_true(core.string.contains(err, "request_id")) end ) it( @@ -213,7 +213,7 @@ describe( local result, err = bkauth.list_app_secrets("fake-app-code") assert.is_nil(result) assert.is_true(core.string.has_prefix(err, "failed to request third-party api")) - assert.is_true(core.string.has_prefix(err, "request_id")) + assert.is_true(core.string.contains(err, "request_id")) end ) @@ -236,7 +236,7 @@ describe( local result, err = bkauth.list_app_secrets("fake-app-code") assert.is_nil(result) assert.is_true(core.string.has_prefix(err, "failed to request third-party api")) - assert.is_true(core.string.has_prefix(err, "request_id")) + assert.is_true(core.string.contains(err, "request_id")) end ) @@ -287,6 +287,7 @@ describe( local result, err = bkauth.verify_access_token("fake-token") assert.is_nil(result) assert.is_true(core.string.has_prefix(err, "failed to request third-party api")) + assert.is_true(core.string.contains(err, "request_id")) end ) @@ -300,7 +301,7 @@ describe( local result, err = bkauth.verify_access_token("fake-token") assert.is_nil(result) assert.is_true(core.string.has_prefix(err, "failed to request third-party api")) - assert.is_true(core.string.has_prefix(err, "request_id")) + assert.is_true(core.string.contains(err, "request_id")) end ) @@ -315,7 +316,7 @@ describe( local result, err = bkauth.verify_access_token("fake-token") assert.is_nil(result) assert.is_true(core.string.has_prefix(err, "failed to request third-party api")) - assert.is_true(core.string.has_prefix(err, "request_id")) + assert.is_true(core.string.contains(err, "request_id")) end ) @@ -335,7 +336,7 @@ describe( local result, err = bkauth.verify_access_token("fake-token") assert.is_nil(result) assert.is_true(core.string.has_prefix(err, "bkauth error message: error")) - assert.is_true(core.string.has_prefix(err, "request_id")) + assert.is_true(core.string.contains(err, "request_id")) end )