Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ dist: trusty
scala:
- 2.10.6
- 2.11.8
- 2.12.8

jdk:
- oraclejdk8
45 changes: 23 additions & 22 deletions cloudinary-core/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -13,37 +13,38 @@ name := "cloudinary-core-scala"

pomExtra := {
<url>http://cloudinary.com</url>
<licenses>
<license>
<name>MIT</name>
<url>http://opensource.org/licenses/MIT</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<connection>scm:git:github.com/cloudinary/cloudinary_scala.git</connection>
<developerConnection>scm:git:github.com/cloudinary/cloudinary_scala.git</developerConnection>
<url>github.com/cloudinary/cloudinary_scala.git</url>
</scm>
<developers>
<developer>
<licenses>
<license>
<name>MIT</name>
<url>http://opensource.org/licenses/MIT</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<connection>scm:git:github.com/cloudinary/cloudinary_scala.git</connection>
<developerConnection>scm:git:github.com/cloudinary/cloudinary_scala.git</developerConnection>
<url>github.com/cloudinary/cloudinary_scala.git</url>
</scm>
<developers>
<developer>
<id>cloudinary</id>
<name>Cloudinary</name>
<email>info@cloudinary.com</email>
</developer>
</developers>
}
</developer>
</developers>
}

libraryDependencies ++= Seq(
"com.ning" % "async-http-client" % "1.9.40",
"org.json4s" %% "json4s-native" % "3.4.0",
"org.json4s" %% "json4s-ext" % "3.4.0",
"org.scalatest" %% "scalatest" % "2.2.1" % "test",
"org.json4s" %% "json4s-native" % "3.6.10",
"org.json4s" %% "json4s-ext" % "3.6.10",
"org.scalatest" %% "scalatest" % "3.2.2" % "test",
"org.scala-lang.modules" %% "scala-xml" % "1.1.1",
"org.nanohttpd" % "nanohttpd" % "2.2.0" % "test")

// http://mvnrepository.com/artifact/org.slf4j/slf4j-simple
libraryDependencies += "org.slf4j" % "slf4j-simple" % "1.7.21" % "test"
libraryDependencies += "org.scalamock" %% "scalamock-scalatest-support" % "3.2.2" % "test"
libraryDependencies += "org.scalamock" %% "scalamock-scalatest-support" % "3.4.1" % "test"
resolvers ++= Seq("sonatype snapshots" at "https://oss.sonatype.org/content/repositories/snapshots", "sonatype releases" at "https://oss.sonatype.org/content/repositories/releases")

scalacOptions ++= Seq("-unchecked", "-deprecation", "-feature")
Expand Down
5 changes: 4 additions & 1 deletion cloudinary-core/src/test/scala/com/cloudinary/ApiSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ import com.cloudinary.parameters._
import com.cloudinary.response._
import com.ning.http.client._
import org.scalamock.scalatest.MockFactory
import org.scalatest.{Matchers, _}
import org.scalatest._
import matchers.should._
import matchers.should.Matchers._
import org.scalatest.flatspec.AnyFlatSpec

import scala.concurrent.Await
import scala.concurrent.ExecutionContext.Implicits.global
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@ package com.cloudinary

import scala.language.postfixOps
import org.scalatest._
import org.scalatest.Matchers
import matchers.should._
import matchers.should.Matchers._
import java.net.URI

import scala.Console.in
import scala.collection.JavaConverters._
import org.scalatest.flatspec.AnyFlatSpec

class CloudinarySpec extends FlatSpec with Matchers with OptionValues with Inside {
class CloudinarySpec extends AnyFlatSpec with Matchers with OptionValues with Inside {
lazy val cloudinary = {
new Cloudinary("cloudinary://a:b@test123")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ import com.ning.http.client.multipart.StringPart
import com.ning.http.client.{AsyncHttpClient, AsyncHttpClientConfig, AsyncHttpProvider, Request}
import org.scalamock.clazz.Mock
import org.scalamock.scalatest.MockFactory
import org.scalatest.{BeforeAndAfterEach, FlatSpec}
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.BeforeAndAfterEach

import scala.collection.JavaConverters._

class MockableFlatSpec extends FlatSpec with MockFactory with BeforeAndAfterEach{
class MockableFlatSpec extends AnyFlatSpec with MockFactory with BeforeAndAfterEach{
protected val prefix = "cloudinary_scala"
protected val suffix = sys.env.getOrElse("TRAVIS_JOB_ID", (10000 + scala.util.Random.nextInt(89999)).toString)
protected val testId = s"${prefix}_$suffix"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ package com.cloudinary

import com.cloudinary.Api.{ASCENDING, DESCENDING}
import com.cloudinary.parameters.SearchParameters
import org.scalatest.{FlatSpec, Inside, Matchers, OptionValues}
import org.json4s.native.Serialization.write
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
import org.scalatest.{Inside, OptionValues}

class SearchParametersSpec extends FlatSpec with Matchers with OptionValues with Inside {
class SearchParametersSpec extends AnyFlatSpec with Matchers with OptionValues with Inside {
import SearchParameters.formats

behavior of "SearchParameters"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ package com.cloudinary
import com.cloudinary.Api.ASCENDING
import com.cloudinary.parameters.UploadParameters
import com.cloudinary.response.CustomCoordinate
import org.scalatest.{BeforeAndAfterAll, Inside, Matchers, OptionValues}
import org.scalatest.matchers.should.Matchers
import org.scalatest.{BeforeAndAfterAll, Inside, OptionValues}

import scala.concurrent.Await
import scala.concurrent.ExecutionContext.Implicits.global
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ package com.cloudinary

import scala.language.postfixOps
import org.scalatest._
import org.scalatest.Matchers
import matchers.should._

class TransformationSpec extends FlatSpec with Matchers with OptionValues with Inside {
import org.scalatest.flatspec.AnyFlatSpec


class TransformationSpec extends AnyFlatSpec with Matchers with OptionValues with Inside {
behavior of "A Transformation"

lazy val cloudinary = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import com.cloudinary.parameters._
import com.cloudinary.response._
import com.ning.http.client.Request
import com.ning.http.client.multipart.StringPart
import org.scalatest.{Matchers, _}
import org.scalatest.{BeforeAndAfterAll, Inside, OptionValues, Tag, matchers}
import matchers.should._

import scala.concurrent.Await
import scala.concurrent.ExecutionContext.Implicits.global
Expand Down Expand Up @@ -292,10 +293,11 @@ class UploaderSpec extends MockableFlatSpec with Matchers with OptionValues with
}

it should "support requesting detection" in {
//Detection invalid model 'illegal'".equals(message)
val error = Await.result(for {
e <- uploader.upload(s"$testResourcePath/logo.png", options.detection("illegal")).recover{case e => e}
} yield e, 10.seconds)
error.asInstanceOf[BadRequest].message should include("is invalid")
error.asInstanceOf[BadRequest].message should include("invalid model")
}

it should "support uploading large raw files" in {
Expand Down
1 change: 1 addition & 0 deletions cloudinary-play-plugin/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ resolvers += "sonatype releases" at "https://oss.sonatype.org/content/repositori
resolvers += Resolver.file("Local Ivy", file(Path.userHome + "/.ivy2/local"))(Resolver.ivyStylePatterns)

libraryDependencies += "com.cloudinary" %% "cloudinary-core-scala" % version.value
libraryDependencies += guice

pomExtra := {
<url>http://cloudinary.com</url>
Expand Down
2 changes: 1 addition & 1 deletion cloudinary_scala_parent.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ lazy val cloudinaryPlayPlugin = project.in( file("cloudinary-play-plugin") ).en

lazy val photoAlbumScala = project.in( file("samples/photo_album") ).settings(publishArtifact := false).enablePlugins(PlayScala).dependsOn(cloudinaryPlayPlugin)

lazy val root = project.in( file(".") ).aggregate(cloudinaryCoreScala, cloudinaryPlayPlugin, photoAlbumScala).settings(
lazy val root = project.in( file(".") ).aggregate(cloudinaryCoreScala, cloudinaryPlayPlugin).settings(
aggregate in update := false
).settings(publishArtifact := false)
6 changes: 3 additions & 3 deletions project/Common.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
object Common {
def version = "1.2.2"
def playVersion = System.getProperty("play.version", "2.4.2")
def scalaVersion = "2.11.5"
def scalaVersions = Seq("2.10.4", scalaVersion)
def playVersion = System.getProperty("play.version", "2.6.6")
def scalaVersion = "2.12.8"
def scalaVersions = Seq("2.11.5", scalaVersion)
}
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=0.13.9
sbt.version=1.2.7
4 changes: 2 additions & 2 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
resolvers += "Typesafe repository" at "https://repo.typesafe.com/typesafe/releases/"

// Use the Play sbt plugin for Play projects
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % System.getProperty("play.version", "2.4.2"))
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % System.getProperty("play.version", "2.6.6"))

addSbtPlugin("com.typesafe.sbt" % "sbt-less" % "1.0.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-less" % "1.1.2")

// prefer to depend on these in ~/.sbt since this is only relevant for releasers

Expand Down
4 changes: 2 additions & 2 deletions samples/photo_album/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ scalaVersion := Common.scalaVersion

libraryDependencies ++= Seq(
"com.h2database" % "h2" % "1.4.188",
"com.typesafe.play" %% "play-slick" % "1.0.1",
"com.typesafe.play" %% "play-slick-evolutions" % "1.0.1",
"com.typesafe.play" %% "play-slick" % "3.0.4",
"com.typesafe.play" %% "play-slick-evolutions" % "3.0.4",
evolutions
)

Expand Down