use of org.nhindirect.config.service.impl.ConfigurationServiceImpl in project nhin-d by DirectProject.
the class ConfigurationServiceTest method testAddSetting.
/**
* Test the addSetting method.
*/
public void testAddSetting() throws Exception {
final SettingService settingService = context.mock(SettingService.class);
final String name = UUID.randomUUID().toString();
final String value = UUID.randomUUID().toString();
context.checking(new Expectations() {
{
oneOf(settingService).addSetting(name, value);
}
});
ConfigurationServiceImpl service = new ConfigurationServiceImpl();
service.setSettingSvc(settingService);
try {
service.addSetting(name, value);
} catch (Exception e) {
fail("Exception thrown");
}
}
use of org.nhindirect.config.service.impl.ConfigurationServiceImpl in project nhin-d by DirectProject.
the class ConfigurationServiceTest method testGetAnchors.
/**
* Test the getAnchors method.
*/
public void testGetAnchors() throws Exception {
final AnchorService anchorService = context.mock(AnchorService.class);
final Collection<Long> anchorIds = Arrays.asList(3L, 4L);
final CertificateGetOptions options = CertificateGetOptions.DEFAULT;
context.checking(new Expectations() {
{
oneOf(anchorService).getAnchors(anchorIds, options);
}
});
ConfigurationServiceImpl service = new ConfigurationServiceImpl();
service.setAnchorSvc(anchorService);
try {
service.getAnchors(anchorIds, options);
} catch (Exception e) {
fail("Exception thrown");
}
}
use of org.nhindirect.config.service.impl.ConfigurationServiceImpl in project nhin-d by DirectProject.
the class ConfigurationServiceTest method testGetIncomingAnchors.
/**
* Test the getIncomingAnchors method.
*/
public void testGetIncomingAnchors() throws Exception {
final AnchorService anchorService = context.mock(AnchorService.class);
final String owner = "owner";
final CertificateGetOptions options = CertificateGetOptions.DEFAULT;
context.checking(new Expectations() {
{
oneOf(anchorService).getIncomingAnchors(owner, options);
}
});
ConfigurationServiceImpl service = new ConfigurationServiceImpl();
service.setAnchorSvc(anchorService);
try {
service.getIncomingAnchors(owner, options);
} catch (Exception e) {
fail("Exception thrown");
}
}
use of org.nhindirect.config.service.impl.ConfigurationServiceImpl in project nhin-d by DirectProject.
the class ConfigurationServiceTest method testUpdateSetting.
/**
* Test the updateSetting method.
*/
public void testUpdateSetting() throws Exception {
final SettingService settingService = context.mock(SettingService.class);
final String name = UUID.randomUUID().toString();
final String value = UUID.randomUUID().toString();
context.checking(new Expectations() {
{
oneOf(settingService).updateSetting(name, value);
}
});
ConfigurationServiceImpl service = new ConfigurationServiceImpl();
service.setSettingSvc(settingService);
try {
service.updateSetting(name, value);
} catch (Exception e) {
fail("Exception thrown");
}
}
use of org.nhindirect.config.service.impl.ConfigurationServiceImpl in project nhin-d by DirectProject.
the class ConfigurationServiceTest method testGetOutgoingAnchors.
/**
* Test the getOutgoingAnchors method.
*/
public void testGetOutgoingAnchors() throws Exception {
final AnchorService anchorService = context.mock(AnchorService.class);
final String owner = "owner";
final CertificateGetOptions options = CertificateGetOptions.DEFAULT;
context.checking(new Expectations() {
{
oneOf(anchorService).getOutgoingAnchors(owner, options);
}
});
ConfigurationServiceImpl service = new ConfigurationServiceImpl();
service.setAnchorSvc(anchorService);
try {
service.getOutgoingAnchors(owner, options);
} catch (Exception e) {
fail("Exception thrown");
}
}
Aggregations