File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
metafix/src/test/java/org/metafacture/metafix Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -1748,6 +1748,38 @@ public void shouldCopyMarkedArrayOfHashesIntoMarkedArray() {
17481748 );
17491749 }
17501750
1751+ @ Test
1752+ @ MetafixToDo ("See issue #711" )
1753+ public void shouldNotOverwriteHashValueWithMissingArrayValue () {
1754+ MetafixTestHelpers .assertFix (streamReceiver , Arrays .asList (
1755+ "copy_field('array[].*.dummy', 'hash.field1')"
1756+ ),
1757+ i -> {
1758+ i .startRecord ("1" );
1759+ i .startEntity ("hash" );
1760+ i .literal ("field1" , "value1" );
1761+ i .literal ("field2" , "value2" );
1762+ i .endEntity ();
1763+ i .startEntity ("array[]" );
1764+ i .startEntity ("1" );
1765+ i .endEntity ();
1766+ i .endEntity ();
1767+ i .endRecord ();
1768+ },
1769+ (o , f ) -> {
1770+ o .get ().startRecord ("1" );
1771+ o .get ().startEntity ("hash" );
1772+ o .get ().literal ("field1" , "value1" );
1773+ o .get ().literal ("field2" , "value2" );
1774+ o .get ().endEntity ();
1775+ o .get ().startEntity ("array[]" );
1776+ o .get ().startEntity ("1" );
1777+ f .apply (2 ).endEntity ();
1778+ o .get ().endRecord ();
1779+ }
1780+ );
1781+ }
1782+
17511783 @ Test
17521784 public void removeLiteral () {
17531785 MetafixTestHelpers .assertFix (streamReceiver , Arrays .asList (
You can’t perform that action at this time.
0 commit comments