Search in sources :

Example 1 with EntityStatus

use of org.nhindirect.config.store.EntityStatus in project nhin-d by DirectProject.

the class CertificateServiceTest method testSetCertificateStatusForOwner.

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

        {
            oneOf(certificateDao).setStatus(owner, status);
        }
    });
    CertificateServiceImpl service = new CertificateServiceImpl();
    service.setDao(certificateDao);
    try {
        service.setCertificateStatusForOwner(owner, status);
    } catch (Exception e) {
        fail("Exception thrown");
    }
}
Also used : Expectations(org.jmock.Expectations) CertificateDao(org.nhindirect.config.store.dao.CertificateDao) EntityStatus(org.nhindirect.config.store.EntityStatus) CertificateServiceImpl(org.nhindirect.config.service.impl.CertificateServiceImpl)

Example 2 with EntityStatus

use of org.nhindirect.config.store.EntityStatus 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)

Example 3 with EntityStatus

use of org.nhindirect.config.store.EntityStatus in project nhin-d by DirectProject.

the class ConfigurationServiceTest method testGetAddresses.

/**
     * Test the getAddresses method.
     */
public void testGetAddresses() throws Exception {
    final AddressService addressService = context.mock(AddressService.class);
    final Collection<String> collection = Arrays.asList("address1", "address2");
    final EntityStatus status = EntityStatus.ENABLED;
    context.checking(new Expectations() {

        {
            oneOf(addressService).getAddress(collection, status);
        }
    });
    ConfigurationServiceImpl service = new ConfigurationServiceImpl();
    service.setAddressSvc(addressService);
    try {
        service.getAddress(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 4 with EntityStatus

use of org.nhindirect.config.store.EntityStatus 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 5 with EntityStatus

use of org.nhindirect.config.store.EntityStatus 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)

Aggregations

EntityStatus (org.nhindirect.config.store.EntityStatus)12 Expectations (org.jmock.Expectations)10 ConfigurationServiceImpl (org.nhindirect.config.service.impl.ConfigurationServiceImpl)5 ArrayList (java.util.ArrayList)3 List (java.util.List)3 X509Certificate (java.security.cert.X509Certificate)2 Collection (java.util.Collection)2 HashMap (java.util.HashMap)2 DomainServiceImpl (org.nhindirect.config.service.impl.DomainServiceImpl)2 DomainDao (org.nhindirect.config.store.dao.DomainDao)2 Message (org.nhindirect.config.ui.flash.FlashMap.Message)2 AddressForm (org.nhindirect.config.ui.form.AddressForm)2 AnchorForm (org.nhindirect.config.ui.form.AnchorForm)2 CertificateForm (org.nhindirect.config.ui.form.CertificateForm)2 DNSEntryForm (org.nhindirect.config.ui.form.DNSEntryForm)2 DomainForm (org.nhindirect.config.ui.form.DomainForm)2 SearchDomainForm (org.nhindirect.config.ui.form.SearchDomainForm)2 SettingsForm (org.nhindirect.config.ui.form.SettingsForm)2 SimpleForm (org.nhindirect.config.ui.form.SimpleForm)2 PreAuthorize (org.springframework.security.access.prepost.PreAuthorize)2