Shubham, Ankit | Add. Validation for all the properties of labels

This commit is contained in:
Kuamr Shubham
2020-03-10 14:55:23 +05:30
parent 11e4c93ccb
commit 2a8580ad49
3 changed files with 23 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Labels",
"type": "object",
"description": "Represents labeling",
"properties": {
"micrometer-prometheus": {
"enum": ["enabled","disabled"]
}
}
}

View File

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

View File

@@ -0,0 +1,3 @@
{
"micrometer-prometheus": "enabled"
}