Skip to content

Provide more flexible strategy for loading specific @Configuration's for integration testing #43

@jgrandja

Description

@jgrandja

If we configure the following authorizationServer() @Bean for integration testing purposes:

@Bean
public CommonsExecWebServerFactoryBean authorizationServer() {
	return CommonsExecWebServerFactoryBean.builder()
		.mainClass(TestAuthorizationServerApplication.class.getName())
		.classpath((classpath) -> classpath
			.entries(MavenClasspathEntry.springBootStarter("oauth2-authorization-server"))
			.recursive(TestAuthorizationServerApplication.class)
		);
}

And we also need to load specific @Configuration's for the integration tests, then we need to ensure they are placed in the specific package testjars.authorizationserver. The testjars package is fixed and the authorizationserver sub-package corresponds to the @Bean name.

If we have 10x different integration tests that have their own specific @Configuration's then it appears we would also need to define 10x authorizationServer @Bean?

I wonder if we can come up with a more flexible strategy for loading specific @Configuration's and reusing the same authorizationServer() @Bean?

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions