Skip to content

Add Spring integration test that context is loaded properly #2330

@EgorkaKulikov

Description

@EgorkaKulikov

Description

There is a good practice to add an integration test that Spring context is loaded correctly (see https://www.jvt.me/posts/2021/06/25/spring-context-test/ for more details).
If this test fails, all other tests fail automatically an the problem is not in the method under test, but in context autowiring.

@Test
  void contextLoads() {
    // This test fails if our Spring configuration is not loaded correctly
  }

We should also try to obtain the cause of Spring context incorrect loading from our application instantiator (however, it may be difficult) and to show it to the user.

@Test
  void contextLoads() {
    // This test fails if our Spring configuration is not loaded correctly
    // The reason is <Exception type, message and cause>
  }

Metadata

Metadata

Assignees

Labels

comp-codegenIssue is related to code generatorcomp-springIssue is related to Spring projects supportctg-enhancementNew feature, improvement or change request

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions