@@ -0,0 +1,2362 @@
+/*%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A * http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage org.jdbi.v3.spring;%0A%0Aimport static org.junit.Assert.assertNotNull;%0Aimport static org.junit.Assert.assertTrue;%0A%0Aimport org.jdbi.v3.core.Jdbi;%0Aimport org.jdbi.v3.core.spi.JdbiPlugin;%0Aimport org.jdbi.v3.spring.TestPluginInstall.Config;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.springframework.beans.factory.annotation.Autowired;%0Aimport org.springframework.context.annotation.Bean;%0Aimport org.springframework.context.annotation.Configuration;%0Aimport org.springframework.jdbc.datasource.DriverManagerDataSource;%0Aimport org.springframework.test.context.ContextConfiguration;%0Aimport org.springframework.test.context.junit4.SpringJUnit4ClassRunner;%0A%0A@RunWith(SpringJUnit4ClassRunner.class)%0A@ContextConfiguration(classes=Config.class)%0Apublic class TestPluginInstall %7B%0A%0A    @Configuration%0A    public static class Config %7B%0A        boolean pluginACalled, pluginBCalled;%0A%0A        @Bean%0A        public JdbiFactoryBean jdbiFactory() %7B%0A            return new JdbiFactoryBean().setDataSource(new DriverManagerDataSource());%0A        %7D%0A%0A        @Bean%0A        public JdbiPlugin pluginA() %7B%0A            return new JdbiPlugin() %7B%0A                @Override%0A                public void customizeDbi(Jdbi dbi) %7B%0A                    pluginACalled = true;%0A                %7D%0A            %7D;%0A        %7D%0A%0A        @Bean%0A        public JdbiPlugin pluginB() %7B%0A            return new JdbiPlugin() %7B%0A                @Override%0A                public void customizeDbi(Jdbi dbi) %7B%0A                    pluginBCalled = true;%0A                %7D%0A            %7D;%0A        %7D%0A    %7D%0A%0A    @Autowired%0A    Config config;%0A%0A    @Autowired%0A    Jdbi dbi;%0A%0A    @Test%0A    public void testPluginsInstalled() %7B%0A        assertNotNull(dbi);%0A        assertTrue(config.pluginACalled);%0A        assertTrue(config.pluginBCalled);%0A    %7D%0A%7D%0A

Add test showing that Spring JdbiPlugin install works