DatabaseUpgradeSupport { public List<ChangeSetInfo> listRanUpgrades() { try { return CollectionUtils.collect(database.getRanChangeSetList(), new Transformer<RanChangeSet, ChangeSetInfo>() { @Override public ChangeSetInfo transform(RanChangeSet ranChangeSet) { return new ChangeSetInfo(ranChangeSet); } }); } catch (DatabaseException e) { throw new MifosRuntimeException(e); } } DatabaseUpgradeSupport(DataSource dataSource, ResourceOpener resourceOpener);  DatabaseUpgradeSupport(Database database, Liquibase liquibase); DbUpgradeValidationResult validate(); void expansion(); void contraction(); List<ChangeSetInfo> listRanUpgrades(); List<UnRunChangeSetInfo> listUnRunChangeSets(); static final String EXPANSION; static final String CONTRACTION; static final String BEAN_NAME; }
@Test public void shouldRetrieveAllRanUpgrades() throws Exception { RanChangeSet ranChangeSet1 = new RanChangeSet(changeSet1); RanChangeSet ranChangeSet2 = new RanChangeSet(changeSet2); when(database.getRanChangeSetList()).thenReturn(Arrays.asList(ranChangeSet1, ranChangeSet2)); List<ChangeSetInfo> changeSets = databaseUpgradeSupport.listRanUpgrades(); assertThat(changeSets, is(not(nullValue()))); assertThat(changeSets.size(), is(2)); verify(database).getRanChangeSetList(); }