Skip to content

Commit 9b8fa39

Browse files
committed
Tweak shouldNotTrimIndexedArray, add shouldNotTrimHash test (#170)
1 parent 746fcf4 commit 9b8fa39

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

metafix/src/test/java/org/metafacture/metafix/MetafixMethodTest.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,28 @@ public void shouldNotTrimRepeatedField() {
307307

308308
@Test
309309
public void shouldNotTrimIndexedArray() {
310+
MetafixTestHelpers.assertExecutionException(IllegalStateException.class, "Expected String, got Array", () ->
311+
MetafixTestHelpers.assertFix(streamReceiver, Arrays.asList(
312+
"trim('data.title[]')"
313+
),
314+
i -> {
315+
i.startRecord("1");
316+
i.startEntity("data");
317+
i.startEntity("title[]");
318+
i.literal("1", " marc ");
319+
i.literal("2", " json ");
320+
i.endEntity();
321+
i.endEntity();
322+
i.endRecord();
323+
},
324+
o -> {
325+
}
326+
)
327+
);
328+
}
329+
330+
@Test
331+
public void shouldNotTrimHash() {
310332
MetafixTestHelpers.assertExecutionException(IllegalStateException.class, "Expected String, got Hash", () ->
311333
MetafixTestHelpers.assertFix(streamReceiver, Arrays.asList(
312334
"trim('data.title')"

0 commit comments

Comments
 (0)