Skip to content
This repository has been archived by the owner on Jan 27, 2025. It is now read-only.

Commit

Permalink
Add failing unit test, tweak releated existing test (#113)
Browse files Browse the repository at this point in the history
  • Loading branch information
fsteeg committed May 5, 2022
1 parent 3798670 commit 03e7360
Showing 1 changed file with 31 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ public void appendWithAsteriksWildcardAtTheEnd() {
}

@Test
// See https://github.com/metafacture/metafacture-fix/pull/142
@MetafixToDo("See https://github.com/metafacture/metafacture-fix/pull/113")
public void shouldCopyArrayFieldWithoutAsterisk() {
MetafixTestHelpers.assertFix(streamReceiver, Arrays.asList(
"set_array('TEST_TWO[]')",
Expand All @@ -691,23 +691,51 @@ public void shouldCopyArrayFieldWithoutAsterisk() {
i.endEntity();
i.endRecord();
},
o -> {
(o, f) -> {
o.get().startRecord("1");
o.get().startEntity("test[]");
o.get().literal("1", "One");
o.get().literal("2", "Two");
o.get().literal("3", "Three");
o.get().endEntity();
o.get().startEntity("TEST_TWO[]");
o.get().startEntity("1");
o.get().literal("1", "One");
o.get().literal("2", "Two");
o.get().literal("3", "Three");
o.get().endEntity();
f.apply(2).endEntity();
o.get().endRecord();
}
);
}

@Test
@MetafixToDo("See https://github.com/metafacture/metafacture-fix/issues/113")
public void copyFieldArrayOfObjectsAndListNewArrayOfObjectsAndMoveSubfield() {
MetafixTestHelpers.assertFix(streamReceiver, Arrays.asList(
"copy_field('author[]','creator[]')",
"do list(path:'creator[]')",
" move_field('name','label')",
"end",
"retain('creator[]')"),
i -> {
i.startRecord("1");
i.startEntity("author[]");
i.startEntity("1");
i.literal("name", "A University");
i.endEntity();
i.endEntity();
i.endRecord();
}, (o, f) -> {
o.get().startRecord("1");
o.get().startEntity("creator[]");
o.get().startEntity("1");
o.get().literal("label", "A University");
f.apply(2).endEntity();
o.get().endRecord();
});
}

@Test
// See https://github.com/metafacture/metafacture-fix/issues/121
public void shouldCopyArrayFieldWithAsterisk() {
Expand Down

0 comments on commit 03e7360

Please sign in to comment.