I know it's been taking me a while to get everything going again with this project, and for that I apologize and also thank you, the reader, for being patient. I was hoping to finish documentation and maybe clean up the code a little bit more, but after some reflection, I came to realize that Betamax will likely never be "ready", but now it's "ready enough."
What does 2.X mean in comparison to 1.X?
1.X followed VCR's pattern of stubbing particular clients, which proved to be a lot more difficult in a statically typed language like Java. Also, it required Groovy as a dependency, which was not a popular decision as many developers did not want Groovy as a test dependency.
2.X aims to support any http client library that respects JVM-based proxy configuration. In 2.X, Betamax will launch a netty instance as a proxy that will capture requests and play them back as necessary. This will actually create a better testing environment than VCR due to the integration testing it provides.
2.X was delayed almost completely due to SSL/TLS support. With JDK7, Oracle made achieving a man-in-the-middle much more difficult to do (as they should have), thus forcing Betamax to approach the problem differently. The solution we came up with was to produce a Betamax certificate authority that will be installed into the JVM's cacerts
, which allows Betamax to pose as any secure site. Please see the README for step-by-step configuration instructions.
There is no official documentation, though everything you need to know is in the README, and we have many examples of how to use Betamax throughout our tests. I will continue to work on the documentation, but please use our Gitter if you have questions or concerns.
Also, don't let the 55 issues (at the time of writing) scare you off; almost all of them are not relevant. I will be cleaning those up and potentially releasing a 2.0.1 in the near future.
Other than that, test hard, test well!
JUnit
<dependency>
<groupId>software.betamax</groupId>
<artifactId>betamax-junit</artifactId>
<version>2.0.0</version>
<scope>test</scope>
</dependency>
Specs2
<dependency>
<groupId>software.betamax</groupId>
<artifactId>betamax-specs2_2.11</artifactId>
<version>2.0.0</version>
<scope>test</scope>
</dependency>