Skip to content

Commit

Permalink
fix: fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Han-Ya-Jun committed Dec 26, 2023
1 parent 99f7c3d commit a81e1c0
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/apisix/tests/bk-components/test-bkauth.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

Expand Down Expand Up @@ -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
)

Expand All @@ -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
)

Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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
)

Expand All @@ -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
)

Expand Down Expand Up @@ -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
)

Expand All @@ -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
)

Expand All @@ -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
)

Expand All @@ -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
)

Expand Down

0 comments on commit a81e1c0

Please sign in to comment.