Created
November 21, 2012 10:06
-
-
Save rschumm/4124094 to your computer and use it in GitHub Desktop.
JUnit excepted Exception and Message
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
@Rule | |
public ExpectedException dupliziertesTargetJUnitRule = ExpectedException.none(); | |
@Test | |
public void duplikateException(){ | |
dupliziertesTargetJUnitRule.expect(PolicyException.class); | |
dupliziertesTargetJUnitRule.expectMessage("PolicyDuplikat1"); | |
dupliziertesTargetJUnitRule.expectMessage("PolicyDuplikat2"); | |
//Code, der die Exception auslöst... | |
Environment frameworktest= new Environment(); | |
brokerportal.addAttribute(EnvironmentAttributeType.APPLICATION, "frameworktest"); | |
SARERequest request = new SARERequest(arbeiter, Action.MUTATE, vertrag, frameworktest); | |
Decision entscheid = RPDP.doerDaeDaDaa(request); | |
} |
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
@Test(expected=PolicyException.class) | |
public void duplikateException(){ | |
//Code, der die Exception auslöst... | |
Environment frameworktest= new Environment(); | |
brokerportal.addAttribute(EnvironmentAttributeType.APPLICATION, "frameworktest"); | |
SARERequest request = new SARERequest(arbeiter, Action.MUTATE, vertrag, frameworktest); | |
Decision entscheid = RPDP.doerDaeDaDaa(request); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment