@Test void getNextButton() { Wizard wizard = new Wizard(); wizard.addPage(new TestWizardPage()); wizard.addPage(new TestWizardPage()); WizardButton nextButton = wizard.getNextButton(); assertNotNull(nextButton); assertTrue(nextButton.isEnabled()); assertEquals("Next", nextButton.getTitle()); assertEquals("/next", nextButton.getTargetUri()); wizard.next(); nextButton = wizard.getNextButton(); assertTrue(nextButton.isEnabled()); assertEquals("Finish", nextButton.getTitle()); assertEquals("/restart", nextButton.getTargetUri()); }
public WizardButton getNextButton() { boolean lastPage = isLastPage(); String id = lastPage ? FINISH_BUTTON_ID : NEXT_BUTTON_ID; String title = lastPage ? "Finish" : "Next"; String uri = lastPage ? "/restart" : "/next"; return new WizardButton(id, title, true, uri); }
Wizard implements Serializable { public WizardButton getNextButton() { boolean lastPage = isLastPage(); String id = lastPage ? FINISH_BUTTON_ID : NEXT_BUTTON_ID; String title = lastPage ? "Finish" : "Next"; String uri = lastPage ? "/restart" : "/next"; return new WizardButton(id, title, true, uri); } }
Wizard implements Serializable { public WizardButton getNextButton() { boolean lastPage = isLastPage(); String id = lastPage ? FINISH_BUTTON_ID : NEXT_BUTTON_ID; String title = lastPage ? "Finish" : "Next"; String uri = lastPage ? "/restart" : "/next"; return new WizardButton(id, title, true, uri); }  }
Wizard implements Serializable { public WizardButton getNextButton() { boolean lastPage = isLastPage(); String id = lastPage ? FINISH_BUTTON_ID : NEXT_BUTTON_ID; String title = lastPage ? "Finish" : "Next"; String uri = lastPage ? "/restart" : "/next"; return new WizardButton(id, title, true, uri); }  void addPage(WizardPage page); List<WizardPage> getPages(); WizardPage getCurrentPage(); boolean isLastPage(); boolean isFirstPage(); void next(); void previous(); WizardButton getNextButton(); WizardButton getPreviousButton(); }
Wizard implements Serializable { public WizardButton getNextButton() { boolean lastPage = isLastPage(); String id = lastPage ? FINISH_BUTTON_ID : NEXT_BUTTON_ID; String title = lastPage ? "Finish" : "Next"; String uri = lastPage ? "/restart" : "/next"; return new WizardButton(id, title, true, uri); }  void addPage(WizardPage page); List<WizardPage> getPages(); WizardPage getCurrentPage(); boolean isLastPage(); boolean isFirstPage(); void next(); void previous(); WizardButton getNextButton(); WizardButton getPreviousButton();  }