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.
, , src/main/java src/test/java application.xml src/main/resources src/test/resources. Test, , ( testng, ).
Spring context (xml).
, ApplicationContext ( , AbstractTransactionalJUnit4SpringContextTests), test-context.xml, .
AbstractTransactionalJUnit4SpringContextTests
test-context.xml
Source: https://habr.com/ru/post/1752610/More articles:Единичное тестирование с помощью Spring рамки singleton beans - javajQuery next (ish) selector - jquerycannot find type "bigint" in Sybase ASE 12.5.4 - sqldatatypeshow to send data from android to server - androiddoubts about client-side validation - javaA different set of views for different user roles - ruby-on-railsJSP EL expressions not working in tag files - javaIs it safe to store sensitive settings in a .cs file instead of Web.config? - c #What is the best way to load 1,600,000 rows of data into a mysql database? - databaseHow can I simplify this binary tree traversal function? - c ++All Articles