Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slice Testing with just the Autoconfigurations related to stubrunner loaded in #473

Closed
bijukunjummen opened this issue Nov 28, 2017 · 2 comments
Labels
Milestone

Comments

@bijukunjummen
Copy link
Contributor

@bijukunjummen bijukunjummen commented Nov 28, 2017

As a consumer of a service with stubs published, it would be great to load up only the spring configuration and components related to stub runner without needing to load up the entire application context. For a complex app with its own set of auto-configurations and with external database dependencies, loading up an entire context is difficult.

Just to provide a little more context, a consumer test looks like this:

@RunWith(SpringRunner::class)
@SpringBootTest
@AutoConfigureStubRunner(ids = arrayOf("samples.contract:sample-producer:+:stubs"), workOffline = true)
class PassThroughContractTest {

The @SpringBootTest annotation causes the entire boot application context along with any auto-configurations to be loaded up which is costly for na app with likely external dependencies.

Junit rule works well as a substitute. It would be great to have a more Spring Boot native solution also.

Here is the project where I was trying it out - https://github.com/bijukunjummen/s-c-contract-sample

@bijukunjummen

This comment has been minimized.

Copy link
Contributor Author

@bijukunjummen bijukunjummen commented Dec 13, 2017

I will try and send you a PR @marcingrzejszczak

@marcingrzejszczak

This comment has been minimized.

Copy link
Contributor

@marcingrzejszczak marcingrzejszczak commented Dec 28, 2017

Done via #496

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.