use of com.izforge.izpack.api.data.InstallData in project robozonky by RoboZonky.
the class RoboZonkyInstallerListenerTest method emailEnabled.
@Test
void emailEnabled() {
// prepare
final InstallData localData = RoboZonkyInstallerListenerTest.mockData();
when(localData.getVariable(Variables.IS_EMAIL_ENABLED.getKey())).thenReturn("true");
RoboZonkyInstallerListener.setInstallData(localData);
// execute SUT
final CommandLinePart clp = new RoboZonkyInstallerListener().prepareEmailConfiguration();
// test
assertSoftly(softly -> {
softly.assertThat(clp.getProperties()).isNotEmpty();
softly.assertThat(RoboZonkyInstallerListener.EMAIL_CONFIG_FILE).canRead();
});
}
use of com.izforge.izpack.api.data.InstallData in project robozonky by RoboZonky.
the class StrategySettingsValidatorTest method fileOk.
@Test
void fileOk() throws IOException {
final File f = File.createTempFile("robozonky-", ".cfg");
final InstallData d = StrategySettingsValidatorTest.mockInstallData(f);
// execute sut
final DataValidator validator = new StrategySettingsValidator();
final DataValidator.Status result = validator.validateData(d);
// execute test
assertThat(result).isEqualTo(DataValidator.Status.OK);
assertThat(RoboZonkyInstallerListener.INSTALL_PATH).isNotNull();
}
use of com.izforge.izpack.api.data.InstallData in project robozonky by RoboZonky.
the class StrategySettingsValidatorTest method fileMissing.
@Test
void fileMissing() throws IOException {
final File f = File.createTempFile("robozonky-", ".cfg");
Assumptions.assumeTrue(f.delete());
final InstallData d = StrategySettingsValidatorTest.mockInstallData(f);
// execute sut
final DataValidator validator = new StrategySettingsValidator();
final DataValidator.Status result = validator.validateData(d);
// execute test
assertThat(result).isEqualTo(DataValidator.Status.WARNING);
}
use of com.izforge.izpack.api.data.InstallData in project robozonky by RoboZonky.
the class StrategySettingsValidatorTest method urlWrong.
@Test
void urlWrong() throws IOException {
final File f = File.createTempFile("robozonky-", ".cfg");
Assumptions.assumeTrue(f.delete());
final InstallData d = StrategySettingsValidatorTest.mockInstallData(f.toURI().toURL());
// execute sut
final DataValidator validator = new StrategySettingsValidator();
final DataValidator.Status result = validator.validateData(d);
// execute test
assertThat(result).isEqualTo(DataValidator.Status.WARNING);
}
use of com.izforge.izpack.api.data.InstallData in project robozonky by RoboZonky.
the class StrategySettingsValidatorTest method mockInstallData.
private static InstallData mockInstallData() {
final InstallData data = mock(InstallData.class);
when(data.getVariable(eq(Variables.INSTALL_PATH.getKey()))).thenReturn(new File("target/").getAbsolutePath());
return data;
}
Aggregations