@Test
public void testDerivedPathExp() throws Exception {

  final String derivedEntitySetName = "ESName";
  final String keyPropertyName = "a";
  final String propertyName = "navProp";
  EdmProperty keyProperty = mockProperty(keyPropertyName, 
      OData.newInstance().createPrimitiveTypeInstance(EdmPrimitiveTypeKind.String));
  EdmKeyPropertyRef keyPropertyRef = mockKeyPropertyRef(keyPropertyName, keyProperty);
  
  EdmEntityType navEntityType = mockEntityType(keyPropertyName, keyPropertyRef);
  Mockito.when(navEntityType.getFullQualifiedName()).thenReturn(new FullQualifiedName("test.navET"));
  Mockito.when(navEntityType.getNamespace()).thenReturn("test");
  Mockito.when(navEntityType.getPropertyNames()).thenReturn(
      Arrays.asList(keyPropertyName));
  Mockito.when(navEntityType.getProperty(keyPropertyName)).thenReturn(keyProperty);
  
  EdmEntityType baseEntityType = mockEntityType(keyPropertyName, keyPropertyRef);
  Mockito.when(baseEntityType.getFullQualifiedName()).thenReturn(new FullQualifiedName("test.baseET"));
  Mockito.when(baseEntityType.getNamespace()).thenReturn("test");
  Mockito.when(baseEntityType.getPropertyNames()).thenReturn(
      Arrays.asList(keyPropertyName));
  Mockito.when(baseEntityType.getProperty(keyPropertyName)).thenReturn(keyProperty);
  
  Mockito.when(navEntityType.getBaseType()).thenReturn(baseEntityType);
  Mockito.when(baseEntityType.compatibleTo(navEntityType)).thenReturn(true);
  
  EdmEntityType entityType = mockEntityType(keyPropertyName, keyPropertyRef);
  Mockito.when(entityType.getFullQualifiedName()).thenReturn(new FullQualifiedName("test.derivedET"));
  Mockito.when(entityType.getNamespace()).thenReturn("test");
  Mockito.when(entityType.getPropertyNames()).thenReturn(Arrays.asList(keyPropertyName, propertyName));
  EdmNavigationProperty navProperty = mockNavigationProperty(propertyName, navEntityType);
  Mockito.when(entityType.getProperty(propertyName)).thenReturn(navProperty);
  
  EdmEntitySet entitySet = mockEntitySet(derivedEntitySetName, entityType);
  EdmEntityContainer container = mockContainer(derivedEntitySetName, entitySet);
  Edm mockedEdm = Mockito.mock(Edm.class);
  Mockito.when(mockedEdm.getEntityContainer()).thenReturn(container);
  Mockito.when(mockedEdm.getEntityType(new FullQualifiedName("test.baseET"))).thenReturn(baseEntityType);
  
  UriTokenizer tokenizer = new UriTokenizer("navProp/test.baseET");
  Expression expression = new ExpressionParser(mockedEdm, odata).parse(tokenizer, 
      entityType, null, null);
  assertNotNull(expression);
  assertEquals("[navProp]", expression.toString());
}