edmProvider = mock(EdmProvider.class);
EdmImplProv edmImplProv = new EdmImplProv(edmProvider);
List<NavigationProperty> navigationProperties = new ArrayList<NavigationProperty>();
FullQualifiedName fooBarAssocName = new FullQualifiedName("namespace", "fooBarAssoc");
navigationProperties.add(new NavigationProperty().setName("fooBarNav").setFromRole("fromFoo").setRelationship(
fooBarAssocName).setToRole("toBar"));
EntityType fooEntityType = new EntityType().setName("fooEntityType").setNavigationProperties(navigationProperties);
FullQualifiedName fooEntityTypeFullName = new FullQualifiedName("namespace", "fooEntityType");
when(edmProvider.getEntityType(fooEntityTypeFullName)).thenReturn(fooEntityType);
List<Property> keyPropertysFoo = new ArrayList<Property>();
Property keyPropFoo = new SimpleProperty().setName("Id").setType(EdmSimpleTypeKind.String);
keyPropertysFoo.add(keyPropFoo);
fooEntityType.setProperties(keyPropertysFoo);
PropertyRef refToKeyFoo = new PropertyRef().setName("Id");
List<PropertyRef> propRefKeysFoo = new ArrayList<PropertyRef>();
propRefKeysFoo.add(refToKeyFoo);
Key fooTypeKey = new Key().setKeys(propRefKeysFoo);
fooEntityType.setKey(fooTypeKey);
edmEntityType = new EdmEntityTypeImplProv(edmImplProv, fooEntityType, "namespace");
FullQualifiedName barBaseTypeName = new FullQualifiedName("namespace", "barBase");
EntityType barBase = new EntityType().setName("barBase");
when(edmProvider.getEntityType(barBaseTypeName)).thenReturn(barBase);
List<NavigationProperty> navigationPropertiesBarBase = new ArrayList<NavigationProperty>();
navigationPropertiesBarBase.add(new NavigationProperty().setName("barBaseNav"));
barBase.setNavigationProperties(navigationPropertiesBarBase);
List<Property> keyPropertysBarBase = new ArrayList<Property>();
Property keyPropBarBase = new SimpleProperty().setName("Id").setType(EdmSimpleTypeKind.String);
keyPropertysBarBase.add(keyPropBarBase);
keyPropBarBase = new SimpleProperty().setName("NotrmalProp").setType(EdmSimpleTypeKind.String);
keyPropertysBarBase.add(keyPropBarBase);
barBase.setProperties(keyPropertysBarBase);
PropertyRef refToKeyBarBase = new PropertyRef().setName("Id");
List<PropertyRef> propRefKeysBarBase = new ArrayList<PropertyRef>();
propRefKeysBarBase.add(refToKeyBarBase);
Key barBaseTypeKey = new Key().setKeys(propRefKeysBarBase);
barBase.setKey(barBaseTypeKey);
EntityType barEntityType = new EntityType().setName("barEntityType").setBaseType(barBaseTypeName);
FullQualifiedName barEntityTypeFullName = new FullQualifiedName("namespace", "barEntityType");
when(edmProvider.getEntityType(barEntityTypeFullName)).thenReturn(barEntityType);
edmEntityTypeWithBaseType = new EdmEntityTypeImplProv(edmImplProv, barEntityType, "namespace");
}