Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import javax.servlet.http.HttpServletRequest
import scala.concurrent.{ExecutionContext, Future}

import org.mockito.ArgumentCaptor
import org.mockito.Matchers.{eq => meq, _}
import org.mockito.ArgumentMatchers.{eq => meq, _}
import org.mockito.Mockito._
import org.scalatest.BeforeAndAfterAll
import org.scalatest.funspec.AnyFunSpecLike
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
and metrics-healthchecks on 3.1.0 causes a NoClassDefFoundError for
HealthCheckFilter at runtime (the class moved in Dropwizard 4.x). -->
<metrics.version>4.2.19</metrics.version>
<mockito.version>1.10.19</mockito.version>
<mockito.version>3.4.6</mockito.version>
<!-- Spark 4.1.2 depends on Netty 4.2.7 and calls the new 4.2-only
`KQueueIoHandler`; pinning to a 4.1.x line here would let Livy's
`netty-all` win and hide that class from Spark's classpath. -->
Expand Down Expand Up @@ -265,7 +265,7 @@

<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<artifactId>mockito-core</artifactId>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import scala.concurrent.ExecutionContext.Implicits.global
import scala.language.postfixOps
import scala.util.{Failure, Success}

import org.mockito.Matchers._
import org.mockito.ArgumentMatchers._
import org.mockito.Mockito._
import org.scalatest.BeforeAndAfter
import org.scalatest.concurrent.ScalaFutures
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import java.util.concurrent.TimeUnit

import scala.concurrent.duration.Duration

import org.mockito.Matchers
import org.mockito.Matchers.anyObject
import org.mockito.ArgumentMatchers
import org.mockito.ArgumentMatchers.any
import org.mockito.Mockito._
import org.scalatest.BeforeAndAfter
import org.scalatest.funspec.AnyFunSpec
Expand Down Expand Up @@ -112,7 +112,7 @@ class BatchSessionSpec
val expectedAppId = "APPID"
batch.appIdKnown(expectedAppId)
verify(sessionStore, atLeastOnce()).save(
Matchers.eq(BatchSession.RECOVERY_SESSION_TYPE), anyObject())
ArgumentMatchers.eq(BatchSession.RECOVERY_SESSION_TYPE), any())
batch.appId shouldEqual Some(expectedAppId)

val expectedAppInfo = AppInfo(Some("DRIVER LOG URL"), Some("SPARK UI URL"))
Expand Down Expand Up @@ -207,7 +207,7 @@ class BatchSessionSpec

batch.appIdKnown("appId")
verify(sessionStore, atLeastOnce()).save(
Matchers.eq(BatchSession.RECOVERY_SESSION_TYPE), anyObject())
ArgumentMatchers.eq(BatchSession.RECOVERY_SESSION_TYPE), any())
}

Seq[Option[String]](None, Some("Test Batch Session"), null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import scala.concurrent.Future
import scala.language.postfixOps

import org.json4s.jackson.Json4sScalaModule
import org.mockito.Matchers._
import org.mockito.ArgumentMatchers._
import org.mockito.Mockito.when
import org.mockito.invocation.InvocationOnMock
import org.mockito.stubbing.Answer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ import scala.language.postfixOps
import org.apache.spark.launcher.SparkLauncher
import org.json4s.{DefaultFormats, Extraction, JValue}
import org.json4s.jackson.JsonMethods.parse
import org.mockito.{Matchers => MockitoMatchers}
import org.mockito.Matchers._
import org.mockito.{ArgumentMatchers => MockitoMatchers}
import org.mockito.ArgumentMatchers._
import org.mockito.Mockito.{atLeastOnce, verify, when}
import org.scalatest.BeforeAndAfterAll
import org.scalatest.concurrent.Eventually._
Expand Down Expand Up @@ -178,7 +178,7 @@ class InteractiveSessionSpec extends AnyFunSpec
session.appInfo shouldEqual expectedAppInfo

verify(sessionStore, atLeastOnce()).save(
MockitoMatchers.eq(InteractiveSession.RECOVERY_SESSION_TYPE), anyObject())
MockitoMatchers.eq(InteractiveSession.RECOVERY_SESSION_TYPE), any())

session.state should (be(SessionState.Starting) or be(SessionState.Idle))
}
Expand Down Expand Up @@ -299,7 +299,7 @@ class InteractiveSessionSpec extends AnyFunSpec

s.appIdKnown("appId")
verify(sessionStore, atLeastOnce()).save(
MockitoMatchers.eq(InteractiveSession.RECOVERY_SESSION_TYPE), anyObject())
MockitoMatchers.eq(InteractiveSession.RECOVERY_SESSION_TYPE), any())
}

it("should recover sessions with no name") {
Expand All @@ -318,7 +318,7 @@ class InteractiveSessionSpec extends AnyFunSpec

s.appIdKnown("appId")
verify(sessionStore, atLeastOnce()).save(
MockitoMatchers.eq(InteractiveSession.RECOVERY_SESSION_TYPE), anyObject())
MockitoMatchers.eq(InteractiveSession.RECOVERY_SESSION_TYPE), any())
}

it("should recover session to dead state if rscDriverUri is unknown") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,9 @@ import org.apache.hadoop.fs._
import org.apache.hadoop.fs.Options.{CreateOpts, Rename}
import org.apache.hadoop.fs.permission.FsPermission
import org.apache.hadoop.hdfs.DistributedFileSystem
import org.hamcrest.Description
import org.mockito.ArgumentMatcher
import org.mockito.Matchers.{any, anyInt, argThat, eq => equal}
import org.mockito.ArgumentMatchers.{any, anyInt, argThat, eq => equal}
import org.mockito.Mockito.{atLeastOnce, spy, verify, when}
import org.mockito.internal.matchers.Equals
import org.mockito.invocation.InvocationOnMock
import org.mockito.stubbing.Answer
import org.scalatest.funspec.AnyFunSpec
Expand All @@ -40,11 +38,7 @@ import org.apache.livy.{LivyBaseUnitTestSuite, LivyConf}
class FileSystemStateStoreSpec extends AnyFunSpec with LivyBaseUnitTestSuite {
describe("FileSystemStateStore") {
def pathEq(wantedPath: String): Path = argThat(new ArgumentMatcher[Path] {
private val matcher = new Equals(wantedPath)

override def matches(path: Any): Boolean = matcher.matches(path.toString)

override def describeTo(d: Description): Unit = { matcher.describeTo(d) }
override def matches(path: Path): Boolean = path.toString == wantedPath
})

def makeConf(): LivyConf = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import org.apache.hadoop.yarn.client.api.YarnClient
import org.apache.hadoop.yarn.exceptions.ApplicationAttemptNotFoundException
import org.apache.hadoop.yarn.util.ConverterUtils
import org.mockito.ArgumentCaptor
import org.mockito.Matchers.any
import org.mockito.ArgumentMatchers.any
import org.mockito.Mockito._
import org.mockito.invocation.InvocationOnMock
import org.mockito.stubbing.Answer
Expand Down
Loading