public void testBreadcrumbs()
{
String parentHref = "http://parent.com/index.html";
final DecorationModel parent = new DecorationModel();
parent.setBody( new Body() );
parent.getBody().addBreadcrumb( createLinkItem( "Parent", parentHref ) );
DecorationModel child = new DecorationModel();
assembler.assembleModelInheritance( "childName", child, parent,
"http://parent.com/child", "http://parent.com" );
assertBreadcrumbsCorrect( child.getBody().getBreadcrumbs(), "childName", parentHref );
// same with trailing slash
child = new DecorationModel();
assembler.assembleModelInheritance( "childName", child, parent,
"http://parent.com/child/", "http://parent.com/" );
assertBreadcrumbsCorrect( child.getBody().getBreadcrumbs(), "childName", parentHref );
// now mixed
child = new DecorationModel();
assembler.assembleModelInheritance( "childName", child, parent,
"http://parent.com/child/", "http://parent.com" );
assertBreadcrumbsCorrect( child.getBody().getBreadcrumbs(), "childName", parentHref );
// and other way round
child = new DecorationModel();
assembler.assembleModelInheritance( "childName", child, parent,
"http://parent.com/child", "http://parent.com/" );
assertBreadcrumbsCorrect( child.getBody().getBreadcrumbs(), "childName", parentHref );
// now with child breadcrumb
child = new DecorationModel();
child.setBody( new Body() );
child.getBody().addBreadcrumb( createLinkItem( "Child", "" ) );
assembler.assembleModelInheritance( "childName", child, parent,
"http://parent.com/child/", "http://parent.com/" );
assertBreadcrumbsCorrect( child.getBody().getBreadcrumbs(), "Child", parentHref );