Commit 03de0f57 authored by Dan Jones's avatar Dan Jones
Browse files

Merge branch '3-implement-bdd-tests-in-cucumber' into...

Merge branch '3-implement-bdd-tests-in-cucumber' into '1-import-prototype-adapter-code-from-example-web-client'

Resolve "Implement bdd tests in cucumber"

See merge request !2
parents ec074c62 645b90f6
{
"message": "Invalid client credentials"
}
\ No newline at end of file
{
"token": "gAAAAABjwB-vxtER44M2en6xYyt7G1WXp8QwfsiHw-ijCqNBZpQPwxxrBHzUU1fQ9lfPPo4QHj50p-yh203dV6zLLoTzuiReqGzE2InqAxOwv4gddlQWNFJKyrmg4mVVMX2VZe2cCAljmHxEo66BHgt_T24AieedMnI4VR2kw4SFiooFv5nr2W8=",
"expiry": "2030-12-31T23:59:59.000000"
}
\ No newline at end of file
const fs = require('fs');
const path = require('path');
exports.fixtures = {
get: function (fixtureName) {
try {
let fixtureContent = fs.readFileSync(path.join(__dirname, `${fixtureName}.json`));
let fixture = JSON.parse(fixtureContent);
return fixture;
} catch(e) {
console.error('Fixture not found', fixtureName);
return null;
}
}
}
\ No newline at end of file
{
"message_type": "VehicleMission",
"headers": {
"metadata": {
"source": "ae",
"destination": "soar.po.ecosub.eco1",
"delivery_type": "publish",
"message_id": "test"
},
"operator_id": "po",
"vehicle_id": "eco1",
"coordinates": {
"latitude": 59.234,
"longitude": -10.432,
"depth": 50,
"projection": "EPSG:4326"
"payload": {
"message_type": "VehicleMission",
"operator_id": "po",
"vehicle_id": "eco1",
"coordinates": {
"latitude": 59.234,
"longitude": -10.432,
"depth": 50,
"projection": 4326
},
"actions": []
}
}
{
"message_type": "VehicleMission",
"headers": {
"metadata": {
"source": "ae",
"destination": "soar.po.ecosub.eco1",
"delivery_type": "publish",
"message_id": "test"
},
"operator_id": "po",
"vehicle_id": "eco1",
"coordinates": {
"latitude": 59.234,
"longitude": -10.432,
"depth": 50,
"projection": "EPSG:4326"
},
"actions": [
{
"action_type": "GoToWaypoint",
"coordinates": {
"latitude": 59.234,
"longitude": -10.432,
"depth": 50,
"projection": "EPSG:4326"
}
"payload": {
"message_type": "VehicleMission",
"operator_id": "po",
"vehicle_id": "eco1",
"coordinates": {
"latitude": 59.234,
"longitude": -10.432,
"depth": 50,
"projection": 4326
},
{
"action_type": "DescendToAltitude",
"coordinates": {
"latitude": 59.234,
"longitude": -10.432,
"altitude": 50,
"projection": "EPSG:4326"
"actions": [
{
"action_type": "GoToWaypoint",
"coordinates": {
"latitude": 59.234,
"longitude": -10.432,
"depth": 50,
"projection": 4326
}
},
{
"action_type": "DescendToAltitude",
"coordinates": {
"latitude": 59.234,
"longitude": -10.432,
"altitude": 50,
"projection": 4326
}
}
}
]
]
}
}
{
"message_type": "VehicleStatus",
"headers": {
"metadata": {
"source": "ae",
"destination": "soar.po.ecosub.eco1",
"delivery_type": "publish",
"message_id": "test"
},
"operator_id": "po",
"vehicle_id": "eco1",
"coordinates": {
"latitude": 57.234,
"longitude": -8.432,
"depth": 50,
"projection": "EPSG:4326"
},
"battery_percentage": 64
}
"payload": {
"message_type": "VehicleStatus",
"operator_id": "po",
"vehicle_id": "eco1",
"coordinates": {
"latitude": 57.234,
"longitude": -8.432,
"depth": 50,
"projection": 4326
},
"battery_percentage": 64
}
}
\ No newline at end of file
{
"swagger": "2.0",
"basePath": "/soar",
"openapi": "3.0.3",
"info": {
"title": "soar",
"version": "1.3.1",
"version": "1.0",
"description": "SoAR message schemas"
},
"produces": ["application/json"],
"consumes": ["application/json"],
"definitions": {
"Message": {
"discriminator": {
"propertyName": "message_type",
"mapping": {
"VehicleStatus": "#/definitions/VehicleStatus",
"VehicleMission": "#/definitions/VehicleMission",
"AreaOfInterest": "#/definitions/AreaOfInterest"
}
},
"oneOf": [
{
"$ref": "#/definitions/VehicleStatus"
},
{
"$ref": "#/definitions/VehicleMission"
},
{
"$ref": "#/definitions/AreaOfInterest"
}
]
},
"Metadata": {
"properties": {
"source": {
"type": "string",
"description": "The sender.",
"example": "autonomy-engine"
},
"destination": {
"type": "string",
"description": "Publisher topic.",
"example": "soar.noc.autosub.ah1.status"
},
"delivery_type": {
"type": "string",
"description": "Published or broadcast",
"enum": ["broadcast", "publish"],
"example": "2.0.0"
"paths": {},
"components": {
"schemas": {
"Message": {
"properties": {
"metadata": {
"$ref": "#/components/schemas/Metadata"
},
"payload": {
"$ref": "#/components/schemas/Payload"
}
},
"message_id": {
"type": "string",
"description": "An identifier for the type of message received.",
"example": "VehicleStatus"
}
"required": ["metadata", "payload"]
},
"type": "object"
},
"Coordinates": {
"properties": {
"latitude": {
"type": "number",
"description": "Latitude in decimal degrees.",
"example": 54.234
},
"longitude": {
"type": "number",
"description": "Longitude in decimal degrees.",
"example": -1.432
},
"depth": {
"type": "number",
"description": "Target depth",
"default": 0,
"example": 50
},
"altitude": {
"type": "number",
"description": "Target altitude above bottom",
"default": 0,
"example": 50
},
"projection": {
"type": "integer",
"description": "EPSG Projection Code",
"example": 4326,
"default": 4326
}
}
},
"VehicleStatus": {
"properties": {
"message_type": {
"type": "string",
"description": "An identifier for the payload type.",
"example": "VehicleStatus",
"enum": ["VehicleStatus"]
},
"metadata": {
"$ref": "#/definitions/Metadata"
},
"operator_id": {
"type": "string",
"description": "An identifier for the operator.",
"example": "noc"
},
"vehicle_id": {
"type": "string",
"description": "An identifier for the vehicle.",
"example": "noc_ah1"
},
"coordinates": {
"$ref": "#/definitions/Coordinates"
},
"battery_percentage": {
"type": "number",
"description": "The remaining battery capacity.",
"example": 64
}
}
},
"VehicleMission": {
"properties": {
"message_type": {
"type": "string",
"description": "An identifier for the payload type.",
"example": "VehicleMission",
"enum": ["VehicleMission"]
},
"metadata": {
"$ref": "#/definitions/Metadata"
"Payload": {
"discriminator": {
"propertyName": "message_type",
"mapping": {
"VehicleStatus": "#/components/schemas/VehicleStatus",
"VehicleMission": "#/components/schemas/VehicleMission",
"AreaOfInterest": "#/components/schemas/AreaOfInterest"
}
},
"operator_id": {
"type": "string",
"description": "An identifier for the operator.",
"example": "noc"
"oneOf": [
{
"$ref": "#/components/schemas/VehicleStatus"
},
{
"$ref": "#/components/schemas/VehicleMission"
},
{
"$ref": "#/components/schemas/AreaOfInterest"
}
]
},
"Metadata": {
"properties": {
"source": {
"type": "string",
"description": "The sender.",
"example": "autonomy-engine"
},
"destination": {
"type": "string",
"description": "Publisher topic.",
"example": "soar.noc.autosub.ah1.status"
},
"delivery_type": {
"type": "string",
"description": "Published or broadcast",
"enum": ["broadcast", "publish"],
"example": "2.0.0"
},
"message_id": {
"type": "string",
"description": "An identifier for the type of message received.",
"example": "VehicleStatus"
}
},
"vehicle_id": {
"type": "string",
"description": "An identifier for the vehicle.",
"example": "noc_ah1"
"required": ["source","destination","message_id"],
"type": "object"
},
"Coordinates": {
"properties": {
"latitude": {
"type": "number",
"description": "Latitude in decimal degrees.",
"example": 54.234
},
"longitude": {
"type": "number",
"description": "Longitude in decimal degrees.",
"example": -1.432
},
"depth": {
"type": "number",
"description": "Target depth",
"default": 0,
"example": 50
},
"altitude": {
"type": "number",
"description": "Target altitude above bottom",
"default": 0,
"example": 50
},
"projection": {
"type": "integer",
"description": "EPSG Projection Code",
"example": 4326,
"default": 4326
}
},
"coordinates": {
"$ref": "#/definitions/Coordinates"
"required": ["latitude", "longitude"],
"type": "object"
},
"VehicleStatus": {
"properties": {
"message_type": {
"type": "string",
"description": "An identifier for the payload type.",
"example": "VehicleStatus",
"enum": ["VehicleStatus"]
},
"operator_id": {
"type": "string",
"description": "An identifier for the operator.",
"example": "noc"
},
"vehicle_id": {
"type": "string",
"description": "An identifier for the vehicle.",
"example": "noc_ah1"
},
"coordinates": {
"$ref": "#/components/schemas/Coordinates"
},
"battery_percentage": {
"type": "number",
"description": "The remaining battery capacity.",
"example": 64
}
},
"actions": {
"type": "array",
"items": {
"discriminator": {
"propertyName": "action_type",
"mapping": {
"GoToWaypoint": "#/definitions/GoToWaypoint",
"DescendToAltitude": "#/definitions/DescendToAltitude",
"AscendToSurface": "#/definitions/AscendToSurface"
}
},
"oneOf": [
{
"$ref": "#/definitions/VehicleStatus"
},
{
"$ref": "#/definitions/VehicleMission"
"required": ["message_type", "operator_id", "vehicle_id", "coordinates", "battery_percentage"],
"type": "object"
},
"VehicleMission": {
"properties": {
"message_type": {
"type": "string",
"description": "An identifier for the payload type.",
"example": "VehicleMission",
"enum": ["VehicleMission"]
},
"operator_id": {
"type": "string",
"description": "An identifier for the operator.",
"example": "noc"
},
"vehicle_id": {
"type": "string",
"description": "An identifier for the vehicle.",
"example": "noc_ah1"
},
"coordinates": {
"$ref": "#/components/schemas/Coordinates"
},
"actions": {
"type": "array",
"items": {
"discriminator": {
"propertyName": "action_type",
"mapping": {
"GoToWaypoint": "#/components/schemas/GoToWaypoint",
"DescendToAltitude": "#/components/schemas/DescendToAltitude",
"AscendToSurface": "#/components/schemas/AscendToSurface"
}
},
{
"$ref": "#/definitions/AreaOfInterest"
}
]
"oneOf": [
{
"$ref": "#/components/schemas/VehicleStatus"
},
{
"$ref": "#/components/schemas/VehicleMission"
},
{
"$ref": "#/components/schemas/AreaOfInterest"
}
]
}
}
}
}
},
"AreaOfInterest": {
"properties": {
"message_type": {
"type": "string",
"description": "An identifier for the payload type.",
"example": "AreaOfInterest",
"enum": ["AreaOfInterest"]
},
"metadata": {
"$ref": "#/definitions/Metadata"
},
"operator_id": {
"type": "string",
"description": "An identifier for the operator.",
"example": "noc"
},
"vehicle_id": {
"type": "string",
"description": "An identifier for the vehicle.",
"example": "noc_ah1"
"required": ["message_type", "operator_id", "vehicle_id", "coordinates", "actions"],
"type": "object"
},
"AreaOfInterest": {
"properties": {
"message_type": {
"type": "string",
"description": "An identifier for the payload type.",
"example": "AreaOfInterest",
"enum": ["AreaOfInterest"]
},
"operator_id": {
"type": "string",
"description": "An identifier for the operator.",
"example": "noc"
},
"vehicle_id": {
"type": "string",
"description": "An identifier for the vehicle.",
"example": "noc_ah1"
},
"coordinates": {
"$ref": "#/components/schemas/Coordinates"
}
},
"coordinates": {
"$ref": "#/definitions/Coordinates"
}
}
},
"GoToWaypoint": {
"properties": {
"action_type": {
"type": "string",
"description": "An identifier for the payload type.",
"example": "GoToWaypoint",
"enum": ["GoToWaypoint"]
"required": ["message_type", "operator_id", "vehicle_id", "coordinates"],
"type": "object"
},
"GoToWaypoint": {
"properties": {
"action_type": {
"type": "string",
"description": "An identifier for the payload type.",
"example": "GoToWaypoint",
"enum": ["GoToWaypoint"]
},
"coordinates": {
"$ref": "#/components/schemas/Coordinates"
}
},
"coordinates": {
"$ref": "#/definitions/Coordinates"
}
}
},
"DescendToAltitude": {
"properties": {
"action_type": {
"type": "string",
"description": "An identifier for the payload type.",
"example": "DescendToAltitude",
"enum": ["DescendToAltitude"]
"type": "object"
},
"DescendToAltitude": {
"properties": {
"action_type": {
"type": "string",
"description": "An identifier for the payload type.",
"example": "DescendToAltitude",
"enum": ["DescendToAltitude"]
},
"coordinates": {
"$ref": "#/components/schemas/Coordinates"
}
},
"coordinates": {
"$ref": "#/definitions/Coordinates"
}
}
},
"AscendToSurface": {
"properties": {
"action_type": {
"type": "string",
"description": "An identifier for the payload type.",
"example": "AscendToSurface",
"enum": ["AscendToSurface"]
"type": "object"
},
"AscendToSurface": {
"properties": {
"action_type": {
"type": "string",
"description": "An identifier for the payload type.",
"example": "AscendToSurface",
"enum": ["AscendToSurface"]
},
"coordinates": {
"$ref": "#/components/schemas/Coordinates"
}
},
"coordinates": {
"$ref": "#/definitions/Coordinates"
}
"type": "object"
}
}
}
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment