Skip to content

Commit

Permalink
Update zio-cli to 0.7.0 (#3323)
Browse files Browse the repository at this point in the history
* Update zio-cli to 0.7.0

* Fix compilation

---------

Co-authored-by: zio-scala-steward[bot] <145262613+zio-scala-steward[bot]@users.noreply.github.com>
Co-authored-by: Jules Ivanic <[email protected]>
  • Loading branch information
zio-scala-steward[bot] and guizmaii authored Feb 19, 2025
1 parent 235575e commit 8bbccf2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ object Dependencies {
val NettyIncubatorVersion = "0.0.26.Final"
val ScalaCompactCollectionVersion = "2.13.0"
val ZioVersion = "2.1.15"
val ZioCliVersion = "0.5.0"
val ZioCliVersion = "0.7.0"
val ZioJsonVersion = "0.7.23"
val ZioParserVersion = "0.1.10"
val ZioSchemaVersion = "1.6.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ object HttpCliApp {
figFont: FigFont = FigFont.Default,
cliStyle: Boolean = true,
client: CliClient = DefaultClient(),
): HttpCliApp[Any, Throwable, CliRequest] = {
): HttpCliApp[Any, Throwable, Response] = {
HttpCliApp {
CliApp.make(
name = name,
Expand Down
18 changes: 9 additions & 9 deletions zio-http-cli/src/test/scala/zio/http/endpoint/cli/CliSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ object CliSpec extends ZIOSpecDefault {
} yield ZEnvironment[TestClient, Client](driver, ZClient.fromDriver(driver))
}

val cliApp: CliApp[Any, Throwable, CliRequest] =
val cliApp: CliApp[Any, Throwable, Response] =
HttpCliApp
.fromEndpoints(
"simple",
Expand Down Expand Up @@ -143,35 +143,35 @@ object CliSpec extends ZIOSpecDefault {
for {
response <- cliApp.run(List("get", "--path1", "--body1", "342.76", "--header", "header"))
result <- response match {
case r: Response => r.body.asString
case _ => ZIO.succeed("wrong type")
case Some(r: Response) => r.body.asString
case _ => ZIO.succeed("wrong type")
}
} yield assertTrue(result == "received 1")
},
test("Multiform endpoint") {
for {
response <- cliApp.run(List("create", "--path2", "sampleText", "--body1", "342.76", "--body2", "sample"))
result <- response match {
case r: Response => r.body.asString
case _ => ZIO.succeed("wrong type")
case Some(r: Response) => r.body.asString
case _ => ZIO.succeed("wrong type")
}
} yield assertTrue(result == "received 2")
},
test("Stream content endpoint") {
for {
response <- cliApp.run(List("update", "--path2", "sampleText", "--path1", "--bodyStream", "342"))
result <- response match {
case r: Response => r.body.asString
case _ => ZIO.succeed("wrong type")
case Some(r: Response) => r.body.asString
case _ => ZIO.succeed("wrong type")
}
} yield assertTrue(result == "received 3")
},
test("From URL") {
for {
response <- cliApp.run(List("get", "--header", "fromURL", "--u-body1", "/fromURL"))
result <- response match {
case r: Response => ZIO.succeed(r)
case _ => ZIO.succeed(Response.text("wrong type"))
case Some(r: Response) => ZIO.succeed(r)
case _ => ZIO.succeed(Response.text("wrong type"))
}
text <- result.body.asString
} yield assertTrue(text.contains("342.76"))
Expand Down

0 comments on commit 8bbccf2

Please sign in to comment.