specs, fix mockapi in auth scenarios (#4740)
for invalid case, test is considered pass on 403 response code.
This commit is contained in:
Родитель
0487edc372
Коммит
657d4a0f1c
|
@ -1,8 +1,8 @@
|
|||
import { json, passOnSuccess, ScenarioMockApi } from "@typespec/spec-api";
|
||||
import { json, passOnCode, passOnSuccess, ScenarioMockApi } from "@typespec/spec-api";
|
||||
|
||||
export const Scenarios: Record<string, ScenarioMockApi> = {};
|
||||
|
||||
Scenarios.Authentication_ApiKey_invalid = passOnSuccess({
|
||||
Scenarios.Authentication_ApiKey_invalid = passOnCode(403, {
|
||||
uri: `/authentication/api-key/invalid`,
|
||||
method: `get`,
|
||||
request: {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { json, passOnSuccess, ScenarioMockApi } from "@typespec/spec-api";
|
||||
import { json, passOnCode, passOnSuccess, ScenarioMockApi } from "@typespec/spec-api";
|
||||
|
||||
export const Scenarios: Record<string, ScenarioMockApi> = {};
|
||||
|
||||
|
@ -16,12 +16,12 @@ Scenarios.Authentication_Http_Custom_valid = passOnSuccess({
|
|||
kind: "MockApiDefinition",
|
||||
});
|
||||
|
||||
Scenarios.Authentication_Http_Custom_invalid = passOnSuccess({
|
||||
Scenarios.Authentication_Http_Custom_invalid = passOnCode(403, {
|
||||
uri: `/authentication/http/custom/invalid`,
|
||||
method: "get",
|
||||
request: {
|
||||
headers: {
|
||||
authorization: "SharedAccessKey valid-key",
|
||||
authorization: "SharedAccessKey invalid-key",
|
||||
},
|
||||
status: 403,
|
||||
},
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { json, passOnSuccess, ScenarioMockApi } from "@typespec/spec-api";
|
||||
import { json, passOnCode, passOnSuccess, ScenarioMockApi } from "@typespec/spec-api";
|
||||
|
||||
export const Scenarios: Record<string, ScenarioMockApi> = {};
|
||||
|
||||
|
@ -16,7 +16,7 @@ Scenarios.Authentication_OAuth2_valid = passOnSuccess({
|
|||
kind: "MockApiDefinition",
|
||||
});
|
||||
|
||||
Scenarios.Authentication_OAuth2_invalid = passOnSuccess({
|
||||
Scenarios.Authentication_OAuth2_invalid = passOnCode(403, {
|
||||
uri: `/authentication/oauth2/invalid`,
|
||||
method: "get",
|
||||
request: {
|
||||
|
|
Загрузка…
Ссылка в новой задаче