Shubham, Ankit | Add. All the properties of instance are required
This commit is contained in:
@@ -17,5 +17,5 @@
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": ["count"]
|
||||
"required": ["count","cpu","memory"]
|
||||
}
|
||||
@@ -11,12 +11,22 @@ import static org.junit.jupiter.api.Assertions.*;
|
||||
public class SchemaTest {
|
||||
String schemaPath = "src/main/java/com/DeploymentPortal/api/Manifest/schema/";
|
||||
String testData = "src/test/java/com/DeploymentPortal/api/Manifest/schema/TestData/";
|
||||
|
||||
@Test
|
||||
void expectToGetTrueWhenInstanceDataIsValid() throws IOException, ProcessingException {
|
||||
File schemaFile = new File(schemaPath+"instance.json");
|
||||
File jsonFile = new File(testData +"validInstance.json");
|
||||
File schemaFile = new File(schemaPath + "instance.json");
|
||||
File jsonFile = new File(testData + "validInstance.json");
|
||||
ValidationUtils validationUtils = new ValidationUtils();
|
||||
|
||||
assertTrue( validationUtils.isJsonValid(schemaFile,jsonFile));
|
||||
assertTrue(validationUtils.isJsonValid(schemaFile, jsonFile));
|
||||
}
|
||||
|
||||
@Test
|
||||
void expectFalseWhenCountIsNotPresentInInstance() throws IOException, ProcessingException {
|
||||
File schemaFile = new File(schemaPath + "instance.json");
|
||||
File jsonFile = new File(testData + "invalidInstance.json");
|
||||
ValidationUtils validationUtils = new ValidationUtils();
|
||||
|
||||
assertFalse(validationUtils.isJsonValid(schemaFile, jsonFile));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"count": 1,
|
||||
"memory": "300Mi"
|
||||
}
|
||||
Reference in New Issue
Block a user