HOW-TO Test, Verify and Validate Your service...Check the following • Received message from STM...
Transcript of HOW-TO Test, Verify and Validate Your service...Check the following • Received message from STM...
HOW-TO Test, Verify and Validate Your service
Version Date Sign Description
0.9 2019-04-01 MO (Need to be revised)
This HOW-TO describes how a VIS based service can be tested.
Test procedures
• Unit tests by each service implementerInternal test of API and functionality
• Technical integration tests between services (technical interoperability tests)External test of public API and interaction with other services
• Operational testsExternal test including application and logic behind the service.
Test ToolsVarious test tools have been developed and there are several tools online that can support in tests of the REST API.
The most used tool in FAT and SAT is the STM Module Tool.
Test Tools
STM Module Tool
VIS Private
VIS Public
SMA VIS
Service to test
Verification Service
Service to test
Service to test
BrowserVIS Public Swagger UI
SMA VIS
Service to test
CURL
Application
VIS Private
VIS Public
STM Module ToolThe STM Module Tool is a windows application that connects to the private side of a SMA VIS implementation. Thus, the tool requires a VIS instance with a private REST interface according to SMA implementation. An instance can be created by SMA on request.
The private side follows the VIS Private REST Technical Design that can be found on Developer Forum.http://s3-eu-west-1.amazonaws.com/stm-stmvalidation/uploads/20170403113238/VIS-REST-Design-Private-STM-Project_v2.2-.docx
The source code for The STM Module Tool can be found in GitHubhttps://github.com/SeaTrafficManagement/StmModuleMockup
A Windows executable can be found at Project Placehttps://service.projectplace.com/#project/1145945756/documents/1562912390
Verification ServiceA VIS Verification service has been deployed in STAGING environment in its first version (2017-10-30).
The service supports the following verifications:
• Sending voyage plan (RTZ) to another service– Tests also <Tested Service> as client
The Verification Service will return content in received certificate and make a lookup in Service Registry to return a text message.
• Receiving voyage plan (RTZ)– The Verification Service uploads the received voyage plan back to the service
– Tests also <Tested Service> as server (host)
• Receiving text message (TXT)
• Sending text message (TXT) to another service
• Sending area message (S124) to another service
• Receiving different variants of voyage plans (RTZ)
• Receiving different variants of text messages (TXT)
• Receiving different variants of area messages (S124)
• Test Service Registration
• Client Certificate
• Server (Host) Certificate
Use Case 1
V
I
S
Appl
Test object
STM VIS Verification
Service
Service Registry
Identity Registry
RTZ-1uploadVoyagePlan
uploadVoyagePlan
uploadText
uploadArea
RTZ-1
TXT-1
S124-1
STM VIS Verification
“appl”
notify
getMessage
callService
Find service instance ID
Use Case 2Test object
Verification Service
Service Registry
Identity Registry
TXT-C1 TXT-C1uploadText
uploadVoyagePlan
uploadText
uploadArea
RTZ-2
TXT-2
S124-2
Select Case command“check registry”“check certificate”“get test voyage plans”“get test text messages”“get test area messages”“get test port call messages”
<?xml version="1.0" encoding="UTF-8"?><textMessage xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://stmvalidation.eu/schemas/textMessageSchema_1_3.xsd" ><textMessageId>urn:mrn:stm:txt:sma:20170929104400-1</textMessageId><author>Mikael</author><from>urn:mrn:stm:service:instance:sma:stmvalidation</from><createdAt>2017-10-10T08:00:00Z</createdAt><subject>execute_test</subject><body>…command…</body>
</textMessage>
Where TXT-C1 is
Present commands in body• HELP
• RTZ• TXT• S124
Usage of Verification Service –UC1
Mode 1 (Use Case 1).
The intention is to provide complete chains of tests from client application, to service provider and a reply back to the service client acting as host.
Initiate test of RTZ
• Create/select a well-known voyage plan, text or area message
• Find the STM VIS Verification Service
• Send (upload) message to the service
Check the following
• Received message from STM Verification Service is identical with sent message
• Received text with verification results and service registration information
If no messages received, the following may be wrong
• Invalid message
• Certificates
• URL in Service Registry
Usage of Verification Service –UC2
Mode 2 (Use Case 2).
The intention is to initiate reception of a set of variants of messages.
Initiate test of RTZ
• Send a text message (TXT) with execute_test in <subject> and RTZ in <body>
Check the following
• Received voyage plans from STM Verification Service can be displayed and handled
• Received text with verification results and service registration information
If no messages received, the following may be wrong
• Certificates
• URL in Service Registry
Same type of test can be made with S124, or TXT in the body.
If you send help in the body, you get a descriptive text message in return.
<?xml version="1.0" encoding="utf-8"?>
<textMessage xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://stmvalidation.eu/schemas/textMessageSchema_1_3.xsd">
<textMessageId>urn:mrn:stm:txt:sma:20170929104400-1</textMessageId>
<author>author</author>
<from>urn:mrn:stm:service:instance:sma:stmvalidation</from>
<createdAt>2017-09-29T08:00:00Z</createdAt>
<subject>execute_test</subject>
<body>RTZ</body>
</textMessage>
HOW-TO Send voyage plan to a serviceCase 1
Tools
• Editor (such as Notepad++)
• STM Module Tool (or other tool to interact with VIS Public REST API)
Step-by-stepIn Editor• Select base route and open in editor• Edit
• vesselName• vesselIMO• vesselMMSI• Waypoint• Schedule
• Save As New file or copy content
Step-by-stepIn STM Module Tool*• Choose upper menu Find services
• Select the instance• Select lower menu Upload VP
• Either Load message and select save file• Or Paste (Ctrl-V) copied message from editor• Press Ok
• Check that 200 OK is given in response window
*CURL, PostMan, Swagger UI and other tools can also be used to upload (POST) a voyage plan (RTZ) to a service.
Test Data
Test Data for each format can be found on
https://www.stmvalidation.eu/developers-forum/schemas/