spring boot - How to speed up unit tests with less configuration -
the unit test template of jhipster great, sometime, especially, during coding, need write unit test code , run frequently. unit test start tomcat container , many other module, don't need if want test service function.
now test class this:
@runwith(springjunit4classrunner.class) @springapplicationconfiguration(classes = application.class) @webappconfiguration @integrationtest @transactional public class someclasstest { ..... how can modify initialize spring container , db? thanks.
if not need server, don't make test integration test. if remove @webappconfiguration , @integrationtest spring boot start regular (i.e. non-web context) , not start tomcat.
if need go further, can disable features, either via application-test.properties + @activeprofiles("test") disable stuff via config or using exclude parameter of @springbootapplication (or @enableautoconfiguration) lukas said already.
Comments
Post a Comment