}
EntryCallback callback = new EntryCallback();
Map<String, ODataCallback> callbacks = new HashMap<String, ODataCallback>();
callbacks.put("nr_Building", callback);
final ODataResponse response =
new JsonEntityProvider().writeEntry(entitySet, roomData,
EntityProviderWriteProperties.serviceRoot(URI.create(BASE_URI)).expandSelectTree(node1)
.callbacks(callbacks).build());
assertNotNull(response);
assertNotNull(response.getEntity());
assertNull("EntitypProvider must not set content header", response.getContentHeader());
Map<String, Object> roomEntry =
new Gson().fromJson(new InputStreamReader((InputStream) response.getEntity()), Map.class);
// remove d wrapper
roomEntry = (Map<String, Object>) roomEntry.get("d");
assertEquals(2, roomEntry.size());
assertTrue(roomEntry.containsKey("nr_Building"));
assertNull(roomEntry.get("nr_Building"));