ConnectionDAO mockedConnectionDAO = mock(ConnectionDAO.class);
mappingAction.setConnectionDAO(mockedConnectionDAO);
when(mockedConnectionDAO.findAll()).thenReturn(connectionList);
//Code for creating List<ValueType> & mock for it.
ValueType valueType1 = new ValueType(101, datastore, "valueType1", "className1",
"className1", true);
ValueType valueType2 = new ValueType(102, datastore, "valueType2", "className2",
"className2", true);
ValueType valueType3 = new ValueType(103, datastore, "valueType3", "className3",
"className3", true);
List<ValueType> valueTypeList = new ArrayList<ValueType>();
valueTypeList.add(valueType1);
valueTypeList.add(valueType2);