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

sarath pushed a commit to branch branch-1.0
in repository https://gitbox.apache.org/repos/asf/atlas.git


The following commit(s) were added to refs/heads/branch-1.0 by this push:
     new c4ce2b4  ATLAS-3067: fix for IT failure in 
EntityJerseyResourceIT.testCompleteUpdate()
c4ce2b4 is described below

commit c4ce2b4c06e9ae5aae62161828658ce4df6561f8
Author: Sarath Subramanian <ssubraman...@hortonworks.com>
AuthorDate: Wed Mar 20 14:16:04 2019 -0700

    ATLAS-3067: fix for IT failure in 
EntityJerseyResourceIT.testCompleteUpdate()
    
    (cherry picked from commit 2c0a8bcc1afe1588a1ffc3ea175bb29055c55894)
---
 .../web/integration/EntityJerseyResourceIT.java    | 25 +++++++++++++++++++---
 1 file changed, 22 insertions(+), 3 deletions(-)

diff --git 
a/webapp/src/test/java/org/apache/atlas/web/integration/EntityJerseyResourceIT.java
 
b/webapp/src/test/java/org/apache/atlas/web/integration/EntityJerseyResourceIT.java
index 15a06e3..edb4568 100755
--- 
a/webapp/src/test/java/org/apache/atlas/web/integration/EntityJerseyResourceIT.java
+++ 
b/webapp/src/test/java/org/apache/atlas/web/integration/EntityJerseyResourceIT.java
@@ -35,6 +35,7 @@ import org.apache.atlas.type.AtlasType;
 import org.apache.atlas.v1.typesystem.types.utils.TypesUtil;
 import org.apache.atlas.utils.AuthenticationUtil;
 import org.apache.commons.lang.RandomStringUtils;
+import org.apache.commons.lang.StringUtils;
 import org.joda.time.DateTime;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -998,8 +999,11 @@ public class EntityJerseyResourceIT extends BaseResourceIT 
{
         List<Referenceable> refs = (List<Referenceable>) 
hiveTableInstance.get("columns");
         Assert.assertEquals(refs.size(), 2);
 
-        Assert.assertEquals(refs.get(0).getValuesMap(), values1);
-        Assert.assertEquals(refs.get(1).getValuesMap(), values2);
+        Referenceable col3 = getReferenceable(refs, "col3");
+        Referenceable col4 = getReferenceable(refs, "col4");
+
+        Assert.assertEquals(col3.getValuesMap(), values1);
+        Assert.assertEquals(col4.getValuesMap(), values2);
     }
 
     @Test
@@ -1117,4 +1121,19 @@ public class EntityJerseyResourceIT extends 
BaseResourceIT {
         }
     }
 
-}
+    private Referenceable getReferenceable(List<Referenceable> refs, String 
name) {
+        Referenceable ret = null;
+
+        for (Referenceable ref : refs) {
+            Map<String, Object> values     = ref.getValuesMap();
+            String              entityName = (String) values.get("name");
+
+            if (StringUtils.equalsIgnoreCase(name, entityName)) {
+                ret = ref;
+                break;
+            }
+        }
+
+        return ret;
+    }
+}
\ No newline at end of file

Reply via email to