package com.bonus.common.core.utils.ip;

import com.bonus.common.core.utils.ip.IpUtils;
import org.junit.Assert;
import org.junit.Test;
import static org.junit.Assert.*;

/**
 * 获取IP方法
 * 
 * @author bonus
 */
public class IpUtilsTests
{
    @Test
    public void testIpIsInWildCardNoCheck(){
        assertTrue(IpUtils.ipIsInWildCardNoCheck("192.168.1.*", "192.168.1.100"));
        assertTrue(IpUtils.ipIsInWildCardNoCheck("192.168.*.*", "192.168.1.100"));
        assertFalse(IpUtils.ipIsInWildCardNoCheck("192.168.1.*", "192.168.2.100"));
    }
    @Test
    public void testInternalIp(){
        assertTrue(IpUtils.internalIp("192.168.1.100"));
        assertFalse(IpUtils.internalIp("12.213.54.34"));
    }
}