### Question:
GenieException extends Exception { public int getErrorCode() { return errorCode; } GenieException(final int errorCode, final String msg, final Throwable cause);  GenieException(final int errorCode, final String msg); int getErrorCode();  }### Answer:
@Test void testThreeArgConstructor() { Assertions .assertThatExceptionOfType(GenieException.class) .isThrownBy( () -> { throw new GenieException(ERROR_CODE, ERROR_MESSAGE, IOE); } ) .withCause(IOE) .withMessage(ERROR_MESSAGE) .satisfies(e -> Assertions.assertThat(e.getErrorCode()).isEqualTo(HttpURLConnection.HTTP_NOT_FOUND)); }
@Test void testTwoArgConstructorWithMessage() { Assertions .assertThatExceptionOfType(GenieException.class) .isThrownBy( () -> { throw new GenieException(ERROR_CODE, ERROR_MESSAGE); } ) .withNoCause() .withMessage(ERROR_MESSAGE) .satisfies(e -> Assertions.assertThat(e.getErrorCode()).isEqualTo(HttpURLConnection.HTTP_NOT_FOUND)); }