Shubham, Ankit | Add. Properties of deployment info to be mandatory

This commit is contained in:
Kuamr Shubham
2020-03-10 15:42:25 +05:30
parent 74c9ebf670
commit a19351091f
3 changed files with 23 additions and 1 deletions

View File

@@ -54,5 +54,16 @@
"healthChecks": {
"$ref": "file:/Users/kumarshubham/Downloads/Deployment-Portal/src/main/java/com/DeploymentPortal/api/Manifest/schema/healthChecks.json"
}
}
},
"required": [
"cluster",
"name",
"timeout",
"healthChecks",
"namespace",
"exposedPorts",
"loadBalancer",
"environmentVariables",
"instance"
]
}

View File

@@ -146,4 +146,13 @@ public class SchemaTest {
assertTrue(validationUtils.isJsonValid(schemaFile, jsonFile));
}
@Test
void expectFalseWhenFewPropertiesOfDeploymentAreMissing() throws IOException, ProcessingException {
File schemaFile = new File(schemaPath + "deployment.json");
File jsonFile = new File(testData + "invalidDeployment.json");
ValidationUtils validationUtils = new ValidationUtils();
assertFalse(validationUtils.isJsonValid(schemaFile, jsonFile));
}
}