Java Assert True assertTrue(boolean b, String msgTemplate, Object... params)

Here you can find the source of assertTrue(boolean b, String msgTemplate, Object... params)

Description

assert True

License

Apache License

Declaration

public static void assertTrue(boolean b, String msgTemplate, Object... params) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static void assertTrue(boolean b, String msgTemplate, Object... params) {

        if (!b) {
            throw new IllegalArgumentException(getMsg("Assert fail: not true.", msgTemplate, params));
        }//w  w  w . jav a2  s. c  o m

    }

    private static String getMsg(String defaultMsg, String msgTemplate, Object[] params) {
        return msgTemplate == null ? defaultMsg : String.format(msgTemplate, params);
    }
}

Related

  1. assertTrue(boolean b)
  2. assertTrue(boolean condition)
  3. assertTrue(boolean condition)
  4. assertTrue(boolean condition, String argName, String message)
  5. assertTrue(boolean condition, String message)