- try {
- throw new PfModelRuntimeException(Response.Status.ACCEPTED, "HELLO");
- } catch (PfModelRuntimeException pfme) {
- String errorMessage = getErrorMessage(pfme);
- assertEquals("Server returned: Accepted", errorMessage.substring(0, 25));
- }
+ @Test
+ public void testExceptionInfo() {
+ final PfModelException pfme = new PfModelException(Response.Status.ACCEPTED, "HELLO");
+ assertThat(pfme).hasMessage("HELLO");
+ assertEquals("Server returned: Accepted", getErrorMessage(pfme).substring(0, 25));
+ assertNotNull(pfme.toString());
+
+ final PfModelRuntimeException pfmr = new PfModelRuntimeException(Response.Status.ACCEPTED, "HELLO");
+ assertThat(pfmr).hasMessage("HELLO");
+ assertEquals("Server returned: Accepted", getErrorMessage(pfmr).substring(0, 25));
+ assertNotNull(pfmr.toString());