@Test public void shouldThrowExceptionIfLevelEmpty() throws Exception { GeographicZone geographicZone = new GeographicZone(1234L, "some level", "some level", null, null); expectedEx.expect(dataExceptionMatcher("error.geo.level.invalid")); geographicZone.validateLevel(); }
@JsonIgnore public void validateLevel() { if (this.getLevel() == null) throw new DataException("error.geo.level.invalid"); validateLevelAndParentAssociation(); }
GeographicZone extends BaseModel implements Importable { @JsonIgnore public void validateLevel() { if (this.getLevel() == null) throw new DataException("error.geo.level.invalid"); validateLevelAndParentAssociation(); } }
GeographicZone extends BaseModel implements Importable { @JsonIgnore public void validateLevel() { if (this.getLevel() == null) throw new DataException("error.geo.level.invalid"); validateLevelAndParentAssociation(); } GeographicZone(Long id, String code, String name, GeographicLevel level, GeographicZone parent); }
GeographicZone extends BaseModel implements Importable { @JsonIgnore public void validateLevel() { if (this.getLevel() == null) throw new DataException("error.geo.level.invalid"); validateLevelAndParentAssociation(); } GeographicZone(Long id, String code, String name, GeographicLevel level, GeographicZone parent); @JsonIgnore boolean isParentHigherInHierarchy(); @JsonIgnore boolean isRootLevel(); @JsonIgnore void validateLevel(); @JsonIgnore void validateParentIsHigherInHierarchy(); @JsonIgnore void validateParentExists(); void validateMandatoryFields(); }
GeographicZone extends BaseModel implements Importable { @JsonIgnore public void validateLevel() { if (this.getLevel() == null) throw new DataException("error.geo.level.invalid"); validateLevelAndParentAssociation(); } GeographicZone(Long id, String code, String name, GeographicLevel level, GeographicZone parent); @JsonIgnore boolean isParentHigherInHierarchy(); @JsonIgnore boolean isRootLevel(); @JsonIgnore void validateLevel(); @JsonIgnore void validateParentIsHigherInHierarchy(); @JsonIgnore void validateParentExists(); void validateMandatoryFields();  }