This is an automated email from the ASF dual-hosted git repository.

rlevas pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
     new d42c139  [AMBARI-23461] Fix TestHeartbeatHandler.testComponents NPE
d42c139 is described below

commit d42c1391f13049e78fa9e64c9693551ec1c2cc66
Author: Robert Levas <[email protected]>
AuthorDate: Wed Apr 4 11:21:53 2018 -0400

    [AMBARI-23461] Fix TestHeartbeatHandler.testComponents NPE
---
 .../org/apache/ambari/server/agent/TestHeartbeatHandler.java   | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/agent/TestHeartbeatHandler.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/agent/TestHeartbeatHandler.java
index 7fa73fa..41e0c43 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/agent/TestHeartbeatHandler.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/agent/TestHeartbeatHandler.java
@@ -38,6 +38,7 @@ import static org.easymock.EasyMock.replay;
 import static org.easymock.EasyMock.reset;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
@@ -1341,12 +1342,15 @@ public class TestHeartbeatHandler {
 
     expect(service.getServiceComponents()).andReturn(componentMap);
 
-    replay(service, nnComponent);
+    ActionManager am = actionManagerTestHelper.getMockActionManager();
+
+    replay(service, nnComponent, am);
 
     cluster.addService(service);
 
-    HeartBeatHandler handler = heartbeatTestHelper.getHeartBeatHandler(
-        actionManagerTestHelper.getMockActionManager());
+    HeartBeatHandler handler = heartbeatTestHelper.getHeartBeatHandler(am);
+    // Make sure handler is not null, this has possibly been an intermittent 
problem in the past
+    assertNotNull(handler);
 
     ComponentsResponse actual = handler.handleComponents(DummyCluster);
 

-- 
To stop receiving notification emails like this one, please contact
[email protected].

Reply via email to