betamaxteam/betamax


Betamax is a tool for mocking external HTTP resources such as web services and REST APIs in your tests. The project was inspired by the VCR library for Ruby.

http://betamax.software

License: Apache-2.0

Language: Groovy


βetamax Build Status Join the chat at https://gitter.im/betamaxteam/betamax

Betamax is a tool for mocking external HTTP resources in your tests. The project was inspired by the VCR library for Ruby.

Documentation hosted at http://betamax.software/ is currently only for the 1.X branch and is deprecated. New documentation is being produced, but it will take some time. Please see examples in Betamax's tests and follow this readme.

Installation

Since 2.0.1, requires JDK7 or later.

Betamax is hosted via Sonatype and is intended to be compatible with any Maven-based build tool.

JUnit

<dependency>
  <groupId>software.betamax</groupId>
  <artifactId>betamax-junit</artifactId>
  <version>2.0.1</version>
  <scope>test</scope>
</dependency>

Specs2 Maven

<dependency>
  <groupId>software.betamax</groupId>
  <artifactId>betamax-specs2_2.11</artifactId>
  <version>2.0.1</version>
  <scope>test</scope>
</dependency>

Specs2 SBT

libraryDependencies += "software.betamax" %% "betamax-specs2" % "2.0.1" % "test"

Snapshots:

Snapshots are made after every successful build in master, so if you want the bleeding edge, you know where to get it.

SSL Configuration

JDK 7 dramatically increased the security of the JVM, making it much more difficult to exploit man-in-the-middle attacks. Because Betamax is a legitimate use of MITM, it is necessary to configure the environment to allow Betamax to do so. This will be accomplished by installing a Betamax certificate-authority into Java's cacerts which will allow Betamax to generate a mock-SSL certificate for any site.

For all environments where tests are being run, a one-time installation of the Betamax certificate into Java's cacerts is necessary.

keytool -importcert -keystore $JAVA_HOME/jre/lib/security/cacerts -file betamax.pem -alias betamax -storepass changeit -noprompt

Notes:

  1. sudo will likely be required for unix-based operating systems
  2. betamax.pem is included in the betamax-core.jar, but it's probably best to pull it from GitHub.
  3. betamax.pem shouldn't have a need to change for the foreseeable future, so this installation should last for the life of the tests.

Files to Ignore:

Betamax generates files with the following extensions that should not be committed to source control:

  • *.csr
  • *.cert
  • *.jks

Continuous Integration Considerations:

For Docker users, please use the JDK images hosted on Docker Hub; they have the Betamax CA installed and ready to go.

For Travis CI users, please see Betamax's .travis.yml. As of writing, sudo:required is necessary in order to install the CA. Hopefully this won't be the case in the future.

For all other CI environments, be sure to use the keytool command listed above to ensure the Betamax CA is installed.

Contributors

Betamax Team

Additional Contributions (sorted alphabetically by last name)

  • Marcin Erdmann
  • Ian Grayson
  • Russel Hart
  • Lari Hotari
  • Michal Kováč
  • David Kowis
  • Jason LeCount
  • Peter Ledbrook
  • George McIntosh
  • James Newbery
  • Ryan Schmitt
  • Michael Vorburger

Note: There were 3 others who didn't appropriately identify themselves via Git, and thus are not on this list.

Project Statistics

Sourcerank 11
Repository Size 59.7 MB
Stars 422
Forks 129
Watchers 25
Open issues 18
Dependencies 0
Contributors 18
Tags 7
Created
Last updated
Last pushed

Top Contributors See all

Sean Freitag David Kowis Rob Fletcher Nobuhiro Sue Michal Kovac Peter Ledbrook Ryan Schmitt Rus Hart Arno Uhlig Marcin Erdmann George McIntosh Jim Newbery Lari Hotari The Gitter Badger Michael Vorburger ⛑️ James Netherton jlecount-okta pksandeep

Packages Referencing this Repo

com.github.robfletcher:betamax
Betamax is a Groovy record/playback proxy for stubbing access to external HTTP resources when tes...
Latest release 1.0 - Updated - 422 stars
co.freeside:betamax
Betamax is a Groovy record/playback proxy for stubbing access to external HTTP resources when tes...
Latest release 1.1.2 - Updated - 422 stars

Recent Tags See all

2.0.0 June 20, 2016
2.0.0-alpha-1 March 08, 2016
1.1.2 October 17, 2012
1.1.1 October 12, 2012
1.1 October 10, 2012
1.0 September 22, 2011
1.0-M1 August 24, 2011

Interesting Forks See all

mirelon/betamax
Betamax is a tool for mocking external HTTP resources such as web services and REST APIs in your ...
Groovy - Updated - 1 stars
shazam/betamax
Betamax is a tool for mocking external HTTP resources such as web services and REST APIs in your ...
CSS - Apache-2.0 - Updated - 1 stars - 2 forks

Something wrong with this page? Make a suggestion

Last synced: 2016-11-24 16:24:40 UTC

Login to resync this repository