URI serviceRoot = new URI("http://localhost:80/");
Map<String, ODataCallback> callbacks = new HashMap<String, ODataCallback>();
callbacks.put("aCallback", new MyCallback(null, null));
ExpandSelectTreeNode expandSelectTree = new ExpandSelectTreeNodeImpl();
URI selfLink = new URI("http://some.uri");
final EntityProviderWriteProperties properties = EntityProviderWriteProperties.serviceRoot(serviceRoot)
.callbacks(callbacks)
.expandSelectTree(expandSelectTree)
.inlineCount(1)
.inlineCountType(InlineCount.ALLPAGES)
.mediaResourceMimeType("image/png")
.nextLink("http://localhost")
.selfLink(selfLink)
.includeSimplePropertyType(true)
.build();
assertEquals("Wrong amount of callbacks.", 1, properties.getCallbacks().size());
assertTrue("No callback found.", properties.getCallbacks().containsKey("aCallback"));
assertEquals("Wrong expand select tree.", expandSelectTree, properties.getExpandSelectTree());
assertEquals("Wrong self link.", selfLink, properties.getSelfLink());
assertEquals("Wrong media resource mime type.", "image/png", properties.getMediaResourceMimeType());
assertEquals("Wrong base uri.", "http://localhost:80/", properties.getServiceRoot().toASCIIString());
assertEquals("Wrong inline count type.", InlineCount.ALLPAGES, properties.getInlineCountType());
assertEquals("Wrong inline count.", Integer.valueOf(1), properties.getInlineCount());
assertEquals("Wrong nextLink", "http://localhost", properties.getNextLink());
assertTrue("Simple property types should be true", properties.isIncludeSimplePropertyType());
}