@Test
    public void testStatusExceptionMapping() {

        for (GuacamoleStatus status : GuacamoleStatus.values()) {

            // Ignore SUCCESS status (tested via testSuccessHasNoException())
            if (status == GuacamoleStatus.SUCCESS)
                continue;

            String message = "Test message: " + status;
            GuacamoleException e = status.toException(message);

            Assert.assertEquals("toException() should return a "
                    + "GuacamoleException that maps to the same status.",
                    status, e.getStatus());

            Assert.assertEquals("toException() should return a "
                    + "GuacamoleException that uses the provided message.",
                    message, e.getMessage());

        }

    }
Verifies that each non-success GuacamoleStatus maps to a
GuacamoleException associated with that GuacamoleStatus.
guacamole-common/src/test/java/org/apache/guacamole/protocol/GuacamoleStatusTest.java