pefernan commented on code in PR #2180:
URL:
https://github.com/apache/incubator-kie-kogito-apps/pull/2180#discussion_r1931725243
##########
data-index/data-index-common/src/test/java/org/kie/kogito/index/CommonUtilsTest.java:
##########
@@ -51,4 +51,90 @@ void testComplexMergeMap() {
Map<String, Object> target = Map.of("nested", nestedTarget);
assertThat(CommonUtils.mergeMap(src,
target)).isEqualTo(Map.of("nested", Map.of("name", "Javierito", "other",
"remain", "different", "remain")));
}
+
+ @Test
+ void testMergeWithEmptySource() {
+ Map<String, String> target = Map.of("name", "Fulanito");
+ assertThat(CommonUtils.mergeMap(Map.of(), target)).isEqualTo(target);
+ }
+
+ @Test
+ void testMergeWithEmptyTarget() {
+ Map<String, String> source = Map.of("name", "Javierito");
+ assertThat(CommonUtils.mergeMap(source, Map.of())).isEqualTo(source);
+ }
+
+ @Test
+ void testMergeWithNullSource() {
+ Map<String, String> target = Map.of("name", "Gonzalito");
+ assertThat(CommonUtils.mergeMap(null, target)).isEqualTo(target);
+ }
+
+ @Test
+ void testMergeWithNullTarget() {
+ Map<String, String> source = Map.of("name", "Francisquito");
Review Comment:
I don't agree @fjtirado Francisquito or Frasquito suits you very well :P
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]