© Rupert Jones 2011,2012
1617181920212223
private Setting setting = null; @Before public void before() { setting = new Setting(); setting.setValue("^(?=.*[A-Za-z])(?=.*\\d)(.{8,})$"); }
202122232425262728
@Autowired private SettingsService service; @Test public void test_get_setting_by_type() { Setting setting = service.find(SettingType.ALLOW_AD_HOC_EXECUTION); assertNotNull(setting); assertEquals("true", setting.getValue()); }
4041424344454647
return settingDAO.findAll(); } @Override public Object getSettingValue(SettingType type) { Setting setting = find(type); return TypeConverter.convert(setting.getValue(), setting.getValueTypeAsClass()); }