I am using maven war wordpress plugin to construct war package.

Before package is build test are performed. To preinitialize my database with sample data I personally use spring bean. I must have different data during my db for tests and various when application begins.

I believed that maybe you'll be able to use two different spring initializer classes in 'test' and 'war' phases but I'm not sure how to do this.

You need to place the different classes you'll need into src/primary/java or src/test/java or might be supplemental application.xml into src/primary/assets or src/test/assets. The exam initializer can be achieved with a Test class which initializes first before all exams are running (have a look at testng that has this type of feature).

Your results shouldn't be while using production Spring context (xml) files.

Rather, if you want to access an ApplicationContext inside your tests (or if you work with basics testcase class like AbstractTransactionalJUnit4SpringContextTests), setup a test-context.xml context which indicates the exam database configuration and also the test data scripts.