EdmEntitySet entitySet = MockFacade.getMockEdm().getDefaultEntityContainer().getEntitySet("Employees");
InputStream contentBody = createContentAsStream(EMPLOYEE_1_XML);
// execute
XmlEntityConsumer xec = new XmlEntityConsumer();
ODataEntry result =
xec.readEntry(entitySet, contentBody, EntityProviderReadProperties.init().mergeSemantic(true).build());
// verify
EntryMetadata metadata = result.getMetadata();
assertEquals("http://localhost:19000/Employees('1')", metadata.getId());
assertEquals("W/\"1\"", metadata.getEtag());
List<String> associationUris = metadata.getAssociationUris("ne_Room");
assertEquals(1, associationUris.size());
assertEquals("Employees('1')/ne_Room", associationUris.get(0));
associationUris = metadata.getAssociationUris("ne_Manager");
assertEquals(1, associationUris.size());
assertEquals("Employees('1')/ne_Manager", associationUris.get(0));
associationUris = metadata.getAssociationUris("ne_Team");
assertEquals(1, associationUris.size());
assertEquals("Employees('1')/ne_Team", associationUris.get(0));
assertEquals(null, metadata.getUri());
MediaMetadata mm = result.getMediaMetadata();
assertEquals("Employees('1')/$value", mm.getSourceLink());
assertEquals("mmEtag", mm.getEtag());
assertEquals("application/octet-stream", mm.getContentType());
assertEquals("Employees('1')/$value", mm.getEditLink());
Map<String, Object> data = result.getProperties();
assertEquals(9, data.size());
assertEquals("1", data.get("EmployeeId"));
assertEquals("Walter Winter", data.get("EmployeeName"));
assertEquals("1", data.get("ManagerId"));
assertEquals("1", data.get("RoomId"));