Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
Upgrade mockito to 2.10 (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnlcox committed Oct 12, 2017
1 parent d324b07 commit f50acac
Show file tree
Hide file tree
Showing 28 changed files with 42 additions and 41 deletions.
2 changes: 1 addition & 1 deletion avro/jackson/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<!--Test Dependencies-->
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<artifactId>mockito-core</artifactId>
</dependency>
<dependency>
<groupId>org.scala-lang</groupId>
Expand Down
2 changes: 1 addition & 1 deletion client/beadledom-client-guice/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<!--Test Dependencies-->
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<artifactId>mockito-core</artifactId>
</dependency>
</dependencies>
</project>
2 changes: 1 addition & 1 deletion client/beadledom-client-jackson/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<artifactId>mockito-core</artifactId>
</dependency>
</dependencies>
</project>
2 changes: 1 addition & 1 deletion client/beadledom-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<!--Test Dependencies-->
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<artifactId>mockito-core</artifactId>
</dependency>
</dependencies>
</project>
2 changes: 1 addition & 1 deletion client/beadledom-jaxrs-clientproxy/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<!-- Test Dependencies -->
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<artifactId>mockito-core</artifactId>
</dependency>
</dependencies>
</project>
2 changes: 1 addition & 1 deletion client/resteasy-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<artifactId>mockito-core</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
Expand Down
2 changes: 1 addition & 1 deletion common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<!--Test Dependencies-->
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<artifactId>mockito-core</artifactId>
</dependency>
<dependency>
<groupId>org.scala-lang</groupId>
Expand Down
2 changes: 1 addition & 1 deletion configuration/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<artifactId>mockito-core</artifactId>
</dependency>
<dependency>
<groupId>org.scalatest</groupId>
Expand Down
4 changes: 2 additions & 2 deletions google_checks_1.8.xml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
value="Parameter name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="CatchParameterName">
<property name="format" value="(^e$)|(^[]a-z][a-z0-9][a-zA-Z0-9]*$)"/>
<property name="format" value="(^e$)|(^t$)|(^[]a-z][a-z0-9][a-zA-Z0-9]*$)"/>
<message key="name.invalidPattern"
value="Catch parameter name ''{0}'' must match pattern ''{1}''."/>
</module>
Expand Down Expand Up @@ -201,7 +201,7 @@
<property name="allowMissingThrowsTags" value="true"/>
<property name="allowMissingReturnTag" value="true"/>
<property name="minLineCount" value="2"/>
<property name="allowedAnnotations" value="Override, Test, GET, POST, PUT, DELETE, HEAD"/>
<property name="allowedAnnotations" value="Override, Test, GET, POST, PUT, PATCH, DELETE, HEAD"/>
<property name="allowThrowsTagsForSubclasses" value="true"/>
<property name="suppressLoadErrors" value="true"/>
</module>
Expand Down
2 changes: 1 addition & 1 deletion health/api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<!-- Test Dependencies -->
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<artifactId>mockito-core</artifactId>
</dependency>
</dependencies>

Expand Down
2 changes: 1 addition & 1 deletion health/service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<artifactId>mockito-core</artifactId>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import com.github.mustachejava.DefaultMustacheFactory
import com.google.inject.{AbstractModule, Guice}
import java.net.URI
import javax.ws.rs.core.{UriBuilder, UriInfo}
import org.mockito.Matchers.any
import org.mockito.ArgumentMatchers.any
import org.mockito.Mockito.when
import org.scalatest._
import org.scalatest.mock.MockitoSugar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import com.github.mustachejava.DefaultMustacheFactory
import com.google.inject.{AbstractModule, Guice}
import java.net.URI
import javax.ws.rs.core.{UriBuilder, UriInfo}
import org.mockito.Matchers._
import org.mockito.ArgumentMatchers._
import org.mockito.Mockito._
import org.scalatest._
import org.scalatest.mock.MockitoSugar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import com.github.mustachejava.DefaultMustacheFactory
import com.google.inject.{AbstractModule, Guice}
import java.net.URI
import javax.ws.rs.core.{UriBuilder, UriInfo}
import org.mockito.Matchers._
import org.mockito.ArgumentMatchers._
import org.mockito.Mockito._
import org.scalatest._
import org.scalatest.mock.MockitoSugar
Expand Down
2 changes: 1 addition & 1 deletion jackson/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<artifactId>mockito-core</artifactId>
</dependency>
</dependencies>

Expand Down
2 changes: 1 addition & 1 deletion jaxrs-genericresponse/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<artifactId>mockito-core</artifactId>
</dependency>
<dependency>
<groupId>org.scalacheck</groupId>
Expand Down
2 changes: 1 addition & 1 deletion jaxrs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<artifactId>mockito-core</artifactId>
</dependency>
<dependency>
<groupId>org.scala-lang</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ trait CorrelationIdFilterBehaviors extends BeforeAndAfter with ShouldMatchers {

val captor = ArgumentCaptor.forClass(classOf[String])
Mockito.verify(request)
.setProperty(mockito.Matchers.eq(mdcName), captor.capture())
.setProperty(mockito.ArgumentMatchers.eq(mdcName), captor.capture())
MDC.get(mdcName) should be(captor.getValue)
}

Expand Down Expand Up @@ -67,8 +67,8 @@ trait CorrelationIdFilterBehaviors extends BeforeAndAfter with ShouldMatchers {
filter.filter(request, response)

MDC.get(mdcName) should be(null)
Mockito.verify(headers).add(mockito.Matchers.eq(headerName),
mockito.Matchers.anyString())
Mockito.verify(headers).add(mockito.ArgumentMatchers.eq(headerName),
mockito.ArgumentMatchers.anyString())
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class FilteringJacksonJsonProviderSpec
val json = objectMapper.writeValueAsString(fakeModel)
val captor = ArgumentCaptor.forClass(classOf[Array[Byte]])
Mockito.verify(output)
.write(captor.capture(), mockito.Matchers.anyInt(), mockito.Matchers.anyInt())
.write(captor.capture(), mockito.ArgumentMatchers.anyInt(), mockito.ArgumentMatchers.anyInt())
json should be === objectMapper.readTree(captor.getValue).toString
}

Expand All @@ -73,7 +73,7 @@ class FilteringJacksonJsonProviderSpec
val json = """{"id":"id1","name":"name1","times":1}"""
val captor = ArgumentCaptor.forClass(classOf[Array[Byte]])
Mockito.verify(output)
.write(captor.capture(), mockito.Matchers.anyInt(), mockito.Matchers.anyInt())
.write(captor.capture(), mockito.ArgumentMatchers.anyInt(), mockito.ArgumentMatchers.anyInt())
json should be === objectMapper.readTree(captor.getValue).toString
}

Expand Down
2 changes: 1 addition & 1 deletion lifecycle-governator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<artifactId>mockito-core</artifactId>
</dependency>
</dependencies>

Expand Down
2 changes: 1 addition & 1 deletion lifecycle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<artifactId>mockito-core</artifactId>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@ import com.google.inject.spi.ProvisionListener.ProvisionInvocation
import com.google.inject.{Binding, Key}
import javax.annotation.{PostConstruct, PreDestroy}
import org.hamcrest.Matchers.contains
import org.mockito.{Matchers, Mockito}
import org.mockito.Mockito
import org.mockito.hamcrest.MockitoHamcrest
import org.scalatest.mock.MockitoSugar
import org.scalatest.{FunSpec, MustMatchers}
import scala.reflect.Manifest

/**
* Unit tests for [[LifecycleProvisionListener]].
*
* @author John Leacox
*/
* Unit tests for [[LifecycleProvisionListener]].
*
* @author John Leacox
*/
class LifecycleProvisionListenerSpec extends FunSpec with MustMatchers with MockitoSugar {
describe("LifecycleProvisionListener") {
describe("#onProvision") {
Expand All @@ -32,7 +33,7 @@ class LifecycleProvisionListenerSpec extends FunSpec with MustMatchers with Mock
it("executes PostConstruct methods on the parent class of injectee") {
val shutdownManager = mock[LifecycleShutdownManager]
val provisionListener = new LifecycleProvisionListener()
LifecycleProvisionListener.init(shutdownManager, provisionListener)
LifecycleProvisionListener.init(shutdownManager, provisionListener)

val injectee = new TestPostConstructWithParent
val provision = createMockProvision(injectee, classOf[TestPostConstructWithParent])
Expand All @@ -44,7 +45,7 @@ class LifecycleProvisionListenerSpec extends FunSpec with MustMatchers with Mock
it("adds PreDestroy methods to the shutdown manager") {
val shutdownManager = mock[LifecycleShutdownManager]
val provisionListener = new LifecycleProvisionListener()
LifecycleProvisionListener.init(shutdownManager, provisionListener)
LifecycleProvisionListener.init(shutdownManager, provisionListener)

val injectee = new TestPreDestroy
val provision = createMockProvision(injectee, classOf[TestPreDestroy])
Expand All @@ -54,7 +55,7 @@ class LifecycleProvisionListenerSpec extends FunSpec with MustMatchers with Mock
classOf[TestPreDestroy].getDeclaredMethod("shutdown"), classOf[PreDestroy])

Mockito.verify(shutdownManager).addPreDestroyMethods(
Matchers.argThat(contains(invokableShutdownMethod))
MockitoHamcrest.argThat(contains(invokableShutdownMethod))
.asInstanceOf[java.util.List[InvokableLifecycleMethod]])
}
}
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -459,8 +459,8 @@
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.10.19</version>
<artifactId>mockito-core</artifactId>
<version>2.10.0</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -875,7 +875,7 @@
<version>${maven-project-info-reports-plugin-version}</version>
<reportSets>
<reportSet>
<reports />
<reports/>
</reportSet>
</reportSets>
<configuration>
Expand Down
2 changes: 1 addition & 1 deletion resteasy-genericresponse/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<artifactId>mockito-core</artifactId>
</dependency>
<dependency>
<groupId>org.scalacheck</groupId>
Expand Down
2 changes: 1 addition & 1 deletion resteasy/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<artifactId>mockito-core</artifactId>
</dependency>
<dependency>
<groupId>org.scala-lang</groupId>
Expand Down
2 changes: 1 addition & 1 deletion stagemonitor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<artifactId>mockito-core</artifactId>
</dependency>
<dependency>
<groupId>org.scala-lang</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import com.cerner.beadledom.stagemonitor.JsonRequestTraceLoggerPlugin
import com.fasterxml.jackson.core.JsonProcessingException
import com.fasterxml.jackson.databind.ObjectMapper
import org.mockito.ArgumentCaptor
import org.mockito.Matchers.any
import org.mockito.ArgumentMatchers.any
import org.mockito.Mockito.{never, verify, when}
import org.scalatest._
import org.scalatest.mock.MockitoSugar
Expand Down
2 changes: 1 addition & 1 deletion swagger/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<artifactId>mockito-core</artifactId>
</dependency>
<dependency>
<groupId>org.scala-lang</groupId>
Expand Down

0 comments on commit f50acac

Please sign in to comment.