This certification toolkit is targeted at the DCSA standard for Track and Trace v2.2.
This certification toolkit is currently in a "pre-alpha" development stage. It must not be used to establish conformance of implementations of the standard.
It is made available in order to allow early feedback on the toolkit itself.
If you would like to build required DCSA packages individually, begin with step 1.
-
Build DCSA-TNT as described in DCSA-TNT/README.md For TNT 2.2 we have to checkout tag 0.0.1-reactive
git checkout tags/0.0.1-reactive
Build it as a library by commenting out the build plugin in the pom.xml. -
Clone DCSA-Certification-ToolKit-API-Consumer (with
--recurse-submodules
option.) -
Build using
mvn clean install
-
Run application
mvn spring-boot:run [options]
options:
-Dspring-boot.run.arguments="--DB_HOSTNAME=localhost:5432 --AUTH0_ENABLED=false --LOG_LEVEL=DEBUG"
OR using docker-compose
docker-compose up -d -V --build
Publish the docker images using github package
Along with Consumer conformance toolkit, we need a running database intance loaded with test data. Hence, we need below two docker images to publish.
Assuming you have docker images availabe at your local and github repo created
- Consumer Compatibility kit:
docker tag <image_name >:latest docker.pkg.github.com/<user_name>/<repo_name>/ctk-consumer:<tagname>
docker push docker.pkg.github.com/<user_name>/<repo_name>/ctk-consumer:<tagname>
- Reference database
docker tag <image_name>:latest docker.pkg.github.com/<user_name>/<repo_name>/ctk-db:<tagname>
docker push docker.pkg.github.com/<user_name>/<repo_name>/ctk-db:<tagname>
We need a way to generate test shipment events. This test event time should be configurable event time in the past, present, and future. That is why this new extension was implemented.
Endpoints for this extension |
---|
POST /conformance/data-management/uploadShipment |
GET /conformance/data-management/example-data/full-shipment |
GET /conformance/data-management/example-data/full-shipment?timeOffset=plus4d (with time offset) |
DELETE /conformance/data-management/removeLastShipment |
DELETE /conformance/data-management/removeAllEvent |
Note that the above endpoint won't work out of the box. Because the DCSA information model changes frequently. We have to update according to the updates
Powershell script for generating and loading test data. Primarily used with conformance tooling.
It will find all JSON file recursively and perform POST request from current directory
.\upload.ps1
Pass the json file as parameter (-Param1 jsonFullShipment.json)
.\uploadShipmentEvent.ps1 -Param1 jsonFullShipment.json
Users can upload shipment event either by these powershell script or calling above rest endpoints by postman.
Referenc:
https://faun.pub/how-to-setup-your-first-github-packages-docker-repository-2cda078e6836