UberfireBreadcrumbs { public void addBreadCrumb(final String associatedPerspective, final String breadCrumbLabel, final Command command) { addBreadCrumb(associatedPerspective, breadCrumbLabel, null, command, true); } @Inject  UberfireBreadcrumbs(UberfireBreadcrumbsContainer uberfireBreadcrumbsContainer,
                               ManagedInstance<DefaultBreadcrumbsPresenter> breadcrumbsPresenters,
                               PlaceManager placeManager,
                               View view); @PostConstruct void createBreadcrumbs(); void clearBreadcrumbs(final String associatedPerspective); void clearBreadcrumbsAndToolBars(final String associatedPerspective); void addBreadCrumb(final String associatedPerspective,
                              final String breadCrumbLabel,
                              final Command command); void addBreadCrumb(final String associatedPerspective,
                              final String breadCrumbLabel,
                              final Command command,
                              final boolean removeDeepLevelBreadcrumbsAfterActivation); void addBreadCrumb(final String associatedPerspective,
                              final String breadCrumbLabel,
                              final PlaceRequest associatedPlaceRequest); void addBreadCrumb(final String associatedPerspective,
                              final String breadCrumbLabel,
                              final PlaceRequest associatedPlaceRequest,
                              final Command command); void addBreadCrumb(final String associatedPerspective,
                              final String breadCrumbLabel,
                              final PlaceRequest associatedPlaceRequest,
                              final Command command,
                              final boolean removeDeepLevelBreadcrumbsAfterActivation); void addBreadCrumb(final String associatedPerspective,
                              final BreadcrumbPresenter breadCrumbPresenter); void addToolbar(final String associatedPerspective,
                           final Element toolbar);  }
@Test public void addBreadcrumbs() { assertTrue(uberfireBreadcrumbs.breadcrumbsPerPerspective.isEmpty()); uberfireBreadcrumbs.currentPerspective = "myperspective"; uberfireBreadcrumbs.addBreadCrumb("myperspective", "label", new DefaultPlaceRequest("screen")); uberfireBreadcrumbs.addBreadCrumb("myperspective", "label2", new DefaultPlaceRequest("screen2")); uberfireBreadcrumbs.addBreadCrumb("myperspective2", "label4", new DefaultPlaceRequest("screen4")); assertFalse(uberfireBreadcrumbs.breadcrumbsPerPerspective.isEmpty()); assertEquals(2, uberfireBreadcrumbs.breadcrumbsPerPerspective.size()); assertEquals(2, uberfireBreadcrumbs.breadcrumbsPerPerspective.get("myperspective").size()); }
@Test public void addBreadcrumbAssociatedWithACommandTest() { final Command command = mock(Command.class); uberfireBreadcrumbs.addBreadCrumb("myperspective", "label", command); verify(uberfireBreadcrumbs).addBreadCrumb("myperspective", "label", null, command, true); }
@Test public void addBreadcrumbAssociatedWithAPlaceRequestTest() { uberfireBreadcrumbs.addBreadCrumb("myperspective", "label", new DefaultPlaceRequest("screen")); verify(uberfireBreadcrumbs).addBreadCrumb("myperspective", "label", new DefaultPlaceRequest("screen"), null, true); }
@Test public void addBreadcrumbAssociatedWithAPlaceRequestWithACommandTest() { final Command command = mock(Command.class); uberfireBreadcrumbs.addBreadCrumb("myperspective", "label", new DefaultPlaceRequest("screen"), command); verify(uberfireBreadcrumbs).addBreadCrumb("myperspective", "label", new DefaultPlaceRequest("screen"), command, true); }