Skip to content

Commit

Permalink
GEM-3373: Configure Mockito to be compatible with JDK 17 (apache#132)
Browse files Browse the repository at this point in the history
Use the `mockito-inline` to configure Mockito to use a mock-maker that
works on JDK 17.
  • Loading branch information
demery-pivotal committed Jun 30, 2022
1 parent dce2393 commit ae6e75e
Show file tree
Hide file tree
Showing 25 changed files with 68 additions and 42 deletions.
3 changes: 2 additions & 1 deletion boms/geode-all-bom/src/test/resources/expected-pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<!-- Copyright (c) VMware, Inc. 2022. All rights reserved. -->
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
Expand Down Expand Up @@ -459,7 +460,7 @@
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<artifactId>mockito-inline</artifactId>
<version>4.6.1</version>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright (c) VMware, Inc. 2022. All rights reserved.
/*
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license
* agreements. See the NOTICE file distributed with this work for additional information regarding
Expand Down Expand Up @@ -174,7 +175,7 @@ class DependencyConstraints {
}

dependencySet(group: 'org.mockito', version: '4.6.1') {
entry('mockito-core')
entry('mockito-inline')
entry('mockito-junit-jupiter')
}

Expand Down
3 changes: 2 additions & 1 deletion extensions/geode-modules-tomcat7/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright (c) VMware, Inc. 2022. All rights reserved.
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
Expand Down Expand Up @@ -40,7 +41,7 @@ dependencies {
testImplementation(project(':extensions:geode-modules-test'))
testImplementation('junit:junit')
testImplementation('org.assertj:assertj-core')
testImplementation('org.mockito:mockito-core')
testImplementation('org.mockito:mockito-inline')
testImplementation('org.apache.tomcat:tomcat-catalina:' + DependencyConstraints.get('tomcat7.version'))
testImplementation('org.apache.tomcat:tomcat-coyote:' + DependencyConstraints.get('tomcat7.version'))

Expand Down
3 changes: 2 additions & 1 deletion extensions/geode-modules-tomcat8/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright (c) VMware, Inc. 2022. All rights reserved.
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
Expand Down Expand Up @@ -40,7 +41,7 @@ dependencies {
testImplementation(project(':extensions:geode-modules-test'))
testImplementation('junit:junit')
testImplementation('org.assertj:assertj-core')
testImplementation('org.mockito:mockito-core')
testImplementation('org.mockito:mockito-inline')
testImplementation('org.apache.tomcat:tomcat-catalina:' + DependencyConstraints.get('tomcat8.version'))


Expand Down
3 changes: 2 additions & 1 deletion extensions/geode-modules-tomcat9/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright (c) VMware, Inc. 2022. All rights reserved.
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
Expand Down Expand Up @@ -40,7 +41,7 @@ dependencies {
testImplementation(project(':extensions:geode-modules-test'))
testImplementation('junit:junit')
testImplementation('org.assertj:assertj-core')
testImplementation('org.mockito:mockito-core')
testImplementation('org.mockito:mockito-inline')
testImplementation('org.apache.tomcat:tomcat-catalina:' + DependencyConstraints.get('tomcat9.version'))


Expand Down
3 changes: 2 additions & 1 deletion extensions/geode-modules/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright (c) VMware, Inc. 2022. All rights reserved.
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
Expand Down Expand Up @@ -46,7 +47,7 @@ dependencies {
testImplementation('junit:junit')
testRuntimeOnly('org.junit.vintage:junit-vintage-engine')
testImplementation('org.assertj:assertj-core')
testImplementation('org.mockito:mockito-core')
testImplementation('org.mockito:mockito-inline')
testImplementation('org.apache.tomcat:tomcat-catalina-ha:' + DependencyConstraints.get('tomcat7.version'))


Expand Down
3 changes: 2 additions & 1 deletion geode-common/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright (c) VMware, Inc. 2022. All rights reserved.
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
Expand Down Expand Up @@ -43,7 +44,7 @@ dependencies {
testImplementation('junit:junit')
testImplementation('org.apache.commons:commons-lang3')
testImplementation('org.assertj:assertj-core')
testImplementation('org.mockito:mockito-core')
testImplementation('org.mockito:mockito-inline')
testRuntimeOnly('org.junit.vintage:junit-vintage-engine')
testRuntimeOnly('org.junit.jupiter:junit-jupiter-engine')

Expand Down
5 changes: 3 additions & 2 deletions geode-connectors/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright (c) VMware, Inc. 2022. All rights reserved.
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
Expand Down Expand Up @@ -102,7 +103,7 @@ dependencies {

distributedTestImplementation('junit:junit')
distributedTestImplementation('org.assertj:assertj-core')
distributedTestImplementation('org.mockito:mockito-core')
distributedTestImplementation('org.mockito:mockito-inline')
distributedTestImplementation('pl.pragmatists:JUnitParams')
distributedTestRuntimeOnly('org.apache.derby:derby')

Expand All @@ -112,7 +113,7 @@ dependencies {
acceptanceTestImplementation('junit:junit')
acceptanceTestImplementation('org.assertj:assertj-core')
acceptanceTestImplementation('org.awaitility:awaitility')
acceptanceTestImplementation('org.mockito:mockito-core')
acceptanceTestImplementation('org.mockito:mockito-inline')
acceptanceTestImplementation('pl.pragmatists:JUnitParams')
acceptanceTestImplementation('org.testcontainers:testcontainers')

Expand Down
4 changes: 3 additions & 1 deletion geode-core/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright (c) VMware, Inc. 2022. All rights reserved.
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
Expand Down Expand Up @@ -331,8 +332,8 @@ dependencies {
testImplementation(project(':geode-serialization'))
testImplementation('org.apache.bcel:bcel')
testImplementation('org.assertj:assertj-core')
testImplementation('org.mockito:mockito-core')
testImplementation('org.mockito:mockito-junit-jupiter')
testImplementation('org.mockito:mockito-inline')
testImplementation('com.pholser:junit-quickcheck-core')
testImplementation('pl.pragmatists:JUnitParams')
testImplementation('com.tngtech.archunit:archunit-junit4')
Expand All @@ -359,6 +360,7 @@ dependencies {
integrationTestImplementation(project(':geode-serialization'))
integrationTestImplementation('org.apache.bcel:bcel')
integrationTestImplementation('org.apache.logging.log4j:log4j-core')
integrationTestImplementation('org.mockito:mockito-inline')
integrationTestImplementation('pl.pragmatists:JUnitParams')
integrationTestImplementation('com.tngtech.archunit:archunit-junit4')
integrationTestImplementation('org.junit-pioneer:junit-pioneer')
Expand Down
3 changes: 2 additions & 1 deletion geode-cq/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright (c) VMware, Inc. 2022. All rights reserved.
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
Expand Down Expand Up @@ -57,7 +58,7 @@ dependencies {
upgradeTestImplementation(project(':geode-junit'))
upgradeTestImplementation('junit:junit')
upgradeTestImplementation('org.awaitility:awaitility')
upgradeTestImplementation('org.mockito:mockito-core')
upgradeTestImplementation('org.mockito:mockito-inline')

upgradeTestRuntimeOnly(project(path: ':geode-old-versions', configuration: 'classpathsOutput'))
}
Expand Down
3 changes: 2 additions & 1 deletion geode-dunit/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright (c) VMware, Inc. 2022. All rights reserved.
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
Expand Down Expand Up @@ -58,7 +59,7 @@ dependencies {
}

implementation('org.assertj:assertj-core')
implementation('org.mockito:mockito-core')
implementation('org.mockito:mockito-inline')
implementation('org.awaitility:awaitility')
implementation('pl.pragmatists:JUnitParams')

Expand Down
3 changes: 2 additions & 1 deletion geode-dunit/src/test/resources/expected-pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<!-- Copyright (c) VMware, Inc. 2022. All rights reserved. -->
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
Expand Down Expand Up @@ -187,7 +188,7 @@
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<artifactId>mockito-inline</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
Expand Down
3 changes: 2 additions & 1 deletion geode-jmh/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright (c) VMware, Inc. 2022. All rights reserved.
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
Expand Down Expand Up @@ -30,7 +31,7 @@ dependencies {
testImplementation('junit:junit')
testRuntimeOnly('org.junit.vintage:junit-vintage-engine')
testImplementation('org.assertj:assertj-core')
testImplementation('org.mockito:mockito-core')
testImplementation('org.mockito:mockito-inline')
}

jar {
Expand Down
3 changes: 2 additions & 1 deletion geode-junit/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright (c) VMware, Inc. 2022. All rights reserved.
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
Expand Down Expand Up @@ -42,7 +43,7 @@ dependencies {
api('org.junit.jupiter:junit-jupiter-api')
api('org.junit.jupiter:junit-jupiter-params')
api('org.assertj:assertj-core')
api('org.mockito:mockito-core')
api('org.mockito:mockito-inline')

api('io.github.classgraph:classgraph')
api('com.fasterxml.jackson.core:jackson-annotations')
Expand Down
29 changes: 15 additions & 14 deletions geode-junit/src/test/resources/expected-pom.xml
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<!-- Copyright (c) VMware, Inc. 2022. All rights reserved. -->
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<modelVersion>4.0.0</modelVersion>
<groupId>com.vmware.gemfire</groupId>
<artifactId>geode-junit</artifactId>
Expand Down Expand Up @@ -74,7 +75,7 @@
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<artifactId>mockito-inline</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
Expand Down
7 changes: 4 additions & 3 deletions geode-log4j/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright (c) VMware, Inc. 2022. All rights reserved.
/*
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license
* agreements. See the NOTICE file distributed with this work for additional information regarding
Expand Down Expand Up @@ -50,14 +51,14 @@ dependencies {
}
jmhImplementation('junit:junit')
jmhImplementation('org.assertj:assertj-core')
jmhImplementation('org.mockito:mockito-core')
jmhImplementation('org.mockito:mockito-inline')

testImplementation(project(':geode-junit')) {
exclude module: 'geode-core'
}
testImplementation('junit:junit')
testImplementation('org.assertj:assertj-core')
testImplementation('org.mockito:mockito-core')
testImplementation('org.mockito:mockito-inline')

integrationTestImplementation(project(':geode-junit')) {
exclude module: 'geode-core'
Expand All @@ -76,6 +77,6 @@ dependencies {
distributedTestImplementation('org.assertj:assertj-core')
distributedTestImplementation('org.awaitility:awaitility')
distributedTestImplementation('org.hamcrest:hamcrest')
distributedTestImplementation('org.mockito:mockito-core')
distributedTestImplementation('org.mockito:mockito-inline')
distributedTestImplementation('pl.pragmatists:JUnitParams')
}
3 changes: 2 additions & 1 deletion geode-logging/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright (c) VMware, Inc. 2022. All rights reserved.
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
Expand Down Expand Up @@ -34,7 +35,7 @@ dependencies {
}
testImplementation(project(':geode-concurrency-test'))

testImplementation('org.mockito:mockito-core')
testImplementation('org.mockito:mockito-inline')
testImplementation('junit:junit')
testImplementation('org.assertj:assertj-core')

Expand Down
3 changes: 2 additions & 1 deletion geode-lucene/geode-lucene-test/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright (c) VMware, Inc. 2022. All rights reserved.
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
Expand Down Expand Up @@ -32,5 +33,5 @@ dependencies {

implementation('junit:junit')
implementation('org.apache.lucene:lucene-test-framework')
implementation('org.mockito:mockito-core')
implementation('org.mockito:mockito-inline')
}
3 changes: 2 additions & 1 deletion geode-membership/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright (c) VMware, Inc. 2022. All rights reserved.
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
Expand Down Expand Up @@ -50,7 +51,7 @@ dependencies {
testImplementation(project(':geode-junit'))
testImplementation(project(':geode-concurrency-test'))

testImplementation('org.mockito:mockito-core')
testImplementation('org.mockito:mockito-inline')
testImplementation('junit:junit')
testImplementation('org.assertj:assertj-core')
testImplementation('com.tngtech.archunit:archunit-junit4')
Expand Down
3 changes: 2 additions & 1 deletion geode-memcached/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright (c) VMware, Inc. 2022. All rights reserved.
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
Expand Down Expand Up @@ -31,7 +32,7 @@ dependencies {

implementation('org.apache.logging.log4j:log4j-api')

testImplementation('org.mockito:mockito-core')
testImplementation('org.mockito:mockito-inline')
testImplementation(project(':geode-junit'))

integrationTestImplementation(project(':geode-membership'))
Expand Down
3 changes: 2 additions & 1 deletion geode-rebalancer/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright (c) VMware, Inc. 2022. All rights reserved.
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
Expand Down Expand Up @@ -40,7 +41,7 @@ dependencies {
testImplementation('junit:junit')
testImplementation('org.junit.vintage:junit-vintage-engine')
testImplementation('org.assertj:assertj-core')
testImplementation('org.mockito:mockito-core')
testImplementation('org.mockito:mockito-inline')

integrationTestImplementation('junit:junit')
integrationTestImplementation('org.awaitility:awaitility')
Expand Down
3 changes: 2 additions & 1 deletion geode-serialization/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright (c) VMware, Inc. 2022. All rights reserved.
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
Expand Down Expand Up @@ -47,7 +48,7 @@ dependencies {

testImplementation('com.tngtech.archunit:archunit-junit4')
testImplementation('org.apache.bcel:bcel')
testImplementation('org.mockito:mockito-core')
testImplementation('org.mockito:mockito-inline')
testImplementation('junit:junit')
testImplementation('org.assertj:assertj-core')

Expand Down
3 changes: 2 additions & 1 deletion geode-tcp-server/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright (c) VMware, Inc. 2022. All rights reserved.
/*
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license
* agreements. See the NOTICE file distributed with this work for additional information regarding
Expand Down Expand Up @@ -43,7 +44,7 @@ dependencies {
testImplementation('com.tngtech.archunit:archunit-junit4')

integrationTestImplementation('com.tngtech.archunit:archunit-junit4')
integrationTestImplementation('org.mockito:mockito-core')
integrationTestImplementation('org.mockito:mockito-inline')
integrationTestImplementation(project(':geode-junit'))

upgradeTestImplementation(project(':geode-gfsh'))
Expand Down
Loading

0 comments on commit ae6e75e

Please sign in to comment.