Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
fix UnexpectedException.getErrorDescription(): write error message in…
… any case
- Loading branch information
Showing
2 changed files
with
25 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
18 changes: 18 additions & 0 deletions
18
framework/test-src/play/exceptions/UnexpectedExceptionTest.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package play.exceptions; | ||
|
||
import org.junit.Test; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
public class UnexpectedExceptionTest { | ||
@Test | ||
public void errorDescription_messageOnly() { | ||
assertEquals("Unexpected error : ups", new UnexpectedException("ups").getErrorDescription()); | ||
} | ||
|
||
@Test | ||
public void errorDescription_messageWithCause() { | ||
assertEquals("Unexpected error : ups, caused by exception <strong>IllegalArgumentException</strong>:<br/> <strong>forbidden</strong>", | ||
new UnexpectedException("ups", new IllegalArgumentException("forbidden")).getErrorDescription()); | ||
} | ||
} |