QA Testing Guide for GetVesselErrorLogFunction
Overview
The GetVesselErrorLogFunction is an Azure Function that retrieves error logs for a specific IMO (International Maritime Organization) number. It is exposed as an HTTP GET endpoint and supports various response scenarios based on the request and authorization.
# Endpoint Details
HTTP Method: GET
Route: /v2/odv/get-error-logs/{imo}
Authorization: Bearer Token (JWT)
Path Parameter: imo (required, string)
Test Scenarios
# 1. Valid Request
## Objective:
Verify that the function returns the correct error log for a valid IMO number and valid authorization token.
## Steps:
Send a GET request to /v2/odv/get-error-logs/{imo} with:
A valid IMO number in the path.
A valid Bearer token in the Authorization header.
Verify the response:
Status Code: 200 OK
Response Body: JSON object of type ErrorLogResponse containing the error log details.
Response Content: Ensure the response matches the one retrieved from the ADV GraphQL advOdvErrors endpoint for the given IMO.
## Expected Result:
The response contains the error log for the specified IMO. The error log details should match the data from the ADV GraphQL endpoint.
# 2. Invalid IMO Number
## Objective:
Verify that the function handles invalid IMO numbers gracefully.
## Steps:
Send a GET request to /v2/odv/get-error-logs/{imo} with:
An invalid IMO number in the path.
A valid Bearer token in the Authorization header.
Verify the response:
Status Code: 404 Not Found
Response Body: Empty.
## Expected Result:
The response indicates that the IMO number is invalid.
# 3. Unauthorized Request
## Objective:
Verify that the function rejects requests without a valid authorization token.
## Steps:
Send a GET request to /v2/odv/get-error-logs/{imo} with:
A valid IMO number in the path.
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
Test Case | IMO Number | Authorization Token | Expected Status Code | Notes
Valid Request | 9795074 | Valid Token | 200 OK | Ensure the IMO exists.
Invalid IMO Number | invalid-imo | Valid Token | 404 Not Found | Test with invalid IMO.
Unauthorized Request | 9795074 | None/Invalid Token | 401 Unauthorized | Test with missing/invalid JWT.
Tools and Environment
Tools: Postman, OpenAPI UI, or any HTTP client.
Environment: CommonCore Stage https://apim-abs-cc-scus-stg.azure-api.net.
Dependencies: Ensure all required services (e.g., ADV GraphQL advOdvErrors endpoint) are functional.
Additional Notes
query ($imoNumber: String!) {
advOdvErrors(filterParameters: {imoNumber: $imoNumber}) {
id
imo
errorLogCount
lastRunDate
lastReportDate
vesselName
errorLogsList {
id
code
category
message
createdAt
reportId
__typename
}
__typename
}
}
Validate the response schema for each test case to ensure it matches the expected types (ErrorLogResponse or ErrorResponse).
Log any discrepancies or unexpected behavior for further investigation.
Ensure proper cleanup of test data after execution.
Client ID, tenant ID, and secret for testing can be requested from the CC team.
The query used to fetch error logs from the ADV GraphQL endpoint is: