@Test public void testAddPage() throws Exception { wizard.addPage(page1); wizard.addPage(page2); wizard.addPage(page3); verify(page1).setUpdateDelegate(eq(updateDelegate)); verify(page1).setContext(anyMapOf(String.class, String.class)); verify(page1).init(eq(dataObject)); verify(page2).setUpdateDelegate(eq(updateDelegate)); verify(page2).setContext(anyMapOf(String.class, String.class)); verify(page2).init(eq(dataObject)); verify(page3).setUpdateDelegate(eq(updateDelegate)); verify(page3).setContext(anyMapOf(String.class, String.class)); verify(page3).init(eq(dataObject)); assertEquals(page1, wizard.navigateToFirst()); assertEquals(page2, wizard.navigateToNext()); assertEquals(page3, wizard.navigateToNext()); assertNull(wizard.navigateToNext()); }
public void addPage(@Nonnull WizardPage<T> page) { page.setUpdateDelegate(delegate); page.setContext(context); page.init(dataObject); wizardPages.add(page); }
AbstractWizard implements Wizard<T> { public void addPage(@Nonnull WizardPage<T> page) { page.setUpdateDelegate(delegate); page.setContext(context); page.init(dataObject); wizardPages.add(page); } }
AbstractWizard implements Wizard<T> { public void addPage(@Nonnull WizardPage<T> page) { page.setUpdateDelegate(delegate); page.setContext(context); page.init(dataObject); wizardPages.add(page); } @Inject  AbstractWizard(T dataObject); }
AbstractWizard implements Wizard<T> { public void addPage(@Nonnull WizardPage<T> page) { page.setUpdateDelegate(delegate); page.setContext(context); page.init(dataObject); wizardPages.add(page); } @Inject  AbstractWizard(T dataObject); Map<String, String> getContext(); T getDataObject(); void addPage(@Nonnull WizardPage<T> page); void addPage(@Nonnull WizardPage<T> page, int index, boolean replace); @Override void setUpdateDelegate(@Nonnull UpdateDelegate delegate); @Nullable @Override WizardPage<T> navigateToFirst(); @Nullable @Override WizardPage<T> navigateToNext(); @Nullable @Override WizardPage<T> navigateToPrevious(); @Override boolean hasNext(); @Override boolean hasPrevious(); @Override boolean canComplete(); }
AbstractWizard implements Wizard<T> { public void addPage(@Nonnull WizardPage<T> page) { page.setUpdateDelegate(delegate); page.setContext(context); page.init(dataObject); wizardPages.add(page); } @Inject  AbstractWizard(T dataObject); Map<String, String> getContext(); T getDataObject(); void addPage(@Nonnull WizardPage<T> page); void addPage(@Nonnull WizardPage<T> page, int index, boolean replace); @Override void setUpdateDelegate(@Nonnull UpdateDelegate delegate); @Nullable @Override WizardPage<T> navigateToFirst(); @Nullable @Override WizardPage<T> navigateToNext(); @Nullable @Override WizardPage<T> navigateToPrevious(); @Override boolean hasNext(); @Override boolean hasPrevious(); @Override boolean canComplete();  }