Skip to content
This repository has been archived by the owner on Jul 30, 2024. It is now read-only.

Commit

Permalink
Fix broken tests
Browse files Browse the repository at this point in the history
Signed-off-by: mdedetrich <[email protected]>
  • Loading branch information
mdedetrich committed Jan 6, 2021
1 parent f48ec3e commit c1b310d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
32 changes: 16 additions & 16 deletions src/test/scala/org/zalando/kanadi/api/EventPublishRetrySpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -160,17 +160,17 @@ class EventPublishRetrySpec(implicit ec: ExecutionEnv) extends Specification wit

def retryPartialEvents = {
val future = for {
_ <- Http(system)
.newServerAt("localhost", port)
.bind(routes(false))
.map(
_.addToCoordinatedShutdown(
10 seconds
))
bind <- Http(system)
.newServerAt("localhost", port)
.bind(routes(false))
.map(
_.addToCoordinatedShutdown(
10 seconds
))
_ <- eventsClient.publish(EventTypeName(TestEvent), events)
failedEvents <- retryWithFailedEvents
retriedEvents <- retryWithRetriedEvents
_ <- system.terminate()
_ <- bind.terminate(10 seconds)
} yield {
failedEvents.failedEvents.nonEmpty &&
failedEvents.serverFailedEvents.toSet == retriedEvents.toSet
Expand All @@ -181,15 +181,15 @@ class EventPublishRetrySpec(implicit ec: ExecutionEnv) extends Specification wit

def retryForeverAndFail = {
val future = for {
_ <- Http(system)
.newServerAt("localhost", port)
.bind(routes(true))
.map(
_.addToCoordinatedShutdown(
10 seconds
))
bind <- Http(system)
.newServerAt("localhost", port)
.bind(routes(true))
.map(
_.addToCoordinatedShutdown(
10 seconds
))
_ <- eventsClient.publish(EventTypeName(TestEvent), events).recoverWith {
case e => system.terminate().flatMap(_ => Future.failed(e))
case e => bind.terminate(10 seconds).flatMap(_ => Future.failed(e))
}
} yield ()

Expand Down
2 changes: 1 addition & 1 deletion src/test/scala/org/zalando/kanadi/api/JsonSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class JsonSpec extends Specification {
decode[Metadata](spanCtxJson) must beRight(spanCtxEventMetadata)

def encodeSpnCtx =
spanCtxEventMetadata.asJson.print(Printer.noSpaces.copy(dropNullValues = true)) mustEqual spanCtxJson
spanCtxEventMetadata.asJson.printWith(Printer.noSpaces.copy(dropNullValues = true)) mustEqual spanCtxJson

def badDecodeSpnCtx =
decode[Metadata](spanCtxBadJson) must beLeft(
Expand Down

0 comments on commit c1b310d

Please sign in to comment.