Search in sources :

Example 21 with ConfigurationServiceImpl

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");
    }
}
Also used : Expectations(org.jmock.Expectations) ConfigurationServiceImpl(org.nhindirect.config.service.impl.ConfigurationServiceImpl)

Example 22 with ConfigurationServiceImpl

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");
    }
}
Also used : Expectations(org.jmock.Expectations) ConfigurationServiceImpl(org.nhindirect.config.service.impl.ConfigurationServiceImpl)

Example 23 with ConfigurationServiceImpl

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");
    }
}
Also used : Expectations(org.jmock.Expectations) ConfigurationServiceImpl(org.nhindirect.config.service.impl.ConfigurationServiceImpl)

Example 24 with ConfigurationServiceImpl

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");
    }
}
Also used : Expectations(org.jmock.Expectations) EntityStatus(org.nhindirect.config.store.EntityStatus) ConfigurationServiceImpl(org.nhindirect.config.service.impl.ConfigurationServiceImpl)

Example 25 with ConfigurationServiceImpl

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");
    }
}
Also used : Expectations(org.jmock.Expectations) CertificateGetOptions(org.nhindirect.config.service.impl.CertificateGetOptions) ConfigurationServiceImpl(org.nhindirect.config.service.impl.ConfigurationServiceImpl)

Aggregations

Expectations (org.jmock.Expectations)41 ConfigurationServiceImpl (org.nhindirect.config.service.impl.ConfigurationServiceImpl)41 CertificateGetOptions (org.nhindirect.config.service.impl.CertificateGetOptions)10 EntityStatus (org.nhindirect.config.store.EntityStatus)5 Domain (org.nhindirect.config.store.Domain)4 Address (org.nhindirect.config.store.Address)2 Certificate (org.nhindirect.config.store.Certificate)2 Anchor (org.nhindirect.config.store.Anchor)1