@@ -1073,6 +1073,7 @@ public void testInsertOptionUpdate() throws Exception
1073
1073
rowsToUpdate. add(CaseInsensitiveHashMap . of(" name" , " D-1-d" , " prop" , " c1" , " DataInputs/DataClassWithImportOption" , " D-1" ));
1074
1074
rowsToUpdate. add(CaseInsensitiveHashMap . of(" name" , " D-2" , " prop" , " b1" , " DataInputs/DataClassWithImportOption" , null , " alias" , " Grassland" ));
1075
1075
1076
+ context = new DataIteratorContext ();
1076
1077
context. setInsertOption(QueryUpdateService . InsertOption . UPDATE );
1077
1078
count = qus. loadRows(user, c, MapDataIterator . of(rowsToUpdate), context, null );
1078
1079
@@ -1128,6 +1129,7 @@ public void testInsertOptionUpdate() throws Exception
1128
1129
rowsToMerge. add(CaseInsensitiveHashMap . of(" name" , " D-2" , " prop" , " gene" , longFieldName, " Pasture" , " alias" , " Exceedingly" , " flag" , " cOne" ));
1129
1130
rowsToMerge. add(CaseInsensitiveHashMap . of(" name" , " D-22" , " prop" , null , longFieldName, " Goal" , " alias" , " Immensely" , " flag" , " cEight" ));
1130
1131
1132
+ context = new DataIteratorContext ();
1131
1133
context. setInsertOption(QueryUpdateService . InsertOption . MERGE );
1132
1134
count = qus. loadRows(user, c, MapDataIterator . of(rowsToMerge), context, null );
1133
1135
@@ -1157,8 +1159,7 @@ public void testInsertOptionUpdate() throws Exception
1157
1159
// long field
1158
1160
assertEquals(" Very" , rows. get(0 ). get(longFieldAlias));
1159
1161
assertEquals(" Long" , rows. get(1 ). get(longFieldAlias));
1160
- // TODO: This is not updating as I would expect. Verify what is expected here with regards to updating via merge.
1161
- // assertEquals("Pasture", rows.get(2).get(longFieldAlias));
1162
+ assertEquals(" Pasture" , rows. get(2 ). get(longFieldAlias));
1162
1163
assertEquals(" Goal" , rows. get(3 ). get(longFieldAlias));
1163
1164
1164
1165
// alias
@@ -1172,7 +1173,6 @@ public void testInsertOptionUpdate() throws Exception
1172
1173
assertEquals(" c200" , rows. get(1 ). get(flagAlias));
1173
1174
assertEquals(" cOne" , rows. get(2 ). get(flagAlias));
1174
1175
assertEquals(" cEight" , rows. get(3 ). get(flagAlias));
1175
-
1176
1176
}
1177
1177
1178
1178
private @NotNull TableInfo getDataClassTable(String dataClassName)
@@ -1226,7 +1226,9 @@ public void testUpdateAuditForLongField() throws Exception
1226
1226
1227
1227
List<Map<String , Object > > rowsToUpdate = new ArrayList<> ();
1228
1228
rowsToUpdate. add(CaseInsensitiveHashMap . of(" name" , " A-1" , fieldName, " Updated" ));
1229
+ context = new DataIteratorContext ();
1229
1230
context. setInsertOption(QueryUpdateService . InsertOption . UPDATE );
1231
+ context. getConfigParameters(). put(DetailedAuditLogDataIterator . AuditConfigs . AuditBehavior , AuditBehaviorType . DETAILED );
1230
1232
count = qus. loadRows(user, c, MapDataIterator . of(rowsToUpdate), context, null );
1231
1233
assertFalse(" Unexpected errors from update" , context. getErrors(). hasErrors());
1232
1234
assertEquals(" Number of rows updated not as expected" , 1 , count);
@@ -1241,7 +1243,5 @@ public void testUpdateAuditForLongField() throws Exception
1241
1243
String oldRecordMap = ((DetailedAuditTypeEvent ) events. get(0 )). getOldRecordMap();
1242
1244
assertTrue(" Old record map (" + oldRecordMap + " ) does not contain expected field" , oldRecordMap. contains(encodeURIComponent(fieldName. toLowerCase()) + " =Initial" ));
1243
1245
}
1244
-
1245
1246
}
1246
-
1247
1247
% >
0 commit comments