Questions tagged [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"

betamax
Filter by
Sorted by
Tagged with
2 votes
1 answer
1k views

Mocking the requests for testing in Scrapy Spider

My objective is to test the spider written using scrapy (Python). I tried using contracts but it is really limited in the sense that I can not test things like pagination or whether some attributes ...
Riken Shah's user avatar
  • 3,122
2 votes
0 answers
116 views

Example for mocking apache HTTPS request using Betamax version 2.x in java?

I am trying to mock Apache HTTPS calls in Java, using Betamax 2.x. The old documentation is deprecated, and the docs for 2.x are still in progress. Can someone help with an example of how this can ...
hemanik's user avatar
  • 1,025
0 votes
1 answer
195 views

Betamax HTTPS Recording with Proxy - Certificate Error - Java Groovy

I can't get HTTPS URL's working with betamax. It's similar to this other issue posted below, however I've already done the betamax.pem file import and it seems to have had no effect: Here's the ...
solvingJ's user avatar
  • 1,341
1 vote
1 answer
355 views

How do I configure Betamax to use SSL for my Spock tests?

I have been trying to configure Betamax v2.0.0-alpha-1 to mock HTTP(S) calls from my spock tests. Calls to non-SSL sites work but a call to an HTTPS site causes the following exception: javax.ws.rs....
Duncan's user avatar
  • 45
1 vote
2 answers
446 views

Betamax with Spring Boot throws Illegal use of nonvirtual function call

I'm trying to setup a simple test in Groovy with Spock using Betamax: class BetaMaxSpockTest extends Specification { @Rule public Recorder recorder = new Recorder() @Betamax(tape = "...
raduy's user avatar
  • 520
0 votes
0 answers
95 views

Using Betamax to record HTTP traffic from browser?

The betamax documentation seems to imply that the only way betamax can be/is meant to be used is through jUnit tests. But I hope that's not the case. I want to use betamax to record the http traffic ...
Waffles's user avatar
  • 349
0 votes
0 answers
119 views

Betamax is not recording calls to RESTClient in Grails

I have a Betamax test that I'm trying to configure to intercept calls to a web service that is using RESTClient. The calls to the web service aren't getting recorded. My test code looks like this: @...
user1866924's user avatar
0 votes
2 answers
4k views

How do I write this Maven exclusion code in Gradle?

I'm trying to use the latest (master) version of Betamax in a Spring Boot project, and I'm getting the error SLF4J: Detected both log4j-over-slf4j.jar AND slf4j-log4j12.jar on the class path, ...
JimiJonJimbo's user avatar
3 votes
1 answer
3k views

"Illegal use of nonvirtual function call" when using Betamax

I'm trying to set up Betamax in a Spring Boot application, but when I run my test, I get this error: (class: co/freeside/betamax/proxy/jetty/BetamaxProxy, method: super$3$getBean signature: (Ljava/...
JimiJonJimbo's user avatar
2 votes
1 answer
936 views

Stubbing SOAP requests in Scala

I use scalaxb to generate models and client part of the SOAP interface. For testing I use Betamax, which can also be used in Scala. However, scalaxb uses Netty as a transport, which ignores proxy ...
mirelon's user avatar
  • 4,956
1 vote
0 answers
177 views

Betamax is not recording in Grails

I have a class that contains a RESTClient, and it performs a simple get request. The test is built as follows @Rule Recorder recorder = new Recorder() @Betamax(tape = 'meetupEventsList') void ...
monksy's user avatar
  • 14.2k
1 vote
2 answers
1k views

Betamax fails to record HTTPS traffic

My question is connected with Betamax library. I have problem with recording HTTPS traffic. I am using Betamax 1.1.2, JDK 1.6, Groovy 2.2.2 and jUnit 4.11. My test code: @Rule public Recorder ...
Wojciech Musiał's user avatar
3 votes
1 answer
17k views

Read a YAML file in Groovy

I am trying to load an existing YAML file (which uses snakeYaml library) in my Groovy project. I have a class called YamlTape.groovy which contains method to load the YAML file using the following ...
Warrior's user avatar
  • 39.2k