use of org.nhindirect.config.service.impl.ConfigurationServiceImpl in project nhin-d by DirectProject.
the class ConfigurationServiceTest method testUpdateDomain.
/**
* Test the updateDomain method.
*/
public void testUpdateDomain() throws Exception {
final DomainService domainService = context.mock(DomainService.class);
final Domain domain = new Domain("domain");
context.checking(new Expectations() {
{
oneOf(domainService).updateDomain(domain);
}
});
ConfigurationServiceImpl service = new ConfigurationServiceImpl();
service.setDomainSvc(domainService);
try {
service.updateDomain(domain);
} catch (Exception e) {
fail("Exception thrown");
}
}
use of org.nhindirect.config.service.impl.ConfigurationServiceImpl in project nhin-d by DirectProject.
the class ConfigurationServiceTest method testGetAllSettings.
/**
* Test the getAllSettings method.
*/
public void testGetAllSettings() throws Exception {
final SettingService settingService = context.mock(SettingService.class);
context.checking(new Expectations() {
{
oneOf(settingService).getAllSettings();
}
});
ConfigurationServiceImpl service = new ConfigurationServiceImpl();
service.setSettingSvc(settingService);
try {
service.getAllSettings();
} catch (Exception e) {
fail("Exception thrown");
}
}
use of org.nhindirect.config.service.impl.ConfigurationServiceImpl in project nhin-d by DirectProject.
the class ConfigurationServiceTest method testRemoveAddress.
/**
* Test the removeAddress method.
*/
public void testRemoveAddress() throws Exception {
final AddressService addressService = context.mock(AddressService.class);
final String addressName = "address";
context.checking(new Expectations() {
{
oneOf(addressService).removeAddress(addressName);
}
});
ConfigurationServiceImpl service = new ConfigurationServiceImpl();
service.setAddressSvc(addressService);
try {
service.removeAddress(addressName);
} catch (Exception e) {
fail("Exception thrown");
}
}
use of org.nhindirect.config.service.impl.ConfigurationServiceImpl in project nhin-d by DirectProject.
the class ConfigurationServiceTest method testGetSettingByName.
/**
* Test the getSettingByName method.
*/
public void testGetSettingByName() throws Exception {
final SettingService settingService = context.mock(SettingService.class);
final String name = UUID.randomUUID().toString();
context.checking(new Expectations() {
{
oneOf(settingService).getSettingByName(name);
}
});
ConfigurationServiceImpl service = new ConfigurationServiceImpl();
service.setSettingSvc(settingService);
try {
service.getSettingByName(name);
} catch (Exception e) {
fail("Exception thrown");
}
}
use of org.nhindirect.config.service.impl.ConfigurationServiceImpl in project nhin-d by DirectProject.
the class ConfigurationServiceTest method testListDomains.
/**
* Test the listDomains method.
*/
public void testListDomains() throws Exception {
final DomainService domainService = context.mock(DomainService.class);
final String lastDomainName = "domain";
final int maxResults = 2;
context.checking(new Expectations() {
{
oneOf(domainService).listDomains(lastDomainName, maxResults);
}
});
ConfigurationServiceImpl service = new ConfigurationServiceImpl();
service.setDomainSvc(domainService);
try {
service.listDomains(lastDomainName, maxResults);
} catch (Exception e) {
fail("Exception thrown");
}
}
Aggregations