@Test(dataProvider = "getSetInvalidStateParams") public void testSetInvalidState(SubnetState originalState, SubnetState newState) throws Exception { NetworkEntity network = new NetworkEntity(); network.setState(originalState); try { network.setState(newState); fail("setState should throw exception"); } catch (IllegalStateException ex) { assertThat(ex.getMessage(), is(String.format("%s -> %s", originalState, newState))); } }
public void setState(SubnetState state) { if (this.getState() != null && state != null) { EntityStateValidator.validateStateChange(this.getState(), state, SubnetState.PRECONDITION_STATES); } this.state = state; }
NetworkEntity extends BaseEntity implements Named { public void setState(SubnetState state) { if (this.getState() != null && state != null) { EntityStateValidator.validateStateChange(this.getState(), state, SubnetState.PRECONDITION_STATES); } this.state = state; } }
NetworkEntity extends BaseEntity implements Named { public void setState(SubnetState state) { if (this.getState() != null && state != null) { EntityStateValidator.validateStateChange(this.getState(), state, SubnetState.PRECONDITION_STATES); } this.state = state; }  }
NetworkEntity extends BaseEntity implements Named { public void setState(SubnetState state) { if (this.getState() != null && state != null) { EntityStateValidator.validateStateChange(this.getState(), state, SubnetState.PRECONDITION_STATES); } this.state = state; }  @Override String getKind(); String getName(); void setName(String name); String getDescription(); void setDescription(String description); SubnetState getState(); void setState(SubnetState state); String getPortGroups(); void setPortGroups(String portGroups); Boolean getIsDefault(); void setIsDefault(Boolean isDefault); }
NetworkEntity extends BaseEntity implements Named { public void setState(SubnetState state) { if (this.getState() != null && state != null) { EntityStateValidator.validateStateChange(this.getState(), state, SubnetState.PRECONDITION_STATES); } this.state = state; }  @Override String getKind(); String getName(); void setName(String name); String getDescription(); void setDescription(String description); SubnetState getState(); void setState(SubnetState state); String getPortGroups(); void setPortGroups(String portGroups); Boolean getIsDefault(); void setIsDefault(Boolean isDefault);  }