Merge pull request #5001 from eugenp/lor6-patch-7
remove string-related code
This commit is contained in:
commit
2fd0aec45e
|
@ -75,26 +75,5 @@ public class PizzaUnitTest {
|
|||
pz.setStatus(Pizza.PizzaStatusEnum.READY);
|
||||
pz.deliver();
|
||||
assertTrue(pz.getStatus() == Pizza.PizzaStatusEnum.DELIVERED);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void whenConvertedIntoEnum_thenGetsConvertedCorrectly() {
|
||||
String pizzaEnumValue = "READY";
|
||||
PizzaStatusEnum pizzaStatusEnum = PizzaStatusEnum.valueOf(pizzaEnumValue);
|
||||
assertTrue(pizzaStatusEnum == PizzaStatusEnum.READY);
|
||||
}
|
||||
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
public void whenConvertedIntoEnum_thenThrowsException() {
|
||||
String pizzaEnumValue = "rEAdY";
|
||||
PizzaStatusEnum pizzaStatusEnum = PizzaStatusEnum.valueOf(pizzaEnumValue);
|
||||
}
|
||||
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
public void givenInvalidEnumValueContentWiseAsString_whenConvertedIntoEnum_thenThrowsException() {
|
||||
String pizzaEnumValue = "invalid";
|
||||
PizzaStatusEnum pizzaStatusEnum = PizzaStatusEnum.valueOf(pizzaEnumValue);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue