@Test
public void writeEntry() throws Exception {
final EdmEntitySet entitySet = MockFacade.getMockEdm().getDefaultEntityContainer().getEntitySet("Teams");
Map<String, Object> properties = new HashMap<String, Object>();
properties.put("Id", "42");
final ODataResponse result =
new ProviderFacadeImpl().writeEntry(HttpContentType.APPLICATION_JSON, entitySet, properties,
EntityProviderWriteProperties.serviceRoot(URI.create("http://root/")).build());
assertEquals("{\"d\":{\"__metadata\":{\"id\":\"http://root/Teams('42')\","
+ "\"uri\":\"http://root/Teams('42')\",\"type\":\"RefScenario.Team\"},"
+ "\"Id\":\"42\",\"Name\":null,\"isScrumTeam\":null,"
+ "\"nt_Employees\":{\"__deferred\":{\"uri\":\"http://root/Teams('42')/nt_Employees\"}}}}",
StringHelper.inputStreamToString((InputStream) result.getEntity()));
}