### Question:
BeanPropertyAccess implements ValueAccess { @Override public <T> Object getPropertyValue(final T data, final EdmProperty property) throws ODataException { return getValue(data, getGetterMethodName(property)); }  @Override Object getPropertyValue(final T data, final EdmProperty property); @Override void setPropertyValue(final T data, final EdmProperty property, final V value); @Override Class<?> getPropertyType(final T data, final EdmProperty property); @Override Object getMappingValue(final T data, final EdmMapping mapping); @Override void setMappingValue(final T data, final EdmMapping mapping, final V value);  }### Answer:
@Test(expected = ODataNotFoundException.class) public void getPropertyTypeInvalidPropertyName() throws ODataException { SimpleEntity data = new SimpleEntity(); data.name = "A Name"; EdmProperty property = mockProperty("invalid.Name"); Object value = ava.getPropertyValue(data, property); Assert.assertNull(value); }
@Test public void getPropertyValue() throws ODataException { SimpleEntity data = new SimpleEntity(); data.name = "A Name"; EdmProperty property = mockProperty("Name"); Object value = ava.getPropertyValue(data, property); Assert.assertEquals(String.class, value.getClass()); Assert.assertEquals("A Name", value); }
@Test public void getPropertyValueBoolean() throws ODataException { SimpleEntity data = new SimpleEntity(); EdmProperty property = mockProperty("BooleanProperty", true); Object value = ava.getPropertyValue(data, property); Assert.assertEquals(Boolean.class, value.getClass()); Assert.assertEquals(true, value); }
@Test public void getPropertyValueNull() throws ODataException { SimpleEntity data = new SimpleEntity(); EdmProperty property = mockProperty("Name"); Object value = ava.getPropertyValue(data, property); Assert.assertNull(value); }
@Test public void getPropertyValueNullData() throws ODataException { SimpleEntity data = null; EdmProperty property = mockProperty("Name"); Object value = ava.getPropertyValue(data, property); Assert.assertNull(value); }