@@ -0,0 +1,2905 @@
+package net.spals.appbuilder.app.core.generic;%0A%0Aimport com.google.inject.CreationException;%0Aimport com.google.inject.Injector;%0Aimport org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0Aimport org.testng.annotations.DataProvider;%0Aimport org.testng.annotations.Test;%0A%0Aimport static com.googlecode.catchexception.CatchException.catchException;%0Aimport static com.googlecode.catchexception.CatchException.caughtException;%0Aimport static org.hamcrest.MatcherAssert.assertThat;%0Aimport static org.hamcrest.Matchers.instanceOf;%0Aimport static org.hamcrest.Matchers.is;%0A%0A/**%0A * A series of functional tests for %7B@link GenericWorkerApp%7D%0A * which do not fit into the minimal or sample test classes.%0A *%0A * @author tkral%0A */%0Apublic class GenericWorkerAppFTests %7B%0A    private final Logger LOGGER = LoggerFactory.getLogger(GenericWorkerAppFTests.class);%0A%0A    @Test%0A    public void testModuleOverrideError() %7B%0A        // This doesn't really test anything in the AppBuilder code%0A        // but just proves out how Guice errors out on override bindings%0A        catchException(() -%3E new GenericWorkerApp.Builder(%22testModuleOverrideError%22, LOGGER)%0A            .addModule(binder -%3E binder.bind(MySingletonService.class)%0A                .toInstance(new MySingletonServiceA()))%0A            .addModule(binder -%3E binder.bind(MySingletonService.class)%0A                .toInstance(new MySingletonServiceB()))%0A            .build());%0A%0A        assertThat(caughtException(), instanceOf(CreationException.class));%0A    %7D%0A%0A    @DataProvider%0A    Object%5B%5D%5B%5D enableBindingOverridesProvider() %7B%0A        final MySingletonService serviceA = new MySingletonServiceA();%0A        final MySingletonService serviceB = new MySingletonServiceB();%0A%0A        return new Object%5B%5D%5B%5D %7B%0A                // Ensure that binding order is honored. The last one in is chosen%0A                %7BserviceA, serviceB%7D,%0A                %7BserviceB, serviceA%7D,%0A        %7D;%0A    %7D%0A%0A    @Test(dataProvider = %22enableBindingOverridesProvider%22)%0A    public void testEnableBindingOverrides(final MySingletonService firstService,%0A                                           final MySingletonService secondService) %7B%0A        final GenericWorkerApp app = new GenericWorkerApp.Builder(%0A                %22testEnableBindingOverrides%22, LOGGER)%0A            .addModule(binder -%3E binder.bind(MySingletonService.class)%0A                .toInstance(firstService))%0A            .addModule(binder -%3E binder.bind(MySingletonService.class)%0A                .toInstance(secondService))%0A            .enableBindingOverrides()%0A            .build();%0A%0A        final Injector serviceInjector = app.getServiceInjector();%0A        assertThat(serviceInjector.getInstance(MySingletonService.class), is(secondService));%0A    %7D%0A%0A    private interface MySingletonService %7B  %7D%0A%0A    private class MySingletonServiceA implements MySingletonService %7B  %7D%0A%0A    private class MySingletonServiceB implements MySingletonService %7B  %7D%0A%7D

Add functional tests for enableBindingOverrides option