use of io.atlasmap.v2.LastIndexOf in project atlasmap by atlasmap.
the class StringComplexFieldActionsTest method testLastIndexOf.
@Test
public void testLastIndexOf() {
LastIndexOf action = new LastIndexOf();
action.setString("");
assertEquals(-1, StringComplexFieldActions.lastIndexOf(action, null));
assertEquals(0, StringComplexFieldActions.lastIndexOf(action, ""));
assertEquals(3, StringComplexFieldActions.lastIndexOf(action, "foo"));
action.setString("bar");
assertEquals(-1, StringComplexFieldActions.lastIndexOf(action, null));
assertEquals(-1, StringComplexFieldActions.lastIndexOf(action, ""));
assertEquals(-1, StringComplexFieldActions.lastIndexOf(action, "foo"));
assertEquals(3, StringComplexFieldActions.lastIndexOf(action, "foobar"));
assertEquals(6, StringComplexFieldActions.lastIndexOf(action, "foobarbar"));
}
Aggregations