Search in sources :

Example 1 with DruidWebUtils

use of com.alibaba.druid.util.DruidWebUtils in project druid by alibaba.

the class DruidWebUtilsTest method test_getContextPath_2_5.

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));
}
Also used : DruidWebUtils(com.alibaba.druid.util.DruidWebUtils) MockServletContext(org.springframework.mock.web.MockServletContext)

Aggregations

DruidWebUtils (com.alibaba.druid.util.DruidWebUtils)1 MockServletContext (org.springframework.mock.web.MockServletContext)1