use of org.nhindirect.config.service.impl.ConfigurationServiceImpl in project nhin-d by DirectProject.
the class ConfigurationServiceTest method testRemoveDomainById.
/**
* Test the removeDomainById method.
*/
public void testRemoveDomainById() throws Exception {
final DomainService domainService = context.mock(DomainService.class);
final long domainId = 1;
context.checking(new Expectations() {
{
oneOf(domainService).removeDomainById(domainId);
}
});
ConfigurationServiceImpl service = new ConfigurationServiceImpl();
service.setDomainSvc(domainService);
try {
service.removeDomainById(domainId);
} catch (Exception e) {
fail("Exception thrown");
}
}
use of org.nhindirect.config.service.impl.ConfigurationServiceImpl in project nhin-d by DirectProject.
the class ConfigurationServiceTest method testGetSettingsByNames.
/**
* Test the getSettingsByNames method.
*/
public void testGetSettingsByNames() throws Exception {
final SettingService settingService = context.mock(SettingService.class);
final Collection<String> names = Arrays.asList(UUID.randomUUID().toString());
context.checking(new Expectations() {
{
oneOf(settingService).getSettingsByNames(names);
}
});
ConfigurationServiceImpl service = new ConfigurationServiceImpl();
service.setSettingSvc(settingService);
try {
service.getSettingsByNames(names);
} catch (Exception e) {
fail("Exception thrown");
}
}
use of org.nhindirect.config.service.impl.ConfigurationServiceImpl in project nhin-d by DirectProject.
the class ConfigurationServiceTest method testRemoveCertificates.
/**
* Test the removeCertificates method.
*/
public void testRemoveCertificates() throws Exception {
final CertificateService certificateService = context.mock(CertificateService.class);
final Collection<Long> collection = Arrays.asList(3L, 4L);
context.checking(new Expectations() {
{
oneOf(certificateService).removeCertificates(collection);
}
});
ConfigurationServiceImpl service = new ConfigurationServiceImpl();
service.setCertSvc(certificateService);
try {
service.removeCertificates(collection);
} catch (Exception e) {
fail("Exception thrown");
}
}
use of org.nhindirect.config.service.impl.ConfigurationServiceImpl in project nhin-d by DirectProject.
the class ConfigurationServiceTest method testGetDomains.
/**
* Test the getDomains method.
*/
public void testGetDomains() throws Exception {
final DomainService domainService = context.mock(DomainService.class);
final Collection<String> collection = Arrays.asList("domain1", "domain2");
final EntityStatus status = EntityStatus.ENABLED;
context.checking(new Expectations() {
{
oneOf(domainService).getDomains(collection, status);
}
});
ConfigurationServiceImpl service = new ConfigurationServiceImpl();
service.setDomainSvc(domainService);
try {
service.getDomains(collection, status);
} catch (Exception e) {
fail("Exception thrown");
}
}
use of org.nhindirect.config.service.impl.ConfigurationServiceImpl in project nhin-d by DirectProject.
the class ConfigurationServiceTest method testListAnchors.
/**
* Test the listAnchors method.
*/
public void testListAnchors() throws Exception {
final AnchorService anchorService = context.mock(AnchorService.class);
final long lastAnchorId = 3L;
final int maxResults = 3;
final CertificateGetOptions options = CertificateGetOptions.DEFAULT;
context.checking(new Expectations() {
{
oneOf(anchorService).listAnchors(lastAnchorId, maxResults, options);
}
});
ConfigurationServiceImpl service = new ConfigurationServiceImpl();
service.setAnchorSvc(anchorService);
try {
service.listAnchors(lastAnchorId, maxResults, options);
} catch (Exception e) {
fail("Exception thrown");
}
}
Aggregations