Skip to content

Commit

Permalink
goes back to using earlier version of slick library wrapper to avoid …
Browse files Browse the repository at this point in the history
…test race condition, fixes tests for changes in Guice
  • Loading branch information
AndriusA authored and augustinas committed Oct 8, 2018
1 parent 2c4a0ce commit 00e9144
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class LambdaFunctionExecutable(
protected val logger = Logger(this.getClass)
private val lambdaLogs = config.get[String]("she.aws.logs")

logger.info(s"Initialised SHE lambda function $id v$version $baseUrl")
logger.debug(s"Initialised SHE lambda function $id v$version $baseUrl")

def execute(configuration: FunctionConfiguration, requestData: Request): Future[Seq[Response]] = {
val request = new InvokeRequest()
Expand Down Expand Up @@ -134,7 +134,7 @@ class AwsLambdaExecutor @Inject() (
.runWith(Sink.head)
.map {
case r: InvokeResult if r.getStatusCode == 200
logger.warn(
logger.debug(
s"""Function responded with:
| Status: ${r.getStatusCode}
| Body: ${ByteString(r.getPayload).utf8String}
Expand All @@ -150,7 +150,6 @@ class AwsLambdaExecutor @Inject() (
case r
val message = s"Retrieving SHE function configuration failed: $r, ${ByteString(r.getPayload).utf8String}"
logger.error(message)
logger.warn(s"Function invocation error: ${ByteString(java.util.Base64.getDecoder.decode(r.getLogResult)).utf8String}")
throw new ApiException(message)
}
}
Expand Down
4 changes: 2 additions & 2 deletions hat/test/org/hatdex/hat/api/HATTestContext.scala
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ trait HATTestContext extends Scope with Mockito {
* A fake Guice module.
*/
class FakeModule extends AbstractModule with ScalaModule {
def configure(): Unit = {
override def configure(): Unit = {
bind[Environment[HatApiAuthEnvironment]].toInstance(environment)
bind[Silhouette[HatApiAuthEnvironment]].to[SilhouetteProvider[HatApiAuthEnvironment]]
bind[HatServerProvider].toInstance(new FakeHatServerProvider(hatServer))
Expand All @@ -142,7 +142,7 @@ trait HATTestContext extends Scope with Mockito {
}

class ExtrasModule extends AbstractModule with ScalaModule {
def configure(): Unit = {
override def configure(): Unit = {
bind[TrustedApplicationProvider].toInstance(new TestApplicationProvider(Seq()))
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ trait ApplicationsServiceContext extends HATTestContext {
}

class CustomisedFakeModule extends AbstractModule with ScalaModule {
def configure(): Unit = {
override def configure(): Unit = {
bind[TrustedApplicationProvider].toInstance(new TestApplicationProvider(
Seq(notablesApp, notablesAppDebitless, notablesAppIncompatibleUpdated,
notablesAppExternal, notablesAppExternalFailing)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ trait HatDataStatsProcessorContext extends Scope {
val owner = HatUser(UUID.randomUUID(), "hatuser", Some("pa55w0rd"), "hatuser", Seq(Owner()), enabled = true)

class ExtrasModule extends AbstractModule with ScalaModule {
def configure(): Unit = {
override def configure(): Unit = {
bind[TrustedApplicationProvider].toInstance(new TestApplicationProvider(Seq()))
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ trait FunctionServiceContext extends HATTestContext {
* A fake Guice module.
*/
class CustomisedFakeModule extends AbstractModule with ScalaModule {
def configure() = {
}

@Provides
def provideFunctionExecutableRegistry(): FunctionExecutableRegistry = {
Expand Down
2 changes: 1 addition & 1 deletion project/BuildSettings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ object BasicSettings extends AutoPlugin {

override def projectSettings = Seq(
organization := "org.hatdex",
version := "2.6.1-SNAPSHOT",
version := "2.6.2-SNAPSHOT",
name := "HAT",
resolvers ++= Dependencies.resolvers,
scalaVersion := Dependencies.Versions.scalaVersion,
Expand Down
4 changes: 2 additions & 2 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ object Dependencies {
}

object Specs2 {
private val version = "4.3.3"
private val version = "3.9.5"
val core = "org.specs2" %% "specs2-core" % version
val matcherExtra = "org.specs2" %% "specs2-matcher-extra" % version
val mock = "org.specs2" %% "specs2-mock" % version
Expand All @@ -96,7 +96,7 @@ object Dependencies {
private val version = "2.6.2-SNAPSHOT"
val hatClient = "org.hatdex" %% "hat-client-scala-play" % version
val dexClient = "org.hatdex" %% "dex-client-scala-play" % version
val codegen = "org.hatdex" %% "slick-postgres-driver" % "0.0.11"
val codegen = "org.hatdex" %% "slick-postgres-driver" % "0.0.9"
}

val scalaGuice = "net.codingwell" %% "scala-guice" % "4.2.1"
Expand Down

0 comments on commit 00e9144

Please sign in to comment.