@Test public void testSmokeEveryThingThroughConstructor() throws Exception { final Tobacco[] tobaccos = { new OldTobyTobacco(), new RivendellTobacco(), new SecondBreakfastTobacco() }; for (final Tobacco tobacco : tobaccos) { final GuiceWizard guiceWizard = new GuiceWizard(tobacco); guiceWizard.smoke(); assertEquals("GuiceWizard smoking " + tobacco.getClass().getSimpleName(), appender.getLastMessage()); } assertEquals(tobaccos.length, appender.getLogSize()); }
@Override public void smoke() { tobacco.smoke(this); }
GuiceWizard implements Wizard { @Override public void smoke() { tobacco.smoke(this); } }
GuiceWizard implements Wizard { @Override public void smoke() { tobacco.smoke(this); } @Inject  GuiceWizard(Tobacco tobacco); }
GuiceWizard implements Wizard { @Override public void smoke() { tobacco.smoke(this); } @Inject  GuiceWizard(Tobacco tobacco); @Override void smoke(); }
GuiceWizard implements Wizard { @Override public void smoke() { tobacco.smoke(this); } @Inject  GuiceWizard(Tobacco tobacco); @Override void smoke();  }