Skip to content

Commit

Permalink
Add failing test case for unsuccessful lookup. (f210dd3, #170)
Browse files Browse the repository at this point in the history
Throws java.lang.IndexOutOfBoundsException.
  • Loading branch information
blackwinter committed Mar 30, 2022
1 parent a4d557e commit a816a73
Showing 1 changed file with 44 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,50 @@ public void shouldNotDeleteNonFoundLookupExplicitly() {
);
}

@Test
public void shouldLookupAfterKeepingUnsuccessfulLookup() {
MetafixTestHelpers.assertFix(streamReceiver, Arrays.asList(
"lookup('title.*', Aloha: Alohaeha, 'Moin': 'Moin zäme')"
),
i -> {
i.startRecord("1");
i.literal("title", "Aloha");
i.literal("title", "Yo");
i.literal("title", "Moin");
i.endRecord();
},
o -> {
o.get().startRecord("1");
o.get().literal("title", "Alohaeha");
o.get().literal("title", "Yo");
o.get().literal("title", "Moin zäme");
o.get().endRecord();
}
);
}

@Test
@MetafixToDo("See https://github.com/metafacture/metafacture-fix/issues/170")
public void shouldLookupAfterDeletingUnsuccessfulLookup() {
MetafixTestHelpers.assertFix(streamReceiver, Arrays.asList(
"lookup('title.*', Aloha: Alohaeha, 'Moin': 'Moin zäme', delete: 'true')"
),
i -> {
i.startRecord("1");
i.literal("title", "Aloha");
i.literal("title", "Yo");
i.literal("title", "Moin");
i.endRecord();
},
o -> {
o.get().startRecord("1");
o.get().literal("title", "Alohaeha");
o.get().literal("title", "Moin zäme");
o.get().endRecord();
}
);
}

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

0 comments on commit a816a73

Please sign in to comment.