dimanche 1 mars 2020

How to do a unit test to a java method?

i have this method and i need do test unit with Junit, but i dont know how do it! someone can help me? Thanks.

public static boolean esTelefonoFijo(String telefonoFijo) {
    // pattern validate tlp
    Pattern pattern = Pattern.compile("^?[89]\\d{8}$");
    Matcher matcher = pattern.matcher(telefonoFijo);
    return matcher.find();
}

Aucun commentaire:

Enregistrer un commentaire