callbacks.put("aCallback", new MyCallback(null, null));
ExpandSelectTreeNode expandSelectTree = new ExpandSelectTreeNodeImpl();
URI selfLink = new URI("http://some.uri");
Map<String, Map<String, Object>> links = new HashMap<String, Map<String, Object>>();
links.put("aNavigationProperty", Collections.<String, Object> emptyMap());
final EntityProviderWriteProperties properties = EntityProviderWriteProperties.serviceRoot(serviceRoot)
.callbacks(callbacks)
.expandSelectTree(expandSelectTree)
.inlineCount(1)
.inlineCountType(InlineCount.ALLPAGES)
.nextLink("http://localhost")
.selfLink(selfLink)
.includeSimplePropertyType(true)
.additionalLinks(links)
.omitJsonWrapper(true)
.contentOnly(true)
.build();
//
final EntityProviderWriteProperties fromProperties =
EntityProviderWriteProperties.fromProperties(properties).build();
//
assertEquals(1, fromProperties.getCallbacks().size());
assertTrue(fromProperties.getCallbacks().containsKey("aCallback"));
assertEquals(expandSelectTree, fromProperties.getExpandSelectTree());
assertEquals(selfLink, fromProperties.getSelfLink());
assertEquals("Wrong base uri.", "http://localhost:80/", fromProperties.getServiceRoot().toASCIIString());
assertEquals("Wrong inline count type.", InlineCount.ALLPAGES, fromProperties.getInlineCountType());
assertEquals("Wrong inline count.", Integer.valueOf(1), fromProperties.getInlineCount());
assertEquals("Wrong nextLink", "http://localhost", fromProperties.getNextLink());
assertTrue("Simple property types should be true", fromProperties.isIncludeSimplePropertyType());
assertEquals(Collections.emptyMap(), fromProperties.getAdditionalLinks().get("aNavigationProperty"));
assertTrue("Json Wrapper should be omitted", properties.isOmitJsonWrapper());
assertTrue("ContentOnlyFlag should be set", properties.isContentOnly());
}