Search in sources :

Example 36 with ConfigurationServiceImpl

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

the class ConfigurationServiceTest method testAddSetting.

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

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

Example 37 with ConfigurationServiceImpl

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

the class ConfigurationServiceTest method testGetAnchors.

/**
     * Test the getAnchors method.
     */
public void testGetAnchors() throws Exception {
    final AnchorService anchorService = context.mock(AnchorService.class);
    final Collection<Long> anchorIds = Arrays.asList(3L, 4L);
    final CertificateGetOptions options = CertificateGetOptions.DEFAULT;
    context.checking(new Expectations() {

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

Example 38 with ConfigurationServiceImpl

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

the class ConfigurationServiceTest method testGetIncomingAnchors.

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

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

Example 39 with ConfigurationServiceImpl

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

the class ConfigurationServiceTest method testUpdateSetting.

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

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

Example 40 with ConfigurationServiceImpl

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

the class ConfigurationServiceTest method testGetOutgoingAnchors.

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

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