@Test(dataProvider = "getSetInvalidStateParams") public void testSetInvalidState(ImageState originalState, ImageState newState) throws Exception { ImageEntity image = new ImageEntity(); image.setState(originalState); try { image.setState(newState); fail("setState should throw exception"); } catch (IllegalStateException ex) { assertThat(ex.getMessage(), is(String.format("%s -> %s", originalState, newState))); } }
public void setState(ImageState state) { EntityStateValidator.validateStateChange(this.getState(), state, ImageState.PRECONDITION_STATES); this.state = state; }
ImageEntity extends BaseEntity implements Named { public void setState(ImageState state) { EntityStateValidator.validateStateChange(this.getState(), state, ImageState.PRECONDITION_STATES); this.state = state; } }
ImageEntity extends BaseEntity implements Named { public void setState(ImageState state) { EntityStateValidator.validateStateChange(this.getState(), state, ImageState.PRECONDITION_STATES); this.state = state; }  }
ImageEntity extends BaseEntity implements Named { public void setState(ImageState state) { EntityStateValidator.validateStateChange(this.getState(), state, ImageState.PRECONDITION_STATES); this.state = state; }  @Override String getKind(); @Override String getName(); void setName(String name); Long getSize(); void setSize(Long size); ImageState getState(); void setState(ImageState state); ImageReplication getReplicationType(); void setReplicationType(ImageReplication replicationType); List<ImageSettingsEntity> getImageSettings(); void setImageSettings(List<ImageSettingsEntity> imageSettings); Map<String, String> getImageSettingsMap(); Integer getReplicatedDatastore(); void setReplicatedDatastore(Integer replicatedDatastore); Integer getReplicatedImageDatastore(); void setReplicatedImageDatastore(Integer replicatedImageDatastore); Integer getTotalDatastore(); void setTotalDatastore(Integer totalDatastore); Integer getTotalImageDatastore(); void setTotalImageDatastore(Integer totalImageDatastore); @Override boolean equals(Object o); }
ImageEntity extends BaseEntity implements Named { public void setState(ImageState state) { EntityStateValidator.validateStateChange(this.getState(), state, ImageState.PRECONDITION_STATES); this.state = state; }  @Override String getKind(); @Override String getName(); void setName(String name); Long getSize(); void setSize(Long size); ImageState getState(); void setState(ImageState state); ImageReplication getReplicationType(); void setReplicationType(ImageReplication replicationType); List<ImageSettingsEntity> getImageSettings(); void setImageSettings(List<ImageSettingsEntity> imageSettings); Map<String, String> getImageSettingsMap(); Integer getReplicatedDatastore(); void setReplicatedDatastore(Integer replicatedDatastore); Integer getReplicatedImageDatastore(); void setReplicatedImageDatastore(Integer replicatedImageDatastore); Integer getTotalDatastore(); void setTotalDatastore(Integer totalDatastore); Integer getTotalImageDatastore(); void setTotalImageDatastore(Integer totalImageDatastore); @Override boolean equals(Object o); static final String KIND; }