Maven - use different java classes during the test and war phases

I am using the maven war plugin to create a war package.

Before running a package build test. To pre-initialize my database using sample data, I use a spring bean. I would like to have different data in my db for tests and different when the application starts.

I thought it might be possible to use two different spring initializer classes at the test and war stages, but I don't know how to do this.

+3
source share
2 answers

, , src/main/java src/test/java application.xml src/main/resources src/test/resources. Test, , ( testng, ​​).

+3

Spring context (xml).

, ApplicationContext ( , AbstractTransactionalJUnit4SpringContextTests), test-context.xml, .

+1

Source: https://habr.com/ru/post/1752610/


All Articles