Skip to content
This repository has been archived by the owner on Sep 12, 2021. It is now read-only.

Commit

Permalink
Update dependencies (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
gguan authored and akkie committed Sep 17, 2018
1 parent 780367c commit 5834622
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 18 deletions.
16 changes: 8 additions & 8 deletions build.sbt
Expand Up @@ -9,22 +9,22 @@ import scalariform.formatter.preferences._

name := "play-silhouette-persistence-reactivemongo"

version := "5.0.2"
version := "5.0.5"

scalaVersion := "2.12.4"
scalaVersion := "2.12.6"

crossScalaVersions := Seq("2.12.4", "2.11.12")
crossScalaVersions := Seq("2.12.6", "2.11.12")

resolvers += Resolver.jcenterRepo

resolvers += "Sonatype snapshots" at "https://oss.sonatype.org/content/repositories/snapshots/"

libraryDependencies ++= Seq(
"com.mohiva" %% "play-silhouette" % "5.0.3",
"com.mohiva" %% "play-silhouette-persistence" % "5.0.3",
"org.reactivemongo" %% "play2-reactivemongo" % "0.13.0-play26",
"net.codingwell" %% "scala-guice" % "4.1.1" % "test",
"de.flapdoodle.embed" % "de.flapdoodle.embed.mongo" % "2.0.0" % "test",
"com.mohiva" %% "play-silhouette" % "5.0.5",
"com.mohiva" %% "play-silhouette-persistence" % "5.0.5",
"org.reactivemongo" %% "play2-reactivemongo" % "0.16.0-play26",
"net.codingwell" %% "scala-guice" % "4.2.1" % "test",
"de.flapdoodle.embed" % "de.flapdoodle.embed.mongo" % "2.1.1" % "test",
specs2 % Test
)

Expand Down
Expand Up @@ -20,7 +20,7 @@ import com.mohiva.play.silhouette.persistence.exceptions.MongoException
import play.api.Configuration
import play.api.libs.json.{ Format, JsObject, Json }
import play.modules.reactivemongo.ReactiveMongoApi
import play.modules.reactivemongo.json._
import reactivemongo.play.json._
import reactivemongo.api.commands.WriteResult
import reactivemongo.play.json.collection.JSONCollection

Expand Down Expand Up @@ -71,7 +71,7 @@ class MongoAuthInfoDAO[A <: AuthInfo: ClassTag: Format](
* @return The retrieved auth info or None if no auth info could be retrieved for the given login info.
*/
def find(loginInfo: LoginInfo) = {
jsonCollection.flatMap(_.find(Json.obj("_id" -> loginInfo)).projection(Json.obj("_id" -> 0)).one[A])
jsonCollection.flatMap(_.find(Json.obj("_id" -> loginInfo), projection = Some(Json.obj("_id" -> 0))).one[A])
}

/**
Expand Down Expand Up @@ -119,7 +119,7 @@ class MongoAuthInfoDAO[A <: AuthInfo: ClassTag: Format](
* @param loginInfo The login info for which the auth info should be removed.
* @return A future to wait for the process to be completed.
*/
def remove(loginInfo: LoginInfo) = onSuccess(jsonCollection.flatMap(_.remove(Json.obj("_id" -> loginInfo))), ())
def remove(loginInfo: LoginInfo) = onSuccess(jsonCollection.flatMap(_.delete().one(Json.obj("_id" -> loginInfo))), ())

/**
* Merges the [[LoginInfo]] and the [[AuthInfo]] into one Json object.
Expand Down
Expand Up @@ -17,7 +17,7 @@ package com.mohiva.play.silhouette.persistence

import java.io.InputStream

import de.flapdoodle.embed.mongo.config.{ MongodConfigBuilder, Net, RuntimeConfigBuilder }
import de.flapdoodle.embed.mongo.config.{ MongoCmdOptionsBuilder, MongodConfigBuilder, Net, RuntimeConfigBuilder }
import de.flapdoodle.embed.mongo.distribution.Version
import de.flapdoodle.embed.mongo.{ Command, MongodProcess, MongodStarter }
import de.flapdoodle.embed.process.runtime.Network
Expand All @@ -30,10 +30,6 @@ import play.api.libs.json.{ JsObject, Json, Reads }
import play.api.test.{ PlaySpecification, WithApplication }
import play.api.{ Environment, Logger }
import play.modules.reactivemongo.{ ReactiveMongoApi, ReactiveMongoModule }
import reactivemongo.api.FailoverStrategy
import reactivemongo.api.commands.DropDatabase
import reactivemongo.api.commands.bson.BSONDropDatabaseImplicits._
import reactivemongo.api.commands.bson.CommonImplicits._
import reactivemongo.play.json.collection.JSONCollection

import scala.concurrent.ExecutionContext.Implicits.global
Expand Down Expand Up @@ -119,6 +115,7 @@ trait MongoSpecification extends PlaySpecification {
.prepare(new MongodConfigBuilder()
.version(embedMongoDBVersion())
.net(new Net(embedConnectionPort(), Network.localhostIsIPv6))
.cmdOptions(new MongoCmdOptionsBuilder().useNoJournal(false).build())
.build
)

Expand Down Expand Up @@ -168,7 +165,7 @@ trait MongoScope extends BeforeAfterWithinAround {
* Inserts the test fixtures.
*/
def before: Unit = {
import play.modules.reactivemongo.json._
import reactivemongo.play.json._
Await.result(reactiveMongoAPI.database.flatMap { db =>
Future.sequence(fixtures.flatMap {
case (c, files) =>
Expand All @@ -186,7 +183,7 @@ trait MongoScope extends BeforeAfterWithinAround {
*/
def after: Unit = {
Await.result(reactiveMongoAPI.database.flatMap { db =>
db.runCommand(DropDatabase, FailoverStrategy.default)
db.drop()
}, Duration(60, SECONDS))
}
}
Expand Down

0 comments on commit 5834622

Please sign in to comment.