use of org.nhindirect.config.service.impl.SettingServiceImpl in project nhin-d by DirectProject.
the class SettingServiceTest method testDeleteSettings.
/**
* Test the addAnchors method.
*/
public void testDeleteSettings() {
final SettingDao settingDao = context.mock(SettingDao.class);
final Collection<String> name = Arrays.asList(UUID.randomUUID().toString());
context.checking(new Expectations() {
{
oneOf(settingDao).delete(name);
}
});
SettingServiceImpl service = new SettingServiceImpl();
service.setDao(settingDao);
try {
service.deleteSetting(name);
} catch (Exception e) {
fail("Exception thrown");
}
}
use of org.nhindirect.config.service.impl.SettingServiceImpl in project nhin-d by DirectProject.
the class SettingServiceTest method testGetSettingsByNames.
/**
* Test the addAnchors method.
*/
public void testGetSettingsByNames() {
final SettingDao settingDao = context.mock(SettingDao.class);
final Collection<String> names = Arrays.asList(UUID.randomUUID().toString(), UUID.randomUUID().toString());
context.checking(new Expectations() {
{
oneOf(settingDao).getByNames(names);
}
});
SettingServiceImpl service = new SettingServiceImpl();
service.setDao(settingDao);
try {
service.getSettingsByNames(names);
} catch (Exception e) {
fail("Exception thrown");
}
}
use of org.nhindirect.config.service.impl.SettingServiceImpl in project nhin-d by DirectProject.
the class SettingServiceTest method testGetSettingByName.
/**
* Test the addAnchors method.
*/
public void testGetSettingByName() {
final SettingDao settingDao = context.mock(SettingDao.class);
final String name = UUID.randomUUID().toString();
context.checking(new Expectations() {
{
oneOf(settingDao).getByNames(Arrays.asList(name));
}
});
SettingServiceImpl service = new SettingServiceImpl();
service.setDao(settingDao);
try {
service.getSettingByName(name);
} catch (Exception e) {
fail("Exception thrown");
}
}
use of org.nhindirect.config.service.impl.SettingServiceImpl in project nhin-d by DirectProject.
the class SettingServiceTest method testAddSetting.
/**
* Test the addAnchors method.
*/
public void testAddSetting() {
final SettingDao settingDao = context.mock(SettingDao.class);
final String name = UUID.randomUUID().toString();
final String value = UUID.randomUUID().toString();
context.checking(new Expectations() {
{
oneOf(settingDao).add(name, value);
}
});
SettingServiceImpl service = new SettingServiceImpl();
service.setDao(settingDao);
try {
service.addSetting(name, value);
} catch (Exception e) {
fail("Exception thrown");
}
}
use of org.nhindirect.config.service.impl.SettingServiceImpl in project nhin-d by DirectProject.
the class SettingServiceTest method testUpdateSetting.
/**
* Test the addAnchors method.
*/
public void testUpdateSetting() {
final SettingDao settingDao = context.mock(SettingDao.class);
final String name = UUID.randomUUID().toString();
final String value = UUID.randomUUID().toString();
context.checking(new Expectations() {
{
oneOf(settingDao).update(name, value);
}
});
SettingServiceImpl service = new SettingServiceImpl();
service.setDao(settingDao);
try {
service.updateSetting(name, value);
} catch (Exception e) {
fail("Exception thrown");
}
}
Aggregations