Is there a java alternative for Ruby's VCR?
As far as I understand, the benefits of using VCR are immense, you can run an "integration test" and record the results, store them some where locally. Now from the next time when you need to run your tests, you can mockup your actual database hits with the data recorded from the first run.
VCR only records HTTP interactions, but can such an approach be done to record, say any kind of database operations/function calls to other team's APIs which I don't need to test, basically this will relieve me from mocking up so many things by automating it.
Here is an example of VCR with Ruby's unit tests:
Check out betamax. It's a groovy port of VCR. It should work on the JVM with any language, I believe.
As for using a VCR-like library to record/playback DB interactions: Sven Fuchs tried this approach and didn't see much benefit to it.
Check out anystub. this is java-lib. it allows to record/playback any String get(String... keys)
invocations instead of only HTTP trafic.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With