To run tests execute:
./mvnw test
To create an executable jar execute:
./mvnw clean package
After that the jar will be crated inside target directory
To run the program you can execute the following command from the project directory
java -jar ./target/Remitly-1.0-SNAPSHOT-spring-boot.jar <JSON path>
This program accepts a filepath of the JSON to be validated
All tests are contained within JSONParserTest class:
validateInvalid()
- simple json which has a single star inResources
fieldvalidateValidMultipleResources()
- json has multipleResources
but none of them contains a single starvalidateInvalidMultipleResources()
- json has multipleResources
, one of them has a single starvalidateValidMultipleStatementsOneResource()
- json has an array ofStatement
, none resource consists of single starvalidateInvalidMultipleStatementsOneResource()
- json has an array ofStatement
, oneStatement
has aResource
consisting of a single starvalidateEmpty()
- json is emptyvalidateWrongSchemaRedundantLocationField()
- json has one redundat field -Location
,Resource
doesn't have a starvalidateNoResource()
- json doesn't have aResource
field