val expectedStatus = StatusCodes.OK s"return $expectedStatus and an empty list" in { for { resp <- http.singleRequest( HttpRequest( method = HttpMethods.GET, uri = s"$baseUrl/products", headers = Seq(), entity = HttpEntity( contentType = ContentTypes.`application/json`, data = ByteString("") ) ) ) body <- resp.entity.dataBytes.runFold(ByteString(""))(_ ++ _) } yield { resp.status must be(expectedStatus) decode[List[Product]](body.utf8String) match { case Left(e) => fail(s"Could not decode response: $e") case Right(d) => d must be(empty) } } }