Tuesday 15 April 2014

java - Spring boot multi module testing -


My question is regarding the testing of multi-modules Spring Boot applications.

I have a multi-module spring boot REST application application structured as follows:

  ** Springboot menups --src / main / java --org.test + Springbootapplicationinitializer. Annotated with java // @ SpringBootApplication-org.test.controller - --org.test.service --org.test.dao SpringbootModule --src / main / java --org.module + SpringModuleInitializer.java // @ Annotated with SpringBootApplication --org.module.controller --org.module.service --org.module.dao **  

The above is how my application is structured.

The Springboot menu application is the main project. The Springboot module is a subproject within SpringBootMainApplication. I will be created with "SpringbootModule.jar" inside the war "War of SpringbootMainApplication.war".

I have separate exam cases for both projects. I want to make these projects differently qualified. This means that, in my test cases for SpringBootMainApplication, "Springbootapplicationinitializer.java" should be used in test cases and "SpringModuleinitializer.java" should be used when testing my test cases for SpringBootModule. But when it is packed as a war and spring module installer. Java should not be playable or should have no effect.

Is there any way by which I can get it? Or to avoid SpringModuleInitializer.java altogether, I should only test the unit in the module and only have to test the integration by using the SpringbootPipplectionEleaser.Java.

If this is any help, then I am using grade for build and packaging. / P>

If I understand you correctly then SpringModuleinitializer is not required in src / main / java. Since this is a jar dependency in your root project, so you do not need to be a spring app. I think you want to test the submarine independently, so take Springmunlinizer to src / main / test and it will never show up in your war.


No comments:

Post a Comment