@SuppressWarnings("unchecked")
@Test
public void testGetProperty() throws OgnlException {

    PropertyAccessorDelegateFactory<Integer> factory = createMock(PropertyAccessorDelegateFactory.class);
    PropertyAccessor mockAccessor = createMock(PropertyAccessor.class);
    Map<String, Object> context = createMock(Map.class);
    expect(factory.getPropertyAccessor("property", 1)).andReturn(mockAccessor);
    expect(mockAccessor.getProperty(context, 1, "property")).andReturn("value");
    replay(factory, mockAccessor, context);
    PropertyAccessor accessor = new DelegatePropertyAccessor<Integer>(factory);
    assertEquals("value", accessor.getProperty(context, 1, "property"));
    verify(factory, mockAccessor, context);
}