EdmEntitySet entitySet = MockFacade.getMockEdm().getDefaultEntityContainer().getEntitySet("Employees");
InputStream reqContent = createContentAsStream(EMPLOYEE_1_ROOM_XML, true);
// execute
XmlEntityConsumer xec = new XmlEntityConsumer();
ODataEntry entry =
xec.readEntry(entitySet, reqContent, EntityProviderReadProperties.init().mergeSemantic(true).build());
// validate
assertNotNull(entry);
Map<String, Object> properties = entry.getProperties();
assertEquals("1", properties.get("EmployeeId"));
assertEquals("Walter Winter", properties.get("EmployeeName"));
ODataEntry room = (ODataEntry) properties.get("ne_Room");
Map<String, Object> roomProperties = room.getProperties();
assertEquals(4, roomProperties.size());
assertEquals("1", roomProperties.get("Id"));
assertEquals("Room 1", roomProperties.get("Name"));
assertEquals(Short.valueOf("1"), roomProperties.get("Seats"));
assertEquals(Short.valueOf("1"), roomProperties.get("Version"));