Search in sources :

Example 31 with ConfigurationServiceImpl

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

the class ConfigurationServiceTest method testUpdateDomain.

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

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

Example 32 with ConfigurationServiceImpl

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

the class ConfigurationServiceTest method testGetAllSettings.

/**
     * Test the getAllSettings method.
     */
public void testGetAllSettings() throws Exception {
    final SettingService settingService = context.mock(SettingService.class);
    context.checking(new Expectations() {

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

Example 33 with ConfigurationServiceImpl

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

the class ConfigurationServiceTest method testRemoveAddress.

/**
     * Test the removeAddress method.
     */
public void testRemoveAddress() throws Exception {
    final AddressService addressService = context.mock(AddressService.class);
    final String addressName = "address";
    context.checking(new Expectations() {

        {
            oneOf(addressService).removeAddress(addressName);
        }
    });
    ConfigurationServiceImpl service = new ConfigurationServiceImpl();
    service.setAddressSvc(addressService);
    try {
        service.removeAddress(addressName);
    } catch (Exception e) {
        fail("Exception thrown");
    }
}
Also used : Expectations(org.jmock.Expectations) ConfigurationServiceImpl(org.nhindirect.config.service.impl.ConfigurationServiceImpl)

Example 34 with ConfigurationServiceImpl

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

the class ConfigurationServiceTest method testGetSettingByName.

/**
     * Test the getSettingByName method.
     */
public void testGetSettingByName() throws Exception {
    final SettingService settingService = context.mock(SettingService.class);
    final String name = UUID.randomUUID().toString();
    context.checking(new Expectations() {

        {
            oneOf(settingService).getSettingByName(name);
        }
    });
    ConfigurationServiceImpl service = new ConfigurationServiceImpl();
    service.setSettingSvc(settingService);
    try {
        service.getSettingByName(name);
    } catch (Exception e) {
        fail("Exception thrown");
    }
}
Also used : Expectations(org.jmock.Expectations) ConfigurationServiceImpl(org.nhindirect.config.service.impl.ConfigurationServiceImpl)

Example 35 with ConfigurationServiceImpl

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

the class ConfigurationServiceTest method testListDomains.

/**
     * Test the listDomains method.
     */
public void testListDomains() throws Exception {
    final DomainService domainService = context.mock(DomainService.class);
    final String lastDomainName = "domain";
    final int maxResults = 2;
    context.checking(new Expectations() {

        {
            oneOf(domainService).listDomains(lastDomainName, maxResults);
        }
    });
    ConfigurationServiceImpl service = new ConfigurationServiceImpl();
    service.setDomainSvc(domainService);
    try {
        service.listDomains(lastDomainName, maxResults);
    } catch (Exception e) {
        fail("Exception thrown");
    }
}
Also used : Expectations(org.jmock.Expectations) 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