This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.springframework.web.context.request.async.DeferredResult | |
import scala.concurrent.Future | |
import scala.util.{Failure, Success} | |
import scala.concurrent.ExecutionContext.Implicits.global | |
object FutureOps { | |
implicit class DeferredResultFromFuture[T](future: Future[T]) { | |
def toDeferredResult: DeferredResult[T] = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.scalactic.Prettifier | |
import org.scalatest.matchers.{MatchResult, Matcher} | |
import org.scalatest.{FunSpec, Matchers} | |
import org.skyscreamer.jsonassert.{JSONCompare, JSONCompareMode} | |
trait JsonEqualityMatcher { | |
def equalsToJson(spread: String): Matcher[String] = { | |
new Matcher[String] { | |
def apply(left: String): MatchResult = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.lang.reflect.{ParameterizedType, Type => JType} | |
import scala.reflect.runtime.universe._ | |
object TypeConverter { | |
val defaultMirror = runtimeMirror(getClass.getClassLoader) | |
implicit val implicitConverter = scalaToJavaType(defaultMirror) _ | |
def scalaToJavaType(mirror: Mirror)(tpe: Type): JType = |