Search in sources :

Example 1 with AbstractSystemPreference

use of com.epam.pipeline.manager.preference.AbstractSystemPreference in project cloud-pipeline by epam.

the class SystemPreferencesValidationTest method testGreater.

private void testGreater(AbstractSystemPreference preference, int value) {
    Preference pref = new Preference();
    pref.setName(preference.getKey());
    pref.setValue(Integer.toString(value + 1));
    Assert.assertTrue(preferences.isValid(pref, null));
    pref.setValue(Integer.toString(value - 1));
    Assert.assertFalse(preferences.isValid(pref, null));
}
Also used : AbstractSystemPreference(com.epam.pipeline.manager.preference.AbstractSystemPreference)

Example 2 with AbstractSystemPreference

use of com.epam.pipeline.manager.preference.AbstractSystemPreference in project cloud-pipeline by epam.

the class SystemPreferencesValidationTest method testNoValidation.

private void testNoValidation(AbstractSystemPreference preference) {
    Preference pref = new Preference();
    pref.setName(preference.getKey());
    pref.setValue("whatever");
    Assert.assertTrue(preferences.isValid(pref, null));
}
Also used : AbstractSystemPreference(com.epam.pipeline.manager.preference.AbstractSystemPreference)

Example 3 with AbstractSystemPreference

use of com.epam.pipeline.manager.preference.AbstractSystemPreference in project cloud-pipeline by epam.

the class SystemPreferencesValidationTest method testBoolean.

private void testBoolean(AbstractSystemPreference preference) {
    Preference pref = new Preference();
    pref.setName(preference.getKey());
    pref.setValue("true");
    Assert.assertTrue(preferences.isValid(pref, null));
    pref.setValue("false");
    Assert.assertTrue(preferences.isValid(pref, null));
    pref.setValue("whatever");
    Assert.assertFalse(preferences.isValid(pref, null));
}
Also used : AbstractSystemPreference(com.epam.pipeline.manager.preference.AbstractSystemPreference)

Aggregations

AbstractSystemPreference (com.epam.pipeline.manager.preference.AbstractSystemPreference)3