Skip to content
This repository has been archived by the owner on Jun 7, 2024. It is now read-only.

Commit

Permalink
issue-596 added one more test case and fixed null pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
rcillo committed Mar 8, 2017
1 parent b26c2ea commit 8932f0d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ static void recursiveCheck(final StringSchema stringSchemaOriginal, final String
addChange("maxLength", ATTRIBUTE_VALUE_CHANGED, jsonPath, changes);
} else if (!Objects.equals(stringSchemaOriginal.getMinLength(), stringSchemaUpdate.getMinLength())) {
addChange("minLength", ATTRIBUTE_VALUE_CHANGED, jsonPath, changes);
} else if (!stringSchemaOriginal.getPattern().pattern().equals(stringSchemaUpdate.getPattern().pattern())) {
} else if (stringSchemaOriginal.getPattern() != null && stringSchemaUpdate.getPattern() != null
&& !stringSchemaOriginal.getPattern().pattern().equals(stringSchemaUpdate.getPattern().pattern())) {
addChange("pattern", ATTRIBUTE_VALUE_CHANGED, jsonPath, changes);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,18 @@
},
"errors": ["ATTRIBUTE_VALUE_CHANGED #/pattern"]
},
{
"description": "Correctly identifies changes to pattern",
"original_schema": {
"type": "string",
"pattern": "date-time"
},
"update_schema": {
"type": "string",
"pattern": "date-time"
},
"errors": []
},
{
"description": "Do not allow changes to maximum number schema",
"original_schema": {
Expand Down

0 comments on commit 8932f0d

Please sign in to comment.