package tech.easyflow.system.util;

import org.junit.Assert;
import org.junit.Test;
import tech.easyflow.common.web.exceptions.BusinessException;

public class SysPasswordPolicyTest {

    @Test
    public void shouldAcceptStrongPassword() {
        Assert.assertTrue(SysPasswordPolicy.isStrongPassword("Abcd1234!"));
        SysPasswordPolicy.validateStrongPassword("Abcd1234!");
    }

    @Test(expected = BusinessException.class)
    public void shouldRejectWeakPassword() {
        Assert.assertFalse(SysPasswordPolicy.isStrongPassword("123456"));
        SysPasswordPolicy.validateStrongPassword("123456");
    }
}
