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

can you support rpush? #24

Open
jillesvangurp opened this issue Oct 8, 2014 · 6 comments
Open

can you support rpush? #24

jillesvangurp opened this issue Oct 8, 2014 · 6 comments

Comments

@jillesvangurp
Copy link

Getting a connection refused error currently when I try to call rpush because it is using the inherited method, which is trying to connect to the real thing. In general, it would be nice to override every method and make it do nothing as a default.

I'll fork and send a push request for this.

@voomdoon
Copy link

The default should be to throw UnsupportedOperationException.

@jillesvangurp
Copy link
Author

That sort of defeats the purpose of using a stub. For me a stub that does nothing is more useful than a stub that throws an exception. For what it's worth, I ended up building my own stub instead of using this project. This allows me to run our product with and without redis. Basically all the methods return null and/or do nothing. I appreciate that the goal of this project was to actually fake some behavior, so not the same thing.

@kshchepanovskyi
Copy link
Contributor

The default should be to throw UnsupportedOperationException.

Agree.

@idyedov Will you accept PR?

@idyedov
Copy link
Contributor

idyedov commented Nov 20, 2014

sure.

I was also thinking of any possible ways to use reflections to have a default handler rather than defining them all manually and making sure they're in sync with Jedis across versions etc, but that might be harder

@kshchepanovskyi
Copy link
Contributor

I was also thinking of any possible ways to use reflections to have a default handler rather than defining them all manually and making sure they're in sync with Jedis across versions etc, but that might be harder

It's not needed - it is done automatically by jvm, for missing method it throws java.lang.NoSuchMethodException

@kshchepanovskyi
Copy link
Contributor

Ups, I was wrong - MockJedis extends Jedis so it is not so simple ...

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