You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by yu...@apache.org on 2017/01/30 19:26:48 UTC

ambari git commit: AMBARI-19741. Ambari Server Unit Test failure on branch-2.5/trunk for testUpdateConfigForceSecurityEnabled. (Eugene Chekanskiy via yusaku)

Repository: ambari
Updated Branches:
  refs/heads/trunk 93d4ffeda -> 8d56db0ef


AMBARI-19741. Ambari Server Unit Test failure on branch-2.5/trunk for testUpdateConfigForceSecurityEnabled. (Eugene Chekanskiy via yusaku)


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

Branch: refs/heads/trunk
Commit: 8d56db0efb9ea3bcb4cff968699c48065ddf1193
Parents: 93d4ffe
Author: Yusaku Sako <yu...@hortonworks.com>
Authored: Mon Jan 30 11:26:17 2017 -0800
Committer: Yusaku Sako <yu...@hortonworks.com>
Committed: Mon Jan 30 11:26:17 2017 -0800

----------------------------------------------------------------------
 .../UpdateKerberosConfigsServerActionTest.java    | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/8d56db0e/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/UpdateKerberosConfigsServerActionTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/UpdateKerberosConfigsServerActionTest.java b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/UpdateKerberosConfigsServerActionTest.java
index e756491..0442add 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/UpdateKerberosConfigsServerActionTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/UpdateKerberosConfigsServerActionTest.java
@@ -22,7 +22,7 @@ import static org.easymock.EasyMock.anyObject;
 import static org.easymock.EasyMock.capture;
 import static org.easymock.EasyMock.expect;
 import static org.easymock.EasyMock.expectLastCall;
-import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 
 import java.io.File;
 import java.util.Collection;
@@ -37,6 +37,7 @@ import org.apache.ambari.server.state.Clusters;
 import org.apache.ambari.server.state.ConfigHelper;
 import org.apache.ambari.server.state.stack.OsFamily;
 import org.easymock.Capture;
+import org.easymock.CaptureType;
 import org.easymock.EasyMock;
 import org.easymock.EasyMockSupport;
 import org.junit.Before;
@@ -154,8 +155,8 @@ public class UpdateKerberosConfigsServerActionTest extends EasyMockSupport{
 
     ConfigHelper configHelper = injector.getInstance(ConfigHelper.class);
 
-    Capture<String> configTypes = Capture.newInstance();
-    Capture<Map<String, String>> configUpdates = Capture.newInstance();
+    Capture<String> configTypes = Capture.newInstance(CaptureType.ALL);
+    Capture<Map<String, String>> configUpdates = Capture.newInstance(CaptureType.ALL);
     configHelper.updateConfigType(anyObject(Cluster.class), anyObject(AmbariManagementController.class),
         capture(configTypes), capture(configUpdates), anyObject(Collection.class), anyObject(String.class), anyObject(String.class));
     expectLastCall().atLeastOnce();
@@ -165,8 +166,15 @@ public class UpdateKerberosConfigsServerActionTest extends EasyMockSupport{
     action.setExecutionCommand(executionCommand);
     action.execute(null);
 
-    assertEquals(configTypes.getValue(), "cluster-env");
-    assertEquals(configUpdates.getValue().get("security_enabled"), "false");
+    assertTrue(configTypes.getValues().contains("cluster-env"));
+    boolean containsSecurityEnabled = false;
+    for(Map<String, String> properties: configUpdates.getValues()) {
+      if(properties.containsKey("security_enabled")) {
+        containsSecurityEnabled = true;
+        break;
+      }
+    }
+    assertTrue(containsSecurityEnabled);
     verifyAll();
   }