Commit 4eb8bf23 by Sarath Subramanian

ATLAS-1857: Fix for unit test failure in jenkins

parent e19495ad
...@@ -437,15 +437,6 @@ public class EntityDiscoveryService implements AtlasDiscoveryService { ...@@ -437,15 +437,6 @@ public class EntityDiscoveryService implements AtlasDiscoveryService {
AtlasEntityType type = typeRegistry.getEntityTypeByName(typeName); AtlasEntityType type = typeRegistry.getEntityTypeByName(typeName);
Set<String> typeAndSubTypes = type != null ? type.getTypeAndAllSubTypes() : null; Set<String> typeAndSubTypes = type != null ? type.getTypeAndAllSubTypes() : null;
// adding debug info to investigate unit test failure in jenkins
// EntityDiscoveryServiceTest.getSubTypeForTypeWithSubTypes_ReturnsOrClause
if (StringUtils.isNotEmpty(typeName) && type != null) {
LOG.info("Getting type and subTypes for type name: {}, AtlasType: {}", typeName, type.getEntityDef().toString());
LOG.info("Type and subTypes list: {}", StringUtils.join(typeAndSubTypes, " "));
LOG.info("Maximum Types Count: {}", maxTypesCountInIdxQuery);
}
if(CollectionUtils.isNotEmpty(typeAndSubTypes) && typeAndSubTypes.size() <= maxTypesCountInIdxQuery) { if(CollectionUtils.isNotEmpty(typeAndSubTypes) && typeAndSubTypes.size() <= maxTypesCountInIdxQuery) {
return String.format("(%s)", StringUtils.join(typeAndSubTypes, " ")); return String.format("(%s)", StringUtils.join(typeAndSubTypes, " "));
} }
......
...@@ -97,10 +97,11 @@ public class EntityDiscoveryServiceTest { ...@@ -97,10 +97,11 @@ public class EntityDiscoveryServiceTest {
public void getSubTypeForTypeWithSubTypes_ReturnsOrClause() throws Exception { public void getSubTypeForTypeWithSubTypes_ReturnsOrClause() throws Exception {
String s = invokeGetSubTypesForType(TEST_TYPE_WITH_SUB_TYPES, maxTypesCountInIdxQuery); String s = invokeGetSubTypesForType(TEST_TYPE_WITH_SUB_TYPES, maxTypesCountInIdxQuery);
assertTrue(s.startsWith("(" + TEST_TYPE_WITH_SUB_TYPES)); assertTrue(s.startsWith("("));
assertTrue(s.contains(" " + TEST_TYPE1)); assertTrue(s.contains(TEST_TYPE_WITH_SUB_TYPES));
assertTrue(s.contains(" " + TEST_TYPE2)); assertTrue(s.contains(TEST_TYPE1));
assertTrue(s.contains(" " + TEST_TYPE3)); assertTrue(s.contains(TEST_TYPE2));
assertTrue(s.contains(TEST_TYPE3));
assertTrue(s.endsWith(")")); assertTrue(s.endsWith(")"));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment