Skip to content

Commit

Permalink
Add unit test suite page
Browse files Browse the repository at this point in the history
  • Loading branch information
aloccid-iata committed Jan 11, 2024
1 parent 02d47e0 commit c43b481
Show file tree
Hide file tree
Showing 10 changed files with 5,969 additions and 2 deletions.
5,890 changes: 5,890 additions & 0 deletions working_draft/API/docs/assets/unit-tests/1R_Unit_Tests.postman_collection

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"id": "c6f10eda-fcfc-49c7-bf2e-8a6d49faf20e",
"name": "Unit Test Setup",
"values": [
{
"key": "baseUrl",
"value": "http://localhost:8080",
"type": "default",
"enabled": true
}
],
"_postman_variable_scope": "environment",
"_postman_exported_at": "2024-01-11T13:09:50.533Z",
"_postman_exported_using": "Postman/10.21.14"
}
2 changes: 1 addition & 1 deletion working_draft/API/docs/community.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Issues on the ONE Record API specification are tracked in GitHub:
- [Henk Mulder](https://github.com/edesignextended), IATA
- [Daniel A. Döppner](https://github.com/ddoeppner), Lufthansa Industry Solutions
- [Davide Alocci](https://github.com/alodavide), IATA
- [Davide Alocci](https://github.com/aloccid-iata), IATA

# Contributors

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
61 changes: 61 additions & 0 deletions working_draft/API/docs/tools/unit-tests.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# ONE Record API Unit Test suite

ONE Record is the new IATA standard for data sharing and creates a single record view of the shipment.

The ONE Record standard is highly technical and there is a risk that different parties interpret the specifications differently, which would lead to data quality issues and disruption of connectivity between different network players. 

Due to this rationale, we construct a unit test suite with the aim of verifying that any implementation aligns with the API specifications.
The unit test suite is freely available for self testing and can be run locally using Postman or any software compatible with Postman collections.

## Suite structure

The Unit Test suite is divided in several sections:

- Server Information

- Logistics Objects

- Logistics Events

- Subscriptions

- Access Delegations

- Action Requests

Every section is crafted to assess a distinct segment of the ONE Record API, operating autonomously from the other sections. Within each section, calls must be carried out sequentially. For instance, within the Logistics Events section, the prerequisite folder generates all necessary logistics objects for the test. The Create folder performs tests related to the creation of Logistics Events, while the Get folder attempts to fetch the Logistics Events generated by the preceding calls.

## How to run the Unit Tests suite

As a prerequisite for utilizing the Unit Test suite, it is necessary to install Postman or a compatible software.
Once Postman is installed, please adhere to the subsequent steps to execute the Unit Tests suite.

- [Download the Postman Collection here.](../assets/unit-tests/1R_Unit_Tests.postman_collection)

- [Download the Postman Environment here](../assets/unit-tests/Unit_Test_Setup.postman_environment)

- Import the Unit Test Step Environment in Postman

![Postman Environment](../img/unit-tests/postmanEnv.png)

- Import the Collection in Postman

![Postman Collection](../img/unit-tests/postmanColl.png)

- Navigate to the Environments tab, choose the **Unit Test Setup** environment, and configure the baseUrl to point to the API server under test.

![Environment Configuration](../img/unit-tests/envConfig.png)

- Access the Collections in the right menu and open the previously imported **ONE Record API Unit Tests** collection.

![Unit Test suite](../img/unit-tests/testCollection.png)

- Utilize the Authorization tab to configure the authorization method implemented in your server.

![Authorization setup](../img/unit-tests/authSetup.png)

- Once the authorization is configured, you have the option to either execute the calls individually or employ the Collection Run feature.

Each call comprises a set of tests that will be applied to both the response payload and response headers during execution. It's crucial to emphasize that the presentation of test results may vary depending on the tool being used.

In case of issues with the Unit Test Suite, please contact the IATA Digital Cargo team (see [Community page](../community.md)).
3 changes: 2 additions & 1 deletion working_draft/API/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@ nav:
- Reference:
- Glossary: 'glossary.md'
- Bibliography: 'bibliography.md'
- Tools:
- Unit Test Suite: "tools/unit-tests.md"
- Development:
- License: "license.md"
- Changelog: "changelog.md"
- Community: 'community.md'


# Theme Configuration
theme:
Expand Down

0 comments on commit c43b481

Please sign in to comment.