Created
April 7, 2016 03:49
-
-
Save cosbor11/fc5f5b479d22b8684f729be380af6214 to your computer and use it in GitHub Desktop.
Manipulate a BeverageEffect in order to observe its lifecycle behavior
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Define a beverage effect | |
| BeverageEffects effectsOfWater = new BeverageEffects(Beverage.WATER); | |
| // Observe the behavior of the pre insert listener | |
| manager.saveEntity(effectsOfWater); | |
| assertTrue("After saving the behavior entity, the effects should be thirsty", effectsOfWater.getDescription().equals(Beverage.WATER.getPreConsumption())); | |
| // Observe the behavior of the pre update listener | |
| manager.saveEntity(effectsOfWater); | |
| assertTrue("After updating the behavior entity, the effects should be satisfied", effectsOfWater.getDescription().equals(Beverage.WATER.getDuringConsumption())); | |
| // Observe the behavior of the pre delete listener | |
| manager.deleteEntity(effectsOfWater); | |
| assertTrue("Before deleting the behavior entity, the effects should be, I gotta pee", effectsOfWater.getDescription().equals(Beverage.WATER.getAfterConsumption())); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment