Skip to content

RestTestClientAutoConfiguration and TestRestTemplateAutoConfiguration should be package-private #48820

@wilkinsona

Description

@wilkinsona

In spring-boot-resttestclient, both RestTestClientAutoConfiguration and TestRestTemplateAutoConfiguration are intentionally not registered in AutoConfiguration.imports. Instead, they are opted into through @AutoConfigureRestTestClient and @AutoConfigureTestRestTemplate respectively. Given this, there's no need for the classes to be public.

Making them package-private would align with JacksonTesterTestAutoConfiguration, JsonbTesterTestAutoConfiguration, and the like. These auto-configuration classes are opted into through an annotation (@AutoConfigureJsonTesters) and they're package-private. They're also named …TestAutoConfiguration and, for consistency, we may want to rename TestRestTemplateAutoConfiguration to TestRestTemplateTestAutoConfiguration and RestTestClientAutoConfiguration to RestTestClientTestAutoConfiguration.

I'd like to discuss this change with the team to double-check that it's a change that we think is worth making and to decide when to make it (4.0.x and 4.1).

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions