hosting-asset-validation-for-cloud-server-to-webspace #54

Merged
hsh-michaelhoennig merged 7 commits from hosting-asset-validation-for-cloud-server-to-webspace into master 2024-05-06 10:51:00 +02:00
Showing only changes of commit 358a0c7b3a - Show all commits

View File

@ -23,19 +23,19 @@ class HsHostingAssetPropsControllerAcceptanceTest {
RestAssured // @formatter:off RestAssured // @formatter:off
.given() .given()
.port(port) .port(port)
.when() .when()
.get("http://localhost/api/hs/hosting/asset-types") .get("http://localhost/api/hs/hosting/asset-types")
.then().log().all().assertThat() .then().log().all().assertThat()
.statusCode(200) .statusCode(200)
.contentType("application/json") .contentType("application/json")
.body("", lenientlyEquals(""" .body("", lenientlyEquals("""
[ [
"MANAGED_SERVER", "MANAGED_SERVER",
"MANAGED_WEBSPACE", "MANAGED_WEBSPACE",
"CLOUD_SERVER" "CLOUD_SERVER"
] ]
""")); """));
// @formatter:on // @formatter:on
} }
@ -44,112 +44,112 @@ class HsHostingAssetPropsControllerAcceptanceTest {
RestAssured // @formatter:off RestAssured // @formatter:off
.given() .given()
.port(port) .port(port)
.when() .when()
.get("http://localhost/api/hs/hosting/asset-types/" + HsHostingAssetType.MANAGED_SERVER) .get("http://localhost/api/hs/hosting/asset-types/" + HsHostingAssetType.MANAGED_SERVER)
.then().log().all().assertThat() .then().log().all().assertThat()
.statusCode(200) .statusCode(200)
.contentType("application/json") .contentType("application/json")
.body("", lenientlyEquals(""" .body("", lenientlyEquals("""
[ [
{ {
"type": "integer", "type": "integer",
"propertyName": "CPUs", "propertyName": "CPUs",
"required": true, "required": true,
"unit": null, "unit": null,
"min": 1, "min": 1,
"max": 32, "max": 32,
"step": null "step": null
}, },
{ {
"type": "integer", "type": "integer",
"propertyName": "RAM", "propertyName": "RAM",
"required": true, "required": true,
"unit": "GB", "unit": "GB",
"min": 1, "min": 1,
"max": 128, "max": 128,
"step": null "step": null
}, },
{ {
"type": "integer", "type": "integer",
"propertyName": "SSD", "propertyName": "SSD",
"required": true, "required": true,
"unit": "GB", "unit": "GB",
"min": 25, "min": 25,
"max": 1000, "max": 1000,
"step": 25 "step": 25
}, },
{ {
"type": "integer", "type": "integer",
"propertyName": "HDD", "propertyName": "HDD",
"required": false, "required": false,
"unit": "GB", "unit": "GB",
"min": 0, "min": 0,
"max": 4000, "max": 4000,
"step": 250 "step": 250
}, },
{ {
"type": "integer", "type": "integer",
"propertyName": "Traffic", "propertyName": "Traffic",
"required": true, "required": true,
"unit": "GB", "unit": "GB",
"min": 250, "min": 250,
"max": 10000, "max": 10000,
"step": 250 "step": 250
}, },
{ {
"type": "enumeration", "type": "enumeration",
"propertyName": "SLA-Platform", "propertyName": "SLA-Platform",
"required": false, "required": false,
"values": [ "values": [
"BASIC", "BASIC",
"EXT8H", "EXT8H",
"EXT4H", "EXT4H",
"EXT2H" "EXT2H"
] ]
}, },
{ {
"type": "boolean", "type": "boolean",
"propertyName": "SLA-EMail", "propertyName": "SLA-EMail",
"required": false, "required": false,
"falseIf": { "falseIf": {
"SLA-Platform": "BASIC" "SLA-Platform": "BASIC"
} }
}, },
{ {
"type": "boolean", "type": "boolean",
"propertyName": "SLA-Maria", "propertyName": "SLA-Maria",
"required": false, "required": false,
"falseIf": { "falseIf": {
"SLA-Platform": "BASIC" "SLA-Platform": "BASIC"
} }
}, },
{ {
"type": "boolean", "type": "boolean",
"propertyName": "SLA-PgSQL", "propertyName": "SLA-PgSQL",
"required": false, "required": false,
"falseIf": { "falseIf": {
"SLA-Platform": "BASIC" "SLA-Platform": "BASIC"
} }
}, },
{ {
"type": "boolean", "type": "boolean",
"propertyName": "SLA-Office", "propertyName": "SLA-Office",
"required": false, "required": false,
"falseIf": { "falseIf": {
"SLA-Platform": "BASIC" "SLA-Platform": "BASIC"
} }
}, },
{ {
"type": "boolean", "type": "boolean",
"propertyName": "SLA-Web", "propertyName": "SLA-Web",
"required": false, "required": false,
"falseIf": { "falseIf": {
"SLA-Platform": "BASIC" "SLA-Platform": "BASIC"
}
} }
} ]
] """));
"""));
// @formatter:on // @formatter:on
} }