package configuration;

import javax.naming.NamingException;
import javax.sql.DataSource;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase;
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder;
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.annotation.EnableTransactionManagement;

import com.moesounds.annotation.MoeSoundsDataSource;
import com.moesounds.annotation.TestProfile;

/**
* This class is use to instantiate and configure beans defined for DataSources. Typically used for unit testing
*
* @author NYPD
*/
@Configuration
@EnableTransactionManagement
@TestProfile
public class EmbeddedDataSourceConfiguration {
    
	@Bean
    public PlatformTransactionManager annotationDrivenTransactionManager() throws NamingException {	
        DataSource dataSource = getMoeSoundsDataSource();

        DataSourceTransactionManager dataSourceTransactionManager = new DataSourceTransactionManager();
        dataSourceTransactionManager.setDataSource(dataSource);

        return dataSourceTransactionManager;
    }

    @Bean
    @MoeSoundsDataSource
    public DataSource getMoeSoundsDataSource() throws NamingException {
    	
        EmbeddedDatabase datasource = new EmbeddedDatabaseBuilder().setType(EmbeddedDatabaseType.HSQL).build();

        return datasource;
    }
    
}

@@ -208,82 +208,8 @@
 n;%0D%0A
-import org.springframework.jdbc.datasource.DataSourceTransactionManager;%0D%0A
 impo
@@ -271,24 +271,24 @@
 dDatabase;%0D%0A
+
 import org.s
@@ -432,76 +432,8 @@
 e;%0D%0A
-import org.springframework.transaction.PlatformTransactionManager;%0D%0A
 impo
@@ -865,412 +865,14 @@
  %7B%0D%0A
+
     %0D%0A
-%09@Bean%0D%0A    public PlatformTransactionManager annotationDrivenTransactionManager() throws NamingException %7B%09%0D%0A        DataSource dataSource = getMoeSoundsDataSource();%0D%0A%0D%0A        DataSourceTransactionManager dataSourceTransactionManager = new DataSourceTransactionManager();%0D%0A        dataSourceTransactionManager.setDataSource(dataSource);%0D%0A%0D%0A        return dataSourceTransactionManager;%0D%0A    %7D%0D%0A%0D%0A
     

Remove transaction manager bean creation from the junit tests