### Question:
LionEngineException extends RuntimeException { private static String getMessage(Media media) { Check.notNull(media); return new StringBuilder(Constant.BYTE_4).append('[').append(media.getPath()).append("] ").toString(); } LionEngineException(String message);  LionEngineException(Media media);  LionEngineException(Media media, String message);  LionEngineException(Enum<?> type);  LionEngineException(Throwable exception);  LionEngineException(Throwable exception, String message);  LionEngineException(Throwable exception, Media media);  LionEngineException(Throwable exception, Media media, String message);  static final String ERROR_PRIVATE_CONSTRUCTOR; }### Answer:
@Test void testLionEngineExceptionWithMediaNullPath() { final LionEngineException exception = new LionEngineException(new MediaMock(), "message"); assertEquals("[null] message", exception.getMessage()); assertNull(exception.getCause()); }
@Test void testLionEngineExceptionWithMedia() { final LionEngineException exception = new LionEngineException(Medias.create("media")); assertEquals("[media] ", exception.getMessage()); assertNull(exception.getCause()); }
@Test void testLionEngineExceptionWithMediaMessage() { final LionEngineException exception = new LionEngineException(Medias.create("media"), "message"); assertEquals("[media] message", exception.getMessage()); assertNull(exception.getCause()); }
@Test void testLionEngineExceptionWithMediaException() { final LionEngineException exception = new LionEngineException(new RuntimeException(), Medias.create("media")); assertEquals("[media] ", exception.getMessage()); assertEquals(RuntimeException.class, exception.getCause().getClass()); }
@Test void testLionEngineExceptionWithMediaExceptionMessage() { final LionEngineException exception = new LionEngineException(new RuntimeException(), Medias.create("media"), "message"); assertEquals("[media] message", exception.getMessage()); assertEquals(RuntimeException.class, exception.getCause().getClass()); }
@Test void testLionEngineExceptionWithEnumNull() { final LionEngineException exception = new LionEngineException((Enum<?>) null); assertEquals(LionEngineException.ERROR_UNKNOWN_ENUM + LionEngineException.NULL_ENUM, exception.getMessage()); assertNull(exception.getCause()); }
@Test void testLionEngineExceptionWithEnum() { final LionEngineException exception = new LionEngineException(Origin.MIDDLE); assertEquals(LionEngineException.ERROR_UNKNOWN_ENUM + Origin.MIDDLE, exception.getMessage()); assertNull(exception.getCause()); }
@Test void testLionEngineExceptionWithException() throws FileNotFoundException { final LionEngineException exception = new LionEngineException(new IOException("error")); assertEquals("java.io.IOException: error", exception.getMessage()); assertEquals(IOException.class, exception.getCause().getClass()); }
@Test void testLionEngineExceptionWithLionEngineException() throws FileNotFoundException { final LionEngineException exception = new LionEngineException(new LionEngineException("reason")); assertEquals("com.b3dgs.lionengine.LionEngineException: reason", exception.getMessage()); assertEquals(LionEngineException.class, exception.getCause().getClass()); assertNotEquals(exception, exception.getCause()); }
@Test void testLionEngineExceptionWithRuntimeException() throws FileNotFoundException { final LionEngineException exception = new LionEngineException(new LionEngineException(new RuntimeException("sub"))); assertEquals("com.b3dgs.lionengine.LionEngineException: java.lang.RuntimeException: sub", exception.getMessage()); assertEquals(LionEngineException.class, exception.getCause().getClass()); assertEquals(RuntimeException.class, exception.getCause().getCause().getClass()); assertNotEquals(exception, exception.getCause()); }
@Test void testLionEngineExceptionWithNullReason() throws FileNotFoundException { final LionEngineException exception = new LionEngineException((Throwable) null); assertEquals(null, exception.getMessage()); assertNull(exception.getCause()); }
@Test void testLionEngineExceptionWithExceptionNoMessage() { final LionEngineException exception = new LionEngineException(new IOException()); assertEquals("java.io.IOException", exception.getMessage()); assertEquals(IOException.class, exception.getCause().getClass()); }
@Test void testLionEngineExceptionWithThrowableMessage() { final LionEngineException exception = new LionEngineException(new IOException(), "message"); assertEquals("message", exception.getMessage()); assertEquals(IOException.class, exception.getCause().getClass()); }