HyenaAssert { public static void isNull(Object obj, String message) { HyenaAssert.isNull(obj, HyenaConstants.RES_CODE_PARAMETER_ERROR, message); } private  HyenaAssert(); static void isTrue(boolean expression, String message); static void isTrue(boolean expression, int code, String message); static void isTrue(boolean expression, int code, String message, Level logLevel); static void isTrue(boolean expression, int code,
                                                        String message, Level logLevel,
                                                        Class<T> exceptionType); static void equals(String expect, String actual, String message); static void notBlank(String expression, String message); static void notBlank(String expression, int code, String message); static void notBlank(String expression, int code, String message, Level logLevel); static void notBlank(String expression, int code,
                                                          String message, Level logLevel,
                                                          Class<T> exceptionType); static void isNull(Object obj, String message); static void isNull(Object obj, int code, String message); static void isNull(Object obj, int code, String message, Level logLevel); static void isNull(Object obj, int code,
                                                        String message, Level logLevel,
                                                        Class<T> exceptionType); static void notNull(Object obj, String message); static void notNull(Object obj, int code, String message); static void notNull(Object obj, int code, String message, Level logLevel); static void notNull(Object obj, int code,
                                                         String message, Level logLevel,
                                                         Class<T> exceptionType); static void notEmpty(Collection<?> obj, String message);  }
@Test public void test_isNull() { Integer obj = Integer.parseInt("123"); Assertions.assertThrows(HyenaParameterException.class, () -> { HyenaAssert.isNull(obj, "expect HyenaParameterException"); log.error("test case fail!!!"); Assertions.fail(); }); }
@Test public void test_isNull_exception() { Integer obj = Integer.parseInt("123"); Assertions.assertThrows(HyenaServiceException.class, () -> { HyenaAssert.isNull(obj, HyenaConstants.RES_CODE_SERVICE_ERROR, "expect HyenaParameterException", Level.DEBUG, HyenaServiceException.class); log.error("test case fail!!!"); Assertions.fail(); }); }