Search in sources :

Example 11 with DataValidator

use of com.izforge.izpack.api.installer.DataValidator 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);
}
Also used : InstallData(com.izforge.izpack.api.data.InstallData) DataValidator(com.izforge.izpack.api.installer.DataValidator) File(java.io.File) Test(org.junit.jupiter.api.Test)

Example 12 with DataValidator

use of com.izforge.izpack.api.installer.DataValidator 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);
}
Also used : InstallData(com.izforge.izpack.api.data.InstallData) DataValidator(com.izforge.izpack.api.installer.DataValidator) File(java.io.File) Test(org.junit.jupiter.api.Test)

Example 13 with DataValidator

use of com.izforge.izpack.api.installer.DataValidator in project robozonky by RoboZonky.

the class ZonkoidSettingsValidatorTest method messages.

@Test
void messages() {
    final DataValidator validator = new ZonkoidSettingsValidator();
    assertSoftly(softly -> {
        softly.assertThat(validator.getDefaultAnswer()).isFalse();
        softly.assertThat(validator.getWarningMessageId()).isNotEmpty();
        softly.assertThat(validator.getErrorMessageId()).isNotEmpty();
        softly.assertThat(validator.getErrorMessageId()).isNotEqualTo(validator.getWarningMessageId());
    });
}
Also used : DataValidator(com.izforge.izpack.api.installer.DataValidator) Test(org.junit.jupiter.api.Test)

Example 14 with DataValidator

use of com.izforge.izpack.api.installer.DataValidator in project robozonky by RoboZonky.

the class StrategySettingsValidatorTest method messages.

@Test
void messages() {
    final DataValidator validator = new StrategySettingsValidator();
    assertSoftly(softly -> {
        softly.assertThat(validator.getDefaultAnswer()).isFalse();
        softly.assertThat(validator.getWarningMessageId()).isNotEmpty();
        softly.assertThat(validator.getErrorMessageId()).isNotEmpty();
        softly.assertThat(validator.getErrorMessageId()).isNotEqualTo(validator.getWarningMessageId());
    });
}
Also used : DataValidator(com.izforge.izpack.api.installer.DataValidator) Test(org.junit.jupiter.api.Test)

Aggregations

DataValidator (com.izforge.izpack.api.installer.DataValidator)14 Test (org.junit.jupiter.api.Test)14 InstallData (com.izforge.izpack.api.data.InstallData)10 File (java.io.File)5 ServerSetupTest (com.icegreen.greenmail.util.ServerSetupTest)3 ConfirmationProvider (com.github.robozonky.api.confirmations.ConfirmationProvider)2 Optional (java.util.Optional)1