Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save vietj/1035572 to your computer and use it in GitHub Desktop.
Save vietj/1035572 to your computer and use it in GitHub Desktop.
TestNavigationServiceRebase - testConsistentStateAfterRebase
public void testConsistentStateAfterRebase() throws Exception
{
MOPService mop = mgr.getPOMService();
Site portal = mop.getModel().getWorkspace().addSite(ObjectType.PORTAL_SITE, "consistent_state_after_rebase");
Navigation def = portal.getRootNavigation().addChild("default");
def.addChild("a");
//
sync(true);
//
NavigationContext navigation = service.loadNavigation(SiteKey.portal("consistent_state_after_rebase"));
Node root = service.loadNode(Node.MODEL, navigation, Scope.ALL, null).node;
NodeState state = new NodeState.Builder().label("foo").build();
root.getChild("a").setState(state);
assertEquals(state, root.getChild("a").getState());
//
sync(true);
//
service.rebaseNode(root.context, null, null);
assertEquals(state, root.getChild("a").getState());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment