Skip to content

Commit

Permalink
update version and add test to verify client working
Browse files Browse the repository at this point in the history
  • Loading branch information
will committed Dec 8, 2022
1 parent cf8bcdc commit d864341
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 3 deletions.
1 change: 1 addition & 0 deletions .bsp/sbt.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name":"sbt","version":"1.6.2","bspVersion":"2.0.0-M5","languages":["scala"],"argv":["C:\\Users\\wpick\\.jdks\\corretto-1.8.0_352\\jre/bin/java","-Xms100m","-Xmx100m","-classpath","C:/Users/wpick/AppData/Roaming/JetBrains/IntelliJIdea2022.2/plugins/Scala/launcher/sbt-launch.jar","xsbt.boot.Boot","-bsp","--sbt-launch-jar=C:/Users/wpick/AppData/Roaming/JetBrains/IntelliJIdea2022.2/plugins/Scala/launcher/sbt-launch.jar"]}
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
1 change: 1 addition & 0 deletions project/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sbt.version=1.6.2
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 d864341

Please sign in to comment.