Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bumps http4s and circe #796

Merged
merged 1 commit into from
May 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .jvmopts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@
-XX:+TieredCompilation
-XX:-UseGCOverheadLimit
# effectively adds GC to Perm space
-XX:+UseConcMarkSweepGC
-XX:+CMSClassUnloadingEnabled
# must be enabled for CMSClassUnloadingEnabled to work
19 changes: 3 additions & 16 deletions github4s/shared/src/test/scala/github4s/http/HttpClientSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ import cats.effect.IO
import cats.effect.unsafe.implicits.global
import fs2.Stream
import github4s.GHError._
import io.circe.{DecodingFailure, Encoder, Json}
import io.circe.CursorOp.DownField
import io.circe.{Encoder, Json}
import io.circe.syntax._
import io.circe.generic.auto._
import org.http4s.{EntityEncoder, Response, Status}
Expand Down Expand Up @@ -103,26 +102,14 @@ class HttpClientSpec extends AnyFlatSpec with Matchers {
val rlee = RateLimitExceededError("msg", "")
val response = Response[IO](body = createBody(rlee.asJson))
val res = HttpClient.buildResponse[IO, Foo](response)
res.unsafeRunSync() shouldBe Left(
JsonParsingError(
s"Invalid message body: Could not decode JSON: ${rlee.asJson.spaces2}",
Some(DecodingFailure("Attempt to decode value on failed cursor", List(DownField("a"))))
)
)
res.unsafeRunSync().swap.getOrElse(fail()) shouldBe a[JsonParsingError]
}

it should "build a left if it couldn't decode a GHError" in {
val foo = Foo(3)
val response = Response[IO](status = Status.Unauthorized, body = createBody(foo.asJson))
val res = HttpClient.buildResponse[IO, Foo](response)
res.unsafeRunSync() shouldBe Left(
JsonParsingError(
s"Invalid message body: Could not decode JSON: ${foo.asJson.spaces2}",
Some(
DecodingFailure("Attempt to decode value on failed cursor", List(DownField("message")))
)
)
)
res.unsafeRunSync().swap.getOrElse(fail()) shouldBe a[JsonParsingError]
}

def createBody[F[_]](js: Json): Stream[F, Byte] =
Expand Down
4 changes: 2 additions & 2 deletions project/ProjectPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ object ProjectPlugin extends AutoPlugin {
lazy val V = new {
val bm4 = "0.3.1"
val cats: String = "2.7.0"
val circe: String = "0.14.1"
val circe: String = "0.14.2"
val expecty = "0.15.4"
val http4s: String = "0.23.11"
val http4s: String = "0.23.12"
val paradise: String = "2.1.1"
val scalacheck = "1.16.0"
val scalacheckShapeless = "1.3.0"
Expand Down