@Test
    void testDefaultWebEnvironment() {
        ServletContext servletContext = EasyMock.mock(ServletContext.class);
        expect(servletContext.getInitParameter("shiroEnvironmentClass"))
                .andReturn(DefaultWebEnvironment.class.getName());
        expect(servletContext.getInitParameter("shiroConfigLocations")).andReturn(null);

        EasyMock.replay(servletContext);

        WebEnvironment environment = new EnvironmentLoader().createEnvironment(servletContext);

        EasyMock.verify(servletContext);

        assertThat(environment, instanceOf(DefaultWebEnvironment.class));
        assertThat(environment.getShiroFilterConfiguration(), is(notNullValue()));
        assertThat(environment.getServletContext(), sameInstance(servletContext));
    }
Tests for {@link EnvironmentLoader} which will use a ServiceLoader.
web/src/test/java/org/apache/shiro/web/env/EnvironmentLoaderServiceTest.java