Skip to content

Commit

Permalink
Merge pull request #14 from ScalaConsultants/update-spray-client-version
Browse files Browse the repository at this point in the history
update version and add test to verify client working
  • Loading branch information
willpickard91 authored Dec 8, 2022
2 parents cf8bcdc + d955a74 commit be50e91
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 3 deletions.
6 changes: 3 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ libraryDependencies ++= {
"com.typesafe.akka" %% "akka-actor" % akkaVersion,
"com.typesafe.akka" %% "akka-slf4j" % akkaVersion,
"com.typesafe.akka" %% "akka-testkit" % akkaVersion % "test",
"io.spray" %% "spray-json" % "1.3.1",
"io.spray" %% "spray-client" % "1.3.1",
"io.spray" %% "spray-json" % "1.3.6",
"io.spray" %% "spray-client" % "1.3.4",
"io.spray" %% "spray-can" % "1.3.2",
"com.wandoulabs.akka" %% "spray-websocket" % "0.1.4",
"joda-time" % "joda-time" % "2.7",
Expand All @@ -28,7 +28,7 @@ libraryDependencies ++= {
)
}

resolvers += "spray repo" at "http://repo.spray.io"
resolvers += "spray repo" at "https://repo.spray.io"

publishMavenStyle := true

Expand Down
7 changes: 7 additions & 0 deletions src/test/resources/application.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
api {
base.url ="https://slack.com/api/"
}

akka {
loglevel = "DEBUG"
}
29 changes: 29 additions & 0 deletions src/test/scala/io/scalac/slack/api/ApiActorTest.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package io.scalac.slack.api

import akka.actor.{ActorSystem, Props}
import akka.pattern.ask
import akka.testkit.{ImplicitSender, TestKit}
import akka.util.Timeout
import org.scalatest.{BeforeAndAfterAll, Matchers, WordSpecLike}

import scala.concurrent.Await
import scala.concurrent.duration.DurationInt


class ApiActorTest extends TestKit(ActorSystem("api-actor")) with WordSpecLike with Matchers with ImplicitSender with BeforeAndAfterAll {

override def afterAll(): Unit = {
TestKit.shutdownActorSystem(system)
}

"ApiActor" must {
"connect after testing test api endpoint" in {
implicit val timeout: Timeout = 5.second
val actor = system.actorOf(Props[ApiActor])
val responseFuture = actor.ask(ApiTest())
val response = Await.result(responseFuture, timeout.duration)

response shouldBe Connected
}
}
}

0 comments on commit be50e91

Please sign in to comment.