Skip to content

Automatically add imports for the new test infrastructure in CLI test classes #6973

@wilkinsona

Description

@wilkinsona

The CLI's testing support is still designed around the classes and annotations from 1.3. For example you can't use @SpringBootTest without importing it. If you do import and use it, the test-specific compiler auto-configuration doesn't kick in as it looks for a @SpringApplicationConfiguration annotation.

Straightening it out in 1.4 is a little bit tricky where classes have been repackaged. For example TestRestTemplate was automatically imported in 1.3. On the one hand, if we make a hard switch to the new package in 1.4, I have a feeling it might break code that work in 1.4. On the other hand, if we don't make that switch, people will be using deprecated code and injection of TestRestTemplate that's possible when using @SpringBootTest with a full-blown web environment won't work.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions