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

Defaults for kubernetes mock server #12360

Merged
merged 2 commits into from
Oct 7, 2020
Merged

Defaults for kubernetes mock server #12360

merged 2 commits into from
Oct 7, 2020

Conversation

mejlholm
Copy link
Contributor

@mejlholm mejlholm commented Sep 27, 2020

When testing applications written with the quarkus-kubernetes-client extension, i find that the configuration of kubernetes objects sometimes becomes large very fast and I loose the overview of my tests. Especially, when working with watchers that are registered at application startup.

I propose that we populate the mock server with empty defaults, which the developer can override when needed, instead of giving a 404.

Overriding is still possible with configureMockServer in a subclass, so impact should be neglible, if any.

Alternatively we could also make a new class called something like KubernetesWatcherMockServerTestResource, which extends KubernetesMockServerTestResource and override configureMockServer there.

@mejlholm mejlholm changed the title Defaults for mock server WIP: Defaults for mock server Sep 27, 2020
@mejlholm mejlholm marked this pull request as draft October 4, 2020 13:45
@mejlholm mejlholm marked this pull request as ready for review October 4, 2020 14:04
@mejlholm mejlholm changed the title WIP: Defaults for mock server Defaults for mock server Oct 4, 2020
@mejlholm mejlholm changed the title Defaults for mock server Defaults for kubernetes mock server Oct 6, 2020
@mejlholm
Copy link
Contributor Author

mejlholm commented Oct 6, 2020

@geoand any thoughts on this one?

@geoand
Copy link
Contributor

geoand commented Oct 6, 2020

I like the idea, but I don't think it should be the default behavior, I would prefer the KubernetesWatcherMockServerTestResource idea

I think this will make tests are easier to read if some entities are not used, but still required.
@mejlholm
Copy link
Contributor Author

mejlholm commented Oct 6, 2020

Logic moved to new class EmptyDefaultKubernetesMockServerTestResource and added notes about it in the docs.

Copy link
Contributor

@geoand geoand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot!

@geoand geoand added this to the 1.9.0 - master milestone Oct 6, 2020
@gsmet gsmet merged commit b2d5e8f into quarkusio:master Oct 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants