QA Testing Guide for CreateUpdateVesselsFunction

Overview

The CreateUpdateVesselsFunction is an Azure Function that retrieves vessels objects. It is exposed as an HTTP PUT endpoint and supports various response scenarios based on the request and authorization.

# Endpoint Details

  • HTTP Method: PUT

  • Route: /v1/vessel

  • Authorization: Bearer Token (JWT)

  • Body: An array of JSON objects of type Wavesight.Advantage.Domain.Vessel.Vessel

Test Scenarios

# 1. Valid Request

## Objective:

Verify that the function returns HTTP CODE 202 (Accepted).

## Steps:

  • Send a PUT request to /v1/vessel with:

  • An array of JSON objects of type Wavesight.Advantage.Domain.Vessel.Vessel in a request body.

  • A valid Bearer token in the Authorization header.

  • Verify the response:

  • Status Code: 202 Accepted

## Expected Result:

The response contains a confirmation that the request is accepted.

Test Data

[

    {

        "imoNumber": {

            "value": "1"

        },

        "name": "one"

    }

]

# 2. Invalid vessels data

## Objective:

Verify that the function handles invalid vessel objects gracefully.

## Steps:

  • Send a PUT request to /v1/vessel with:

  • An array of JSON objects of type Wavesight.Advantage.Domain.Vessel.Vessel in a request body.

  • A valid Bearer token in the Authorization header.

  • Verify the response:

  • Status Code: 400 Bad Request

  • Response Body: JSON object of type ErrorResponse with a description of the error.

## Expected Result:

The response indicates that the vessels data is invalid.

Test Data

{]

# 3. Unauthorized Request

## Objective:

Verify that the function rejects requests without a valid authorization token.

## Steps:

  • Send a PUT request to /v1/vessel with:

  • No Authorization header or an invalid Bearer token.

  • Verify the response:

  • Status Code: 401 Unauthorized

  • Response Body: JSON object of type ErrorResponse with a description of the error.

## Expected Result:

The response indicates that the request is unauthorized.

Test Data

No Authorization header

Tools and Environment

  • Tools: Postman, OpenAPI UI, or any HTTP client.

  • Environment: CommonCore Stage https://apim-abs-cc-scus-stg.azure-api.net.

  • Dependencies: No dependencies.

Additional Notes

  • Validate the request schema for valid request to ensure it matches the expected type (Wavesight.Advantage.Domain.Vessel.Vessel[]).

  • Validate the response schema for unsuccessful test cases to ensure it matches the expected type (ErrorResponse).

  • Log any discrepancies or unexpected behavior for further investigation.

  • Ensure proper cleanup of test data after execution.

  • How to get token link.

  • Client ID, tenant ID, and secret for testing can be requested from the CC team.