@Test void validateValid() { Tag tag = mock(Tag.class); when(tag.getRelationIri()).thenReturn(Relation.isRealizationOf.getIRI()); tagValidator.validate(tag); }
@SuppressWarnings("MethodMayBeStatic") public void validate(Tag tag) { String relationIri = tag.getRelationIri(); Relation relation = Relation.forIRI(relationIri); if (relation == null) { throw new MolgenisValidationException( new ConstraintViolation(format("Unknown relation IRI [%s]", relationIri))); } }
TagValidator { @SuppressWarnings("MethodMayBeStatic") public void validate(Tag tag) { String relationIri = tag.getRelationIri(); Relation relation = Relation.forIRI(relationIri); if (relation == null) { throw new MolgenisValidationException( new ConstraintViolation(format("Unknown relation IRI [%s]", relationIri))); } } }
TagValidator { @SuppressWarnings("MethodMayBeStatic") public void validate(Tag tag) { String relationIri = tag.getRelationIri(); Relation relation = Relation.forIRI(relationIri); if (relation == null) { throw new MolgenisValidationException( new ConstraintViolation(format("Unknown relation IRI [%s]", relationIri))); } }  }
TagValidator { @SuppressWarnings("MethodMayBeStatic") public void validate(Tag tag) { String relationIri = tag.getRelationIri(); Relation relation = Relation.forIRI(relationIri); if (relation == null) { throw new MolgenisValidationException( new ConstraintViolation(format("Unknown relation IRI [%s]", relationIri))); } }  @SuppressWarnings("MethodMayBeStatic") void validate(Tag tag); }
TagValidator { @SuppressWarnings("MethodMayBeStatic") public void validate(Tag tag) { String relationIri = tag.getRelationIri(); Relation relation = Relation.forIRI(relationIri); if (relation == null) { throw new MolgenisValidationException( new ConstraintViolation(format("Unknown relation IRI [%s]", relationIri))); } }  @SuppressWarnings("MethodMayBeStatic") void validate(Tag tag);  }