UNPKG

@apistudio/apim-cli

Version:

CLI for API Management Products

186 lines (177 loc) 3.55 kB
--- kind: api apiVersion: api.webmethods.io/v1 metadata: name: PaymentAPI namespace: dev version: '1.0' tags: - swagger - nested - json type: REST spec: mocked: true api-spec: $path: specs/swagger.json policy-sequence: - $ref: dev:dev_policies:1.0 --- kind: HTTPEndpoint apiVersion: api.webmethods.io/beta metadata: name: default_endpoint1 version: '1.0' namespace: dev spec: url: http://test.com method: GET connectTimeout: 300 readTimeout: 200 sslConfig: keyStoreAlias: '' keyAlias: '' truststoreAlias: '' serviceRegistryParameters: - name: '' value: '' --- kind: StagedPolicySequence apiVersion: api.webmethods.io/v1 metadata: name: dev_policies version: '1.0' namespace: dev tags: - dev_policies spec: transport: - $ref: dev:enable_https1:1.0 routing: - $ref: dev:my-default-routing1:1.0 --- kind: Route apiVersion: api.webmethods.io/beta metadata: name: my-default-routing1 version: '1.0' namespace: dev tags: - routing - route - policy spec: default-endpoint: $ref: dev:default_endpoint1:1.0 --- kind: Transport apiVersion: api.webmethods.io/v1 metadata: name: enable_https1 namespace: dev version: '1.0' spec: protocol: - http - https --- kind: Assertion metadata: name: TestPaymentAssertion version: "1.0" tags: - payEnv namespace: dev spec: - name: "Validate the response status" key: "status" value: "Not Found" action: "notEquals" - name: "Validate the header content type- value" key: "header().Content-Type" value: "application/json" action: "equals" - name: "Validate the header content type" key: "header()" value: "Content-Type" action: "haveProperty" - name: "Less Than the response Time" key: "responseTime" value: 2000000 action: "lessThan" - name: "Greater Than the response Time" key: "responseTime" value: 20 action: "greaterThan" - name: "Validate to have property to have id" key: "json()" value: "id" action: "haveProperty" - name: "Validate to not have property to have id" key: "json()" value: "id" action: "notHaveProperty" --- kind: Environment metadata: name: TestPaymentsEnvironment version: "1.0" tags: - payEnv namespace: dev spec: variables: - key: "X-Gateway-APIKey" value: "${X-Gateway-APIKey}" --- kind: test metadata: name: TestPayments version: "1.0" tags: - functional namespace: dev spec: api: $ref: dev:PaymentAPI:1.0 environment: $ref: dev:TestPaymentsEnvironment:1.0 request: - method: ${method} resource: v2/pet headers: - key: Content-Type value: ${content-type} auth: noauth: true payload: raw: json: | { "id": 0, "category": { "id": 0, "name": "${dogname}" }, "name": "doggie", "photoUrls": [ "string" ], "tags": [ { "id": 0, "name": "string" } ], "status": "available" } settings: sslVerification: false encodeURL: true assertions: $ref: dev:TestPaymentAssertion:1.0 expressions: - name: "Validate the response code" key: "code" value: 200 action: "equals"