Skip to content

Instantly share code, notes, and snippets.

@trane
Last active November 10, 2015 00:57
Show Gist options
  • Save trane/490d926ef2df5728d0cd to your computer and use it in GitHub Desktop.
Save trane/490d926ef2df5728d0cd to your computer and use it in GitHub Desktop.
def consulResponse(s: Secrets): ConsulResponse =
ConsulResponse(...., Base64Encode(s.toJson), ...)
def mockConsulService(secrets: Secrets): Service[Request, Response] = {
new Service[Request, Response] {
def apply(req: Request): Future[Response] = {
val res = Response(Status.Ok)
(req.method, req.path) match {
case (Get, Root / "/v1/k1") => res.contentString = consulResponse(secrets).toJson
case (Put, path) =>
}
Future.value(res)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment