old.setString("sendemail", null, "smtpUser", "email.user");
old.setString("sendemail", null, "smtpPass", "email.s3kr3t");
old.save();
final InitFlags flags = new InitFlags(site);
final ConsoleUI ui = createStrictMock(ConsoleUI.class);
Section.Factory sections = new Section.Factory() {
@Override
public Section get(String name) {
return new Section(flags, site, ui, name);
}
};
expect(ui.yesno(eq(true), eq("Upgrade '%s'"), eq(p.getCanonicalPath())))
.andReturn(true);
replay(ui);
UpgradeFrom2_0_x u = new UpgradeFrom2_0_x(site, flags, ui, sections);
assertTrue(u.isNeedUpgrade());