Search in sources :

Example 1 with ConfigurationServiceImpl

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

the class ConfigurationServiceTest method testGetDomain.

/**
     * Test the getDomain method.
     */
public void testGetDomain() throws Exception {
    final DomainService domainService = context.mock(DomainService.class);
    final long domainId = 4L;
    context.checking(new Expectations() {

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

Example 2 with ConfigurationServiceImpl

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

the class ConfigurationServiceTest method testGetDomainCount.

/**
     * Test the getDomainCount method.
     */
public void testGetDomainCount() throws Exception {
    final DomainService domainService = context.mock(DomainService.class);
    context.checking(new Expectations() {

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

Example 3 with ConfigurationServiceImpl

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

the class ConfigurationServiceTest method testSetAnchorStatusForOwner.

/**
     * Test the setAnchorStatusForOwner method.
     */
public void testSetAnchorStatusForOwner() throws Exception {
    final AnchorService anchorService = context.mock(AnchorService.class);
    final String owner = "owner";
    final EntityStatus status = EntityStatus.ENABLED;
    context.checking(new Expectations() {

        {
            oneOf(anchorService).setAnchorStatusForOwner(owner, status);
        }
    });
    ConfigurationServiceImpl service = new ConfigurationServiceImpl();
    service.setAnchorSvc(anchorService);
    try {
        service.setAnchorStatusForOwner(owner, 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 4 with ConfigurationServiceImpl

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

the class ConfigurationServiceTest method testSetCertificateStatusForOwner.

/**
     * Test the setCertificateStatusForOwner method.
     */
public void testSetCertificateStatusForOwner() throws Exception {
    final CertificateService certificateService = context.mock(CertificateService.class);
    final String owner = "owner";
    final EntityStatus status = EntityStatus.ENABLED;
    context.checking(new Expectations() {

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

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

the class ConfigurationServiceTest method testGetAnchorsForOwner.

/**
     * Test the getAnchorsForOwner method.
     */
public void testGetAnchorsForOwner() throws Exception {
    final AnchorService anchorService = context.mock(AnchorService.class);
    final String owner = "owner";
    final CertificateGetOptions options = CertificateGetOptions.DEFAULT;
    context.checking(new Expectations() {

        {
            oneOf(anchorService).getAnchorsForOwner(owner, options);
        }
    });
    ConfigurationServiceImpl service = new ConfigurationServiceImpl();
    service.setAnchorSvc(anchorService);
    try {
        service.getAnchorsForOwner(owner, 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