@SuppressWarnings("unchecked")
@Test
public void testCreateVariableResolver() {

    Map<String, String> header = createMock(Map.class);
    Map<String, Object> requestScope = new HashMap<String, Object>();
    requestScope.put("one", 1);
    Map<String, Object> applicationScope = new HashMap<String, Object>();
    applicationScope.put("two", 2);
    expect(request.getApplicationContext()).andReturn(applicationContext);
    expect(applicationContext.getApplicationScope()).andReturn(applicationScope);
    expect(request.getHeader()).andReturn(header);
    replay(request, applicationContext, header);
    VariableResolver resolver = factory.createVariableResolver("header");
    assertEquals(Map.class, resolver.getType());
    assertEquals(header, resolver.getValue());
    resolver = factory.createVariableResolver("applicationScope");
    assertEquals(applicationScope, resolver.getValue());
    assertEquals(Map.class, resolver.getType());
    verify(header);
}