Search in sources :

Example 1 with TypeSettingOption

use of org.motechproject.mds.domain.TypeSettingOption in project motech by motech.

the class AllTypeSettingsContextIT method assertTypeSetting.

private void assertTypeSetting(List<TypeSetting> typeSettings, String name, List<String> typeSettingOptions, Class<?> typeClass, String defaultValue) {
    TypeSetting typeSetting = retrieveByName(typeSettings, name);
    assertNotNull("Not found type setting with name: " + name, typeSetting);
    assertNotNull("Type setting should have id", typeSetting.getId());
    assertEquals(name, typeSetting.getName());
    List<TypeSettingOption> options = typeSetting.getTypeSettingOptions();
    List<String> optionsNames = new ArrayList<>();
    for (TypeSettingOption option : options) {
        optionsNames.add(option.getName());
    }
    assertEquals(typeSettingOptions, optionsNames);
    assertEquals(typeClass, typeSetting.getValueType().getTypeClass());
    assertEquals(defaultValue, typeSetting.getDefaultValue());
}
Also used : TypeSettingOption(org.motechproject.mds.domain.TypeSettingOption) TypeSetting(org.motechproject.mds.domain.TypeSetting) ArrayList(java.util.ArrayList)

Aggregations

ArrayList (java.util.ArrayList)1 TypeSetting (org.motechproject.mds.domain.TypeSetting)1 TypeSettingOption (org.motechproject.mds.domain.TypeSettingOption)1