@Test
public void testCreateVariableResolver() {

    Map<String, Object> requestScope = new HashMap<String, Object>();
    requestScope.put("one", 1);
    expect(request.getContext("request")).andReturn(requestScope).times(2);
    Map<String, Object> applicationScope = new HashMap<String, Object>();
    applicationScope.put("two", 2);
    expect(request.getContext("application")).andReturn(applicationScope);
    replay(request, applicationContext);
    VariableResolver resolver = factory.createVariableResolver("requestScope");
    assertEquals(0, resolver.getFlags());
    assertEquals("requestScope", resolver.getName());
    assertEquals(Map.class, resolver.getType());
    assertEquals(requestScope, resolver.getValue());
    resolver.setStaticType(Object.class); // To complete coverage
    assertEquals(Map.class, resolver.getType());
    resolver = factory.createVariableResolver("requestScope"); // again to test caching
    assertEquals(requestScope, resolver.getValue());
    resolver = factory.createVariableResolver("applicationScope");
    assertEquals(applicationScope, resolver.getValue());
    verify(request, applicationContext);
}