Search in sources :

Example 6 with ConfigurationServiceImpl

use of org.nhindirect.config.service.impl.ConfigurationServiceImpl in project nhin-d by DirectProject.

the class ConfigurationServiceTest method testRemoveAnchorsForOwner.

/**
     * Test the removeAnchorsForOwner method.
     */
public void testRemoveAnchorsForOwner() throws Exception {
    final AnchorService anchorService = context.mock(AnchorService.class);
    final String owner = "owner";
    context.checking(new Expectations() {

        {
            oneOf(anchorService).removeAnchorsForOwner(owner);
        }
    });
    ConfigurationServiceImpl service = new ConfigurationServiceImpl();
    service.setAnchorSvc(anchorService);
    try {
        service.removeAnchorsForOwner(owner);
    } catch (Exception e) {
        fail("Exception thrown");
    }
}
Also used : Expectations(org.jmock.Expectations) ConfigurationServiceImpl(org.nhindirect.config.service.impl.ConfigurationServiceImpl)

Example 7 with ConfigurationServiceImpl

use of org.nhindirect.config.service.impl.ConfigurationServiceImpl in project nhin-d by DirectProject.

the class ConfigurationServiceTest method testRemoveDomains.

/**
     * Test the removeDomains method.
     */
public void testRemoveDomains() throws Exception {
    final DomainService domainService = context.mock(DomainService.class);
    final String domain = "domain";
    context.checking(new Expectations() {

        {
            oneOf(domainService).removeDomain(domain);
        }
    });
    ConfigurationServiceImpl service = new ConfigurationServiceImpl();
    service.setDomainSvc(domainService);
    try {
        service.removeDomain(domain);
    } catch (Exception e) {
        fail("Exception thrown");
    }
}
Also used : Expectations(org.jmock.Expectations) ConfigurationServiceImpl(org.nhindirect.config.service.impl.ConfigurationServiceImpl)

Example 8 with ConfigurationServiceImpl

use of org.nhindirect.config.service.impl.ConfigurationServiceImpl in project nhin-d by DirectProject.

the class ConfigurationServiceTest method testRemoveDomain.

/**
     * Test the removeDomain method.
     */
@SuppressWarnings("deprecation")
public void testRemoveDomain() throws Exception {
    final DomainService domainService = context.mock(DomainService.class);
    final String domain = "domain";
    context.checking(new Expectations() {

        {
            oneOf(domainService).removeDomain(domain);
        }
    });
    ConfigurationServiceImpl service = new ConfigurationServiceImpl();
    service.setDomainSvc(domainService);
    try {
        service.removeDomain(domain);
    } catch (Exception e) {
        fail("Exception thrown");
    }
}
Also used : Expectations(org.jmock.Expectations) ConfigurationServiceImpl(org.nhindirect.config.service.impl.ConfigurationServiceImpl)

Example 9 with ConfigurationServiceImpl

use of org.nhindirect.config.service.impl.ConfigurationServiceImpl in project nhin-d by DirectProject.

the class ConfigurationServiceTest method testAddCertificate.

/**
     * Test the addCertificate method.
     */
public void testAddCertificate() throws Exception {
    final CertificateService certificateService = context.mock(CertificateService.class);
    final Collection<Certificate> collection = Arrays.asList(new Certificate());
    context.checking(new Expectations() {

        {
            oneOf(certificateService).addCertificates(collection);
        }
    });
    ConfigurationServiceImpl service = new ConfigurationServiceImpl();
    service.setCertSvc(certificateService);
    try {
        service.addCertificates(collection);
    } catch (Exception e) {
        fail("Exception thrown");
    }
}
Also used : Expectations(org.jmock.Expectations) ConfigurationServiceImpl(org.nhindirect.config.service.impl.ConfigurationServiceImpl) Certificate(org.nhindirect.config.store.Certificate)

Example 10 with ConfigurationServiceImpl

use of org.nhindirect.config.service.impl.ConfigurationServiceImpl in project nhin-d by DirectProject.

the class ConfigurationServiceTest method testSetCertficateStatus.

/**
     * Test the setCertificateStatus method.
     */
public void testSetCertficateStatus() throws Exception {
    final CertificateService certificateService = context.mock(CertificateService.class);
    final Collection<Long> collection = Arrays.asList(2L, 3L);
    final EntityStatus status = EntityStatus.ENABLED;
    context.checking(new Expectations() {

        {
            oneOf(certificateService).setCertificateStatus(collection, status);
        }
    });
    ConfigurationServiceImpl service = new ConfigurationServiceImpl();
    service.setCertSvc(certificateService);
    try {
        service.setCertificateStatus(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)

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