Search in sources :

Example 16 with CertificateGetOptions

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

the class ConfigurationServiceTest method testListAnchors.

/**
     * Test the listAnchors method.
     */
public void testListAnchors() throws Exception {
    final AnchorService anchorService = context.mock(AnchorService.class);
    final long lastAnchorId = 3L;
    final int maxResults = 3;
    final CertificateGetOptions options = CertificateGetOptions.DEFAULT;
    context.checking(new Expectations() {

        {
            oneOf(anchorService).listAnchors(lastAnchorId, maxResults, options);
        }
    });
    ConfigurationServiceImpl service = new ConfigurationServiceImpl();
    service.setAnchorSvc(anchorService);
    try {
        service.listAnchors(lastAnchorId, maxResults, 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 17 with CertificateGetOptions

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

the class ConfigurationServiceTest method testGetAnchor.

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

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

use of org.nhindirect.config.service.impl.CertificateGetOptions 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 19 with CertificateGetOptions

use of org.nhindirect.config.service.impl.CertificateGetOptions 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 20 with CertificateGetOptions

use of org.nhindirect.config.service.impl.CertificateGetOptions 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)20 CertificateGetOptions (org.nhindirect.config.service.impl.CertificateGetOptions)20 ConfigurationServiceImpl (org.nhindirect.config.service.impl.ConfigurationServiceImpl)10 AnchorServiceImpl (org.nhindirect.config.service.impl.AnchorServiceImpl)6 Anchor (org.nhindirect.config.store.Anchor)6 AnchorDao (org.nhindirect.config.store.dao.AnchorDao)6 CertificateServiceImpl (org.nhindirect.config.service.impl.CertificateServiceImpl)4 Certificate (org.nhindirect.config.store.Certificate)4 CertificateDao (org.nhindirect.config.store.dao.CertificateDao)4 ArrayList (java.util.ArrayList)1