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

Do not fail verification test when provider state doesn't exist. #1260

Closed
danilchican opened this issue Nov 30, 2020 · 6 comments
Closed

Do not fail verification test when provider state doesn't exist. #1260

danilchican opened this issue Nov 30, 2020 · 6 comments

Comments

@danilchican
Copy link

Is there any way to do not fire error when state on a provider side is not defined?

There are cases when Consumer defines state, e.g. "products exist" but Provider shouldn't do something special inside provider state method. But if method with @State is not defined it fails.

How to do not fail without having @State?

@joklek
Copy link
Contributor

joklek commented Dec 3, 2020

A workaround I see is to use the same @State method for a few states.

This does not avoid having the states in the producer, but you don't have to create a separate method, just use @State({"default", "products exist"}).

OR use the default state in the consumer. Ignoring missing states might lead to unexpected outcomes, but if this option is introduced, it would be nice to get warnings about every missing state

@uglyog
Copy link
Member

uglyog commented Dec 12, 2020

I've added an @IgnoreMissingStateChange annotation which you can add to your test class

@danilchican
Copy link
Author

@uglyog great! Which version has this improvement?

@anto-ac
Copy link
Collaborator

anto-ac commented Dec 12, 2020

@uglyog great! Which version has this improvement?

I don’t think it has been released yet.

@uglyog
Copy link
Member

uglyog commented Dec 13, 2020

Just been released :-D (4.1.12)

@danilchican
Copy link
Author

@uglyog , great! Thanks for quick improvement.

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

No branches or pull requests

4 participants