Skip to content

Commit

Permalink
project: upgrade the mockito and scalajs dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
etorreborre committed Mar 23, 2023
1 parent 7858fd9 commit e78c36e
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 24 deletions.
1 change: 1 addition & 0 deletions .sbtopts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
-J-Xms1536m
-J-Xmx4G
-J-XX:ReservedCodeCacheSize=192m
-J--add-opens=java.base/java.lang=ALL-UNNAMED
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ lazy val testingSettings = Seq(
)

lazy val testingJvmSettings = Seq(
javaOptions ++= Seq("-Xmx3G", "-Xss4M"),
javaOptions ++= Seq("-Xmx3G", "-Xss4M", "--add-opens=java.base/java.lang=ALL-UNNAMED"),
Test / fork := true
)

Expand Down
11 changes: 0 additions & 11 deletions mock/jvm/src/test/scala/org/specs2/mock/MockitoSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -584,22 +584,11 @@ ${step(env)}
m.varargs(1, 2)

there was one(m).javaList(anyJavaList)
there was one(m).javaList(anyJavaListOf[Int])

there was one(m).javaSet(anyJavaSet)
there was one(m).javaSet(anyJavaSetOf[Int])

there was one(m).javaCollection(anyJavaCollection)
there was one(m).javaCollection(anyJavaCollectionOf[Int])

there was one(m).javaMap(anyJavaMap)
there was one(m).javaMap(anyJavaMapOf[Int, String])

there was one(m).List(anyList)
there was one(m).List(anyListOf[Int])

there was one(m).Set(anySet)
there was one(m).Set(anySetOf[Int])

there was one(m).Traversable(anyTraversable)
there was one(m).Traversable(anyTraversableOf[Int])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ trait CalledMatchers extends NumberOfTimes with FunctionArguments with TheMockit
def inOrder(stubbed: IgnoreStubs): Option[InOrder] = inOrder(stubbed.mocks:_*)

/** no calls made to the mock */
def noCallsTo[T <: AnyRef](mocks: T*) = mocker.verifyZeroInteractions(mocks:_*)
def noCallsTo[T <: AnyRef](mocks: T*) = mocker.verifyNoMoreInteractions(mocks:_*)
/** no call made to the mock */
def no[T <: AnyRef](mock: T)(implicit anOrder: Option[InOrder] = inOrder()): T = verify(mock, org.mockito.Mockito.never())(anOrder)
/** one call only made to the mock */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,12 @@ trait MockitoMatchers extends ArgThat {
def anyDouble = ArgumentMatchers.anyDouble
def anyFloat = ArgumentMatchers.anyFloat

def anyVarArg[T] = ArgumentMatchers.anyVararg[T]()
def anyVarArg[T] = ArgumentMatchers.any[T]()
def anyJavaList = ArgumentMatchers.anyList
def anyJavaSet = ArgumentMatchers.anySet
def anyJavaCollection = ArgumentMatchers.anyCollection()
def anyJavaMap = ArgumentMatchers.anyMap()

def anyJavaListOf[T : ClassTag] = ArgumentMatchers.anyListOf(implicitly[ClassTag[T]].runtimeClass)
def anyJavaSetOf[T : ClassTag] = ArgumentMatchers.anySetOf(implicitly[ClassTag[T]].runtimeClass)
def anyJavaCollectionOf[T : ClassTag] = ArgumentMatchers.anyCollectionOf(implicitly[ClassTag[T]].runtimeClass)
def anyJavaMapOf[K : ClassTag, V : ClassTag] = ArgumentMatchers.anyMapOf(implicitly[ClassTag[K]].runtimeClass, implicitly[ClassTag[V]].runtimeClass)

def anyList = ArgumentMatchers.any(classOf[List[_]])
def anySet = ArgumentMatchers.any(classOf[Set[_]])
def anyTraversable = ArgumentMatchers.any(classOf[Traversable[_]])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,12 @@ import scala.reflect.ClassTag
*/
trait MockitoMocker {
def verify(mode: VerificationMode) = org.mockito.Mockito.verify(org.mockito.Mockito.mock(classOf[List[Int]]), mode)
def verifyZeroInteractions[T <: AnyRef](mocks: T*) = org.mockito.Mockito.verifyZeroInteractions(mocks:_*)
def verifyNoMoreInteractions[T <: AnyRef](mocks: T*) = org.mockito.Mockito.verifyNoMoreInteractions(mocks:_*)

def mock[T : ClassTag]: T = org.mockito.Mockito.mock(implicitly[ClassTag[T]].runtimeClass).asInstanceOf[T]
def mock[T : ClassTag](settings: MockSettings): T = org.mockito.Mockito.mock(implicitly[ClassTag[T]].runtimeClass, settings).asInstanceOf[T]

def spy[T](m: T): T = org.mockito.Mockito.spy(m)
def spy[T](m: T): T = org.mockito.Mockito.spy[T](m)
def when[V](v: V) = org.mockito.Mockito.when(v)
def times(i: Int): org.mockito.internal.verification.Times = org.mockito.Mockito.times(i).asInstanceOf[org.mockito.internal.verification.Times]
def any[T](implicit m: ClassTag[T]): T = org.mockito.ArgumentMatchers.any(m.runtimeClass).asInstanceOf[T]
Expand Down
2 changes: 1 addition & 1 deletion project/depends.scala
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ object depends {

def scalaXml = "org.scala-lang.modules" %% "scala-xml" % "2.1.0"

lazy val mockito = "org.mockito" % "mockito-core" % "3.11.2"
lazy val mockito = "org.mockito" % "mockito-core" % "4.11.0"
lazy val junit = "junit" % "junit" % "4.13.2"
lazy val hamcrest = "org.hamcrest" % "hamcrest" % "2.2"

Expand Down
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
val scalaJSVersion =
Option(System.getenv("SCALAJS_VERSION")).getOrElse("1.7.1")
Option(System.getenv("SCALAJS_VERSION")).getOrElse("1.13.0")
val scalaNativeVersion =
Option(System.getenv("SCALANATIVE_VERSION")).getOrElse("0.4.3")

Expand Down
2 changes: 1 addition & 1 deletion version.sbt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
ThisBuild / version := "4.19.2"
ThisBuild / version := "4.20.0"
ThisBuild / versionScheme := Some("semver-spec")

0 comments on commit e78c36e

Please sign in to comment.