Created
October 27, 2014 08:20
-
-
Save hanrw/6a8721276138272107cb to your computer and use it in GitHub Desktop.
ScalaMocoTest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.github.nicholasren.moco.dsl.Conversions._ | |
import com.github.nicholasren.moco.dsl.SMoco | |
import com.github.nicholasren.moco.dsl.SMoco._ | |
import org.apache.http.client.fluent.Request | |
import org.scalatest.{BeforeAndAfter, FunSpec} | |
class ScalaMocoTest extends FunSpec with BeforeAndAfter { | |
var theServer: SMoco = null | |
before { | |
theServer = server(8983) | |
} | |
after { | |
theServer = null | |
} | |
describe("solr responses") { | |
it("should return ok") { | |
theServer when { | |
uri("/solr/collection1/select") | |
} then { | |
file("/test.json") | |
} | |
theServer running { | |
val content = Request.Get("http://localhost:8983/solr/collection1/select").execute().returnContent() | |
assert(content.toString.contains("\"numFound\"")) | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment