diff --git a/.scalafmt.conf b/.scalafmt.conf index 4e59958e..db2dff8b 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -6,7 +6,6 @@ maxColumn = 180 rewrite.rules = [RedundantBraces, RedundantParens, SortImports] spaces.inImportCurlyBraces = true indentOperator.preset = spray -unindentTopLevelOperators = true -version=3.3.3 +version=3.5.8 diff --git a/cats/src/main/scala/org/mockito/cats/EqToEquality.scala b/cats/src/main/scala/org/mockito/cats/EqToEquality.scala index f8ced1d6..5477241b 100644 --- a/cats/src/main/scala/org/mockito/cats/EqToEquality.scala +++ b/cats/src/main/scala/org/mockito/cats/EqToEquality.scala @@ -8,8 +8,8 @@ class EqToEquality[T: Eq] extends Equality[T] { override def areEqual(a: T, b: Any): Boolean = (a == null && b == null) || ( a != null && - b != null && - b.getClass == a.getClass && - a === b.asInstanceOf[T] + b != null && + b.getClass == a.getClass && + a === b.asInstanceOf[T] ) } diff --git a/macro/src/main/scala/org/mockito/VerifyMacro.scala b/macro/src/main/scala/org/mockito/VerifyMacro.scala index 274030b8..4d4e508a 100644 --- a/macro/src/main/scala/org/mockito/VerifyMacro.scala +++ b/macro/src/main/scala/org/mockito/VerifyMacro.scala @@ -106,17 +106,17 @@ private[mockito] trait VerificationMacroTransformer { q""" if (_root_.org.mockito.MockitoSugar.mockingDetails($a).isMock) { ${called match { - case q"$_.calledAgain" => - val calledPattern = show(q"$a.$b") - q"""throw new _root_.org.mockito.exceptions.misusing.NotAMockException(Seq( + case q"$_.calledAgain" => + val calledPattern = show(q"$a.$b") + q"""throw new _root_.org.mockito.exceptions.misusing.NotAMockException(Seq( "[" + $calledPattern + "] is not a mock!", "Example of correct verification:", " myMock wasNever called", "" ).mkString("\n")) """ - case _ => transformInvocation(c)(q"$a.$b", order, q"_root_.org.mockito.VerifyMacro.Never") - }} + case _ => transformInvocation(c)(q"$a.$b", order, q"_root_.org.mockito.VerifyMacro.Never") + }} } else { ${transformMockWasNeverCalled(q"$a.$b", called)} } diff --git a/scalatest/src/test/scala/user/org/mockito/captor/ArgCaptorTest.scala b/scalatest/src/test/scala/user/org/mockito/captor/ArgCaptorTest.scala index f683437c..8cd38ded 100644 --- a/scalatest/src/test/scala/user/org/mockito/captor/ArgCaptorTest.scala +++ b/scalatest/src/test/scala/user/org/mockito/captor/ArgCaptorTest.scala @@ -151,7 +151,7 @@ class ArgCaptorTest extends AnyWordSpec with MockitoSugar with Matchers { error.getMessage should ( include("Got [it worked again!] instead of [it worked!]") and - include("Also expected 1 more: [it worked again!]") + include("Also expected 1 more: [it worked again!]") ) } @@ -172,7 +172,7 @@ class ArgCaptorTest extends AnyWordSpec with MockitoSugar with Matchers { error.getMessage should ( include("Got [it worked!] instead of [it worked again!]") and - include("Also got 1 more: [it worked again!]") + include("Also got 1 more: [it worked again!]") ) } } diff --git a/scalaz/src/main/scala/org/mockito/scalaz/EqToEquality.scala b/scalaz/src/main/scala/org/mockito/scalaz/EqToEquality.scala index d19d7333..ef3de8fb 100644 --- a/scalaz/src/main/scala/org/mockito/scalaz/EqToEquality.scala +++ b/scalaz/src/main/scala/org/mockito/scalaz/EqToEquality.scala @@ -8,8 +8,8 @@ class EqToEquality[T: Equal] extends Equality[T] { override def areEqual(a: T, b: Any): Boolean = (a == null && b == null) || ( a != null && - b != null && - b.getClass == a.getClass && - a === b.asInstanceOf[T] + b != null && + b.getClass == a.getClass && + a === b.asInstanceOf[T] ) } diff --git a/specs2/src/test/scala/org/mockito/specs2/MockitoScalaSpec.scala b/specs2/src/test/scala/org/mockito/specs2/MockitoScalaSpec.scala index 800d5c2c..490c2c93 100644 --- a/specs2/src/test/scala/org/mockito/specs2/MockitoScalaSpec.scala +++ b/specs2/src/test/scala/org/mockito/specs2/MockitoScalaSpec.scala @@ -527,7 +527,7 @@ The Mockito trait is reusable in other contexts implicit val order = inOrder(list1, list2) (there was one(list1).get(0) andThen - one(list2).get(0)).message must_== "The mock was called as expected" + one(list2).get(0)).message must_== "The mock was called as expected" } def order2 = { @@ -543,7 +543,7 @@ The Mockito trait is reusable in other contexts implicit val order = inOrder(ignoreStubs(list1, list2)) (there was one(list1).get(0) andThen - one(list2).get(0)).message must_== "The mock was called as expected" + one(list2).get(0)).message must_== "The mock was called as expected" } def order3 = { @@ -586,7 +586,7 @@ The Mockito trait is reusable in other contexts implicit val order = inOrder(list1, list2) (there was one(list2).get(0) andThen - one(list1).get(0)).message must startWith("The mock was not called as expected") + one(list1).get(0)).message must startWith("The mock was not called as expected") } def order6 = {