@Test public void testGetColumnNames() { strat.setColumnMapping("name", null, "id"); assertEquals("name", strat.getColumnName(0)); assertEquals(null, strat.getColumnName(1)); assertEquals("id", strat.getColumnName(2)); assertEquals(null, strat.getColumnName(3)); }
@Test public void getColumnNamesWhenEmptyMapping() { strat.setColumnMapping(); assertEquals(null, strat.getColumnName(0)); assertArrayEquals(new String[0], strat.getColumnMapping()); }
@Test public void getColumnNamesWhenNullArray() { strat.setColumnMapping((String[]) null); assertEquals(null, strat.getColumnName(0)); assertEquals(null, strat.getColumnName(1)); assertArrayEquals(new String[0], strat.getColumnMapping()); }
@Test public void getColumnNamesWhenNullColumnName() { String[] columns = {null}; strat.setColumnMapping(columns); assertEquals(null, strat.getColumnName(0)); assertEquals(null, strat.getColumnName(1)); assertArrayEquals(columns, strat.getColumnMapping()); }