### Question:
Platform extends io.dropwizard.Application<PlatformConfiguration> { @Override public void initialize(Bootstrap<PlatformConfiguration> bootstrap) { for (Initializer initializer : wrapper.getInitializers()) { initializer.initialize(bootstrap); LOGGER.debug("Registered Initializer: {}", initializer.getClass().getCanonicalName()); } for (Bundle bundle : wrapper.getBundles()) { bootstrap.addBundle(bundle); LOGGER.debug("Registered Bundle: {}", bundle.getClass().getCanonicalName()); } for (Command command : wrapper.getCommands()) { bootstrap.addCommand(command); LOGGER.debug("Registered Command: {}", command.getClass().getCanonicalName()); } } Platform(Application application); static Platform forApplication(Application application); void start(String[] args); @Override void initialize(Bootstrap<PlatformConfiguration> bootstrap); @Override void run(PlatformConfiguration configuration, Environment environment);  }### Answer:
@Test public void initialize_adds_bundles() { final Bundle bundle = mock(Bundle.class); final Class<TestBundle> bundleClass = TestBundle.class; Application application = buildApplication( new AbstractPlugin() { @Override protected void configure() { bindBundle(bundle); bindBundle(bundleClass); } } ); new Platform(application).initialize(bootstrap); verify(bootstrap).addBundle(eq(bundle)); verify(bootstrap).addBundle(isA(TestBundle.class)); }
@Test public void initialize_adds_commands() { final Command command = mock(Command.class); final Class<TestCommand> commandClass = TestCommand.class; Application application = buildApplication( new AbstractPlugin() { @Override protected void configure() { bindCommand(command); bindCommand(commandClass); } } ); new Platform(application).initialize(bootstrap); verify(bootstrap).addCommand(eq(command)); verify(bootstrap).addCommand(isA(TestCommand.class)); }
@Test public void initialize_adds_initializers() { final Initializer initializer = mock(Initializer.class); final Class<TestInitializer> initializerClass = TestInitializer.class; Application application = buildApplication( new AbstractPlugin() { @Override protected void configure() { bindInitializer(initializer); bindInitializer(initializerClass); } } ); new Platform(application).initialize(bootstrap); verify(initializer).initialize(eq(bootstrap)); }