@Test public void shouldThrowIfParentNodeIsInvalid() throws Exception{ SupervisoryNode parent = make(a(SupervisoryNodeBuilder.defaultSupervisoryNode)); SupervisoryNode supervisoryNode = make(a(SupervisoryNodeBuilder.defaultSupervisoryNode)); supervisoryNode.setParent(parent); expectedEx.expect(DataException.class); expectedEx.expectMessage("error.supervisory.node.parent.invalid"); supervisoryNode.validateParent(); }
public void validateParent() { if (this.code.equals(this.parent.code) || this.id == this.parent.id) throw new DataException("error.supervisory.node.parent.invalid"); }
SupervisoryNode extends BaseModel implements Importable { public void validateParent() { if (this.code.equals(this.parent.code) || this.id == this.parent.id) throw new DataException("error.supervisory.node.parent.invalid"); } }
SupervisoryNode extends BaseModel implements Importable { public void validateParent() { if (this.code.equals(this.parent.code) || this.id == this.parent.id) throw new DataException("error.supervisory.node.parent.invalid"); } SupervisoryNode(Long id); }
SupervisoryNode extends BaseModel implements Importable { public void validateParent() { if (this.code.equals(this.parent.code) || this.id == this.parent.id) throw new DataException("error.supervisory.node.parent.invalid"); } SupervisoryNode(Long id); @Override boolean equals(Object o); @Override int hashCode(); void validateParent(); }
SupervisoryNode extends BaseModel implements Importable { public void validateParent() { if (this.code.equals(this.parent.code) || this.id == this.parent.id) throw new DataException("error.supervisory.node.parent.invalid"); } SupervisoryNode(Long id); @Override boolean equals(Object o); @Override int hashCode(); void validateParent(); public Integer supervisorCount; }