@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))); } }
@Test(dataProvider = "getSetValidStateParams") public void testSetValidState(ImageState originalState, ImageState newState) throws Exception { ImageEntity image = new ImageEntity(); image.setState(originalState); image.setState(newState); }