Permalink
Browse files

Adding the first pass at a specs2 module.

  • Loading branch information...
cowboygneox committed Feb 14, 2016
1 parent f6c9f42 commit 8060ad9e1cd3838a6ec81c123f11d18b1cd37159
View
@@ -18,3 +18,4 @@ littleproxy_keystore.jks
littleproxy_cert
lib/
log.txt
+target/
@@ -48,7 +48,7 @@ protected ProxyConfiguration(ProxyConfigurationBuilder<?> builder) {
this.requestBufferSize = builder.requestBufferSize;
}
- public static ProxyConfigurationBuilder<?> builder() {
+ public static ProxyConfigurationBuilder<Builder> builder() {
return new Builder().configureFromPropertiesFile();
}
@@ -0,0 +1,16 @@
+apply from: "$rootDir/gradle/javaModule.gradle"
+apply from: "$rootDir/gradle/publishedModule.gradle"
+apply plugin: 'scala'
+
+repositories {
+ maven { url "http://repository.codehaus.org" }
+}
+
+dependencies {
+ compile project(":betamax-core")
+ compile "org.scala-lang:scala-library:2.11.7"
+ compile "org.specs2:specs2-core_2.11:3.7"
+ testCompile commonDependencies.junit
+ testCompile "org.specs2:specs2-junit_2.11:3.7"
+ testCompile "org.apache.httpcomponents:httpclient:4.3.1"
+}
@@ -0,0 +1,23 @@
+package com.gneoxsolutions.betamax.specs2
+
+import com.gneoxsolutions.betamax.TapeMode._
+import com.gneoxsolutions.betamax._
+import org.specs2.specification.{Scope, After}
+
+/**
+ * Created by sean on 2/11/16.
+ */
+
+object RecordedInteraction {
+ def apply[T](tape: String, tapeMode: TapeMode = READ_ONLY, matchRules: Seq[MatchRule] = Seq(MatchRules.method, MatchRules.uri))(block: => T): T = {
+ val config: ProxyConfiguration = ProxyConfiguration.builder().defaultMode(tapeMode).defaultMatchRules(matchRules: _*).build()
+ val recorder = new Recorder(config)
+ recorder.start(tape)
+
+ try {
+ block
+ } finally {
+ recorder.stop()
+ }
+ }
+}
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2013 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.gneoxsolutions.betamax.specs2;
+
+/**
+ * Created by sean on 2/13/16.
+ */
+public class DumbClass {
+}
@@ -0,0 +1,29 @@
+!tape
+name: google
+interactions:
+- recorded: 2016-02-12T00:03:37.243Z
+ request:
+ method: GET
+ uri: http://www.google.com/
+ headers:
+ Accept-Encoding: gzip,deflate
+ Content-Length: '0'
+ Host: www.google.com
+ Proxy-Connection: Keep-Alive
+ User-Agent: Apache-HttpClient/4.3.1 (java 1.5)
+ response:
+ status: 902
+ headers:
+ Cache-Control: private, max-age=0
+ Content-Encoding: gzip
+ Content-Length: '7414'
+ Content-Type: text/html; charset=ISO-8859-1
+ Date: Fri, 12 Feb 2016 00:03:36 GMT
+ Expires: '-1'
+ P3P: CP="This is not a P3P policy! See https://www.google.com/support/accounts/answer/151657?hl=en for more info."
+ Server: gws
+ Set-Cookie: NID=76=uUq5fdaOmbFbzK9fE_4OXHsD5fBRc-fh4vaApa-rUTpE1krXXHDEBwrRdQ8R6dw1NJYwTx-UNu7J7RE45WMcJdJB6AwB0k61uMietqt3kF4GPmgYIP1uV324byizMecyVyZ4taiW2VHn7w; expires=Sat, 13-Aug-2016 00:03:36 GMT; path=/; domain=.google.com; HttpOnly
+ X-Frame-Options: SAMEORIGIN
+ X-XSS-Protection: 1; mode=block
+ body: !!binary |-
+ H8KLCAAAAAAAAsO/w4U8w6t6w5vCtsKSw7/DuxQ0w5IjSyvCmiJ1wrElw4rCtDd1w5zDhG3DksOkw5ROw5M2J8OrDyQhwpERbyYpXyLDq13DtlF3BgBvwpLCnHTDu8Kdw73DtsOkVMK4w40MBsKDw4FgBgB9wrzDp8OGTsO+wpAww4XDi8ODw6DDpBh/FT9nYcOmw4QJwrM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/XzzDjMO+woh+w5Qvwq9fHUTDg3/DrsKrw79/XXfCpsOVVMKBP1AIJAkda0V4N8OEXBHDmDcjYsOiY3XClTjDtTxfwoDDhER3MQ3Dojg8AMKXVCXCrlcAwrjDnk1ew6YzPMK/U2HDpylqwrw4Q8OkalPCgFY/wrMBwrs/VsOJZxoSwrBxw6RzFkdJwoESZsOzDDlyIG4Cw5QzDMKFCsO/C8K6eAAUw7LDgnfDucKfw44JGcKNTMKoDcOQRzLDicOFwr/ClsO4wpdewp4NJsOTTQcKYEIkw7caCEXDvMKvw7RAVcKcLcKQwrsLw64TcMKvASoTWMKcUHkFbsKUw7RFwpQ7wpopw6JFwoXCq8OgwrNbw6w7VcKwwrPDgcKZw5wPw75FworDrxTDvkV4w4N5w63CswQBw5nCo8KiQcO0woHDjMO8w4ppw6LCmcKkw60jI8OybxDDmQ/Doi8LYQPCjsOaw5zDsELDl8OAw7ltCjLCgkxyI0QOPEDCiChFwpjDjkDCgh8/AcK6A3XChsKOGcKYw6URwqR5wrwAwoTDuy/Csz/Cjh4WPw/Dn8O8cMO7w7LCkMK9wpjDnMOeHi4OfsK9w7nDo8OPC8Kkw64SwrPDtsO3LMOkw4IXw69rasO2wqNawrIhwqtdPDDCt8K9wo9ReMKleFjCksKSaMKXwpUcTsKKDMOjw6J1w53DqHwuwpfDv2dYIsK1w4LCvcK/w4sEw5fCmsOBSE7DuVfCvsOFw7dtw4JFw4A9Cz9Kw4M/IMO1PzcawqjCkFBKAAA=
@@ -0,0 +1,28 @@
+package com.gneoxsolutions.betamax.specs2
+
+import org.apache.http.client.HttpClient
+import org.apache.http.client.methods.HttpGet
+import org.apache.http.impl.client.HttpClientBuilder
+import org.junit.runner.RunWith
+import org.specs2.mutable.Specification
+import org.specs2.runner.JUnitRunner
+
+/**
+ * Created by sean on 2/11/16.
+ */
+@RunWith(classOf[JUnitRunner])
+class RecordedInteractionTest extends Specification {
+ def withHttpClient[T](block: HttpClient => T): T = {
+ val client = HttpClientBuilder.create().useSystemProperties().build()
+ block(client)
+ }
+
+ "A Betamax test" should {
+ "replay google.com" in RecordedInteraction(tape = "google") {
+ withHttpClient { client =>
+ val response = client.execute(new HttpGet("http://www.google.com"))
+ response.getStatusLine.getStatusCode must beEqualTo(902) // obviously not from Google
+ }
+ }
+ }
+}
@@ -1,4 +1,4 @@
-#Sat Feb 13 23:36:30 CST 2016
+#Sun Feb 14 08:18:35 CST 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
View
@@ -1,5 +1,6 @@
include "betamax-core",
"betamax-junit",
+ "betamax-specs2_2.11",
"betamax-tests"
rootProject.name = "betamax"

0 comments on commit 8060ad9

Please sign in to comment.