@Test public void shouldThrowExceptionIfGeoZoneCodeEmpty() throws Exception { GeographicZone geographicZone = new GeographicZone(); expectedEx.expect(dataExceptionMatcher("error.mandatory.fields.missing")); geographicZone.validateMandatoryFields(); }
public void validateMandatoryFields() { if (isBlank(this.code) || isBlank(this.name)) { throw new DataException("error.mandatory.fields.missing"); } }
GeographicZone extends BaseModel implements Importable { public void validateMandatoryFields() { if (isBlank(this.code) || isBlank(this.name)) { throw new DataException("error.mandatory.fields.missing"); } } }
GeographicZone extends BaseModel implements Importable { public void validateMandatoryFields() { if (isBlank(this.code) || isBlank(this.name)) { throw new DataException("error.mandatory.fields.missing"); } } GeographicZone(Long id, String code, String name, GeographicLevel level, GeographicZone parent); }
GeographicZone extends BaseModel implements Importable { public void validateMandatoryFields() { if (isBlank(this.code) || isBlank(this.name)) { throw new DataException("error.mandatory.fields.missing"); } } 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 { public void validateMandatoryFields() { if (isBlank(this.code) || isBlank(this.name)) { throw new DataException("error.mandatory.fields.missing"); } } 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();  }