kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ewe...@apache.org
Subject kafka git commit: MINOR: Update Powermock to fix PushHttpMetricsReporterTest failures
Date Tue, 21 Nov 2017 22:50:33 GMT
Repository: kafka
Updated Branches:
  refs/heads/0.11.0 686c02cf3 -> 8ea4a2826


MINOR: Update Powermock to fix PushHttpMetricsReporterTest failures

Fixes test failures where old versions of Powermock don't handle nested classes accessing
parent field members when using mockStatic.

Author: Ewen Cheslack-Postava <me@ewencp.org>

Reviewers: Ismael Juma <ismael@juma.me.uk>

Closes #4243 from ewencp/powermock-update


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/8ea4a282
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/8ea4a282
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/8ea4a282

Branch: refs/heads/0.11.0
Commit: 8ea4a2826c5009d2fa0d88cdff445138ce3fa96b
Parents: 686c02c
Author: Ewen Cheslack-Postava <me@ewencp.org>
Authored: Tue Nov 21 14:50:24 2017 -0800
Committer: Ewen Cheslack-Postava <me@ewencp.org>
Committed: Tue Nov 21 14:50:24 2017 -0800

----------------------------------------------------------------------
 .../apache/kafka/connect/runtime/WorkerTest.java | 19 +++++++++++--------
 gradle/dependencies.gradle                       |  2 +-
 2 files changed, 12 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/8ea4a282/connect/runtime/src/test/java/org/apache/kafka/connect/runtime/WorkerTest.java
----------------------------------------------------------------------
diff --git a/connect/runtime/src/test/java/org/apache/kafka/connect/runtime/WorkerTest.java
b/connect/runtime/src/test/java/org/apache/kafka/connect/runtime/WorkerTest.java
index 7fad7c1..a807a30 100644
--- a/connect/runtime/src/test/java/org/apache/kafka/connect/runtime/WorkerTest.java
+++ b/connect/runtime/src/test/java/org/apache/kafka/connect/runtime/WorkerTest.java
@@ -43,11 +43,12 @@ import org.apache.kafka.connect.util.MockTime;
 import org.apache.kafka.connect.util.ThreadedTest;
 import org.easymock.Capture;
 import org.easymock.EasyMock;
-import org.easymock.Mock;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.powermock.api.easymock.PowerMock;
+import org.powermock.api.easymock.annotation.Mock;
+import org.powermock.api.easymock.annotation.MockStrict;
 import org.powermock.core.classloader.annotations.PowerMockIgnore;
 import org.powermock.core.classloader.annotations.PrepareForTest;
 import org.powermock.modules.junit4.PowerMockRunner;
@@ -76,15 +77,17 @@ public class WorkerTest extends ThreadedTest {
     private Worker worker;
 
     @Mock
-    private Plugins plugins = PowerMock.createMock(Plugins.class);
+    private Plugins plugins;
     @Mock
-    private PluginClassLoader pluginLoader = PowerMock.createMock(PluginClassLoader.class);
+    private PluginClassLoader pluginLoader;
     @Mock
-    private DelegatingClassLoader delegatingLoader =
-            PowerMock.createMock(DelegatingClassLoader.class);
-    private OffsetBackingStore offsetBackingStore = PowerMock.createMock(OffsetBackingStore.class);
-    private TaskStatus.Listener taskStatusListener = PowerMock.createStrictMock(TaskStatus.Listener.class);
-    private ConnectorStatus.Listener connectorStatusListener = PowerMock.createStrictMock(ConnectorStatus.Listener.class);
+    private DelegatingClassLoader delegatingLoader;
+    @Mock
+    private OffsetBackingStore offsetBackingStore;
+    @MockStrict
+    private TaskStatus.Listener taskStatusListener;
+    @MockStrict
+    private ConnectorStatus.Listener connectorStatusListener;
 
     @Before
     public void setup() {

http://git-wip-us.apache.org/repos/asf/kafka/blob/8ea4a282/gradle/dependencies.gradle
----------------------------------------------------------------------
diff --git a/gradle/dependencies.gradle b/gradle/dependencies.gradle
index 862ebcb..5d145e1 100644
--- a/gradle/dependencies.gradle
+++ b/gradle/dependencies.gradle
@@ -60,7 +60,7 @@ versions += [
   junit: "4.12",
   lz4: "1.3.0",
   metrics: "2.2.0",
-  powermock: "1.6.4",
+  powermock: "2.0.0-beta.5",
   reflections: "0.9.11",
   rocksDB: "5.0.1",
   scalaTest: "3.0.2",


Mime
View raw message