mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
33 lines
770 B
Java
33 lines
770 B
Java
package com.alibaba.druid.bvt.utils;
|
|
|
|
import junit.framework.TestCase;
|
|
|
|
import org.junit.Assert;
|
|
import org.springframework.mock.web.MockServletContext;
|
|
|
|
import com.alibaba.druid.util.DruidWebUtils;
|
|
|
|
public class DruidWebUtilsTest extends TestCase {
|
|
|
|
public void test_getContextPath_2_5() throws Exception {
|
|
new DruidWebUtils(); //
|
|
|
|
MockServletContext context = new MockServletContext() {
|
|
|
|
public int getMajorVersion() {
|
|
return 2;
|
|
}
|
|
|
|
public int getMinorVersion() {
|
|
return 4;
|
|
}
|
|
|
|
public String getContextPath() {
|
|
throw new NoSuchMethodError();
|
|
}
|
|
};
|
|
|
|
Assert.assertNull(DruidWebUtils.getContextPath(context));
|
|
}
|
|
}
|