Commit de7fe47a by Ashutosh Mestry

ATLAS-3029, ATLAS-3020: Audit APIs for classification updates. Part-2.

parent fa7d1675
......@@ -310,7 +310,9 @@ public class ClassificationAssociator {
return list;
}
return list.stream().filter(x -> x.getEntityGuid().equals(guid)).collect(Collectors.toList());
return list.stream().filter(x -> x != null &&
(StringUtils.isEmpty(guid) || StringUtils.isEmpty(x.getEntityGuid()))
|| x.getEntityGuid().equals(guid)).collect(Collectors.toList());
}
}
}
......@@ -163,6 +163,7 @@ public class ClassificationAssociatorTest {
@Test
public void updaterTests() throws IOException {
updaterAssert("header-None", "col-entity-None");
updaterAssert("header-PII", "col-entity-None", PROCESS_ADD + ":PII");
updaterAssert("header-PII", "col-entity-PII", new String[]{PROCESS_UPDATE + ":PII"});
updaterAssert("header-None", "col-entity-PII", new String[]{PROCESS_DELETE + ":PII"});
......@@ -181,6 +182,10 @@ public class ClassificationAssociatorTest {
updaterAssert("header-Tx-prop-T1", "col-entity-T1-prop-Tn",
PROCESS_DELETE + ":T1",
PROCESS_ADD + ":Tx");
updaterAssert("header-Tx-prop-T1-No-Guid", "col-entity-T1-prop-Tn-No-Guid",
PROCESS_DELETE + ":Tn",
PROCESS_UPDATE + ":T1",
PROCESS_ADD + ":Tx");
}
......
{
"typeName": "hive_column",
"attributes": {
"owner": "hive",
"createTime": 1547071410000,
"qualifiedName": "stocks.daily@cl1",
"name": "daily"
},
"status": "ACTIVE",
"displayText": "daily",
"classifications": [
{
"typeName": "T1",
"attributes": {},
"entityStatus": "ACTIVE",
"propagate": false,
"validityPeriods": [],
"removePropagationsOnEntityDelete": false
},
{
"typeName": "Tn",
"attributes": {},
"entityStatus": "ACTIVE",
"propagate": false,
"validityPeriods": [],
"removePropagationsOnEntityDelete": false
}
],
"meaningNames": [],
"meanings": []
}
{
"guidHeaderMap": {
"0ce68113-77fe-4ed1-9585-69371202bd74": {
"typeName": "hive_column",
"attributes": {
"owner": "hive",
"qualifiedName": "hortoniabank.us_customers.nationalid@cl1",
"name": "nationalid"
},
"status": "ACTIVE",
"displayText": "nationalid",
"classificationNames": [
"T1", "Tx"
],
"classifications": [
{
"typeName": "Tx",
"attributes": {
"type": "ssn"
},
"entityStatus": "ACTIVE",
"propagate": true,
"removePropagationsOnEntityDelete": false
},
{
"typeName": "T1",
"attributes": {
"type": "ssn"
},
"entityStatus": "ACTIVE",
"propagate": true,
"removePropagationsOnEntityDelete": false
}
],
"meaningNames": [],
"meanings": []
}
}
}
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