@Test public void testTokenValidationFailure() throws IllegalArgumentException { List<String> tokens = new ArrayList<String>(); tokens.add("validToken"); schema.getProperties().put(TokenSchema.TOKENS, tokens); String tokenEntity = "invalidToken"; assertFalse("Expected TokenSchema invalid token validation failure did not succeed", schema.validate(tokenEntity)); }
@Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { return addError(this.matchesToken(entity), fieldName, entity, getQuotedTokens(), ErrorType.ENUMERATION_MISMATCH, errors); }
TokenSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { return addError(this.matchesToken(entity), fieldName, entity, getQuotedTokens(), ErrorType.ENUMERATION_MISMATCH, errors); } }
TokenSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { return addError(this.matchesToken(entity), fieldName, entity, getQuotedTokens(), ErrorType.ENUMERATION_MISMATCH, errors); } TokenSchema();  TokenSchema(String xsdType); }
TokenSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { return addError(this.matchesToken(entity), fieldName, entity, getQuotedTokens(), ErrorType.ENUMERATION_MISMATCH, errors); } TokenSchema();  TokenSchema(String xsdType); @Override NeutralSchemaType getSchemaType(); @Override boolean isPrimitive(); @Override Object convert(Object value); }
TokenSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { return addError(this.matchesToken(entity), fieldName, entity, getQuotedTokens(), ErrorType.ENUMERATION_MISMATCH, errors); } TokenSchema();  TokenSchema(String xsdType); @Override NeutralSchemaType getSchemaType(); @Override boolean isPrimitive(); @Override Object convert(Object value); static final String TOKENS; }