@Test
public void testGetType() {

    Map<String, Object> requestScope = new HashMap<String, Object>();
    Map<String, Object> sessionScope = new HashMap<String, Object>();
    Map<String, Object> applicationScope = new HashMap<String, Object>();
    requestScope.put("object1", "value");
    sessionScope.put("object2", new Integer(1));
    applicationScope.put("object3", new Float(2.0));
    Request request = createMock(Request.class);
    expect(request.getContext("request")).andReturn(requestScope)
            .anyTimes();
    expect(request.getContext("session")).andReturn(sessionScope)
            .anyTimes();
    ApplicationContext applicationContext = createMock(ApplicationContext.class);
    expect(request.getContext("application")).andReturn(
            applicationScope).anyTimes();
    expect(request.getAvailableScopes()).andReturn(
            Arrays.asList(new String[] { "request", "session", "application" }))
            .anyTimes();
    replay(request, applicationContext);
    ELContext context = new ELContextImpl(resolver);
    context.putContext(Request.class, request);
    context.putContext(ApplicationContext.class, applicationContext);
    assertEquals("The type is not correct", String.class, resolver.getType(
            context, null, "object1"));
    assertEquals("The type is not correct", Integer.class, resolver.getType(
            context, null, "object2"));
    assertEquals("The type is not correct", Float.class, resolver.getType(
            context, null, "object3"));
    assertNull(resolver.getType(context, new Integer(1), "whatever"));
    assertNull(resolver.getType(context, null, "object4"));
    verify(request, applicationContext);
}