Search in sources :

Example 11 with ConfigurationServiceImpl

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

the class ConfigurationServiceTest method testGetCertificates.

/**
     * Test the getCertificates method.
     */
public void testGetCertificates() throws Exception {
    final CertificateService certificateService = context.mock(CertificateService.class);
    final Collection<Long> certIds = Arrays.asList(4L, 5L);
    final CertificateGetOptions certificateGetOptions = CertificateGetOptions.DEFAULT;
    context.checking(new Expectations() {

        {
            oneOf(certificateService).getCertificates(certIds, certificateGetOptions);
        }
    });
    ConfigurationServiceImpl service = new ConfigurationServiceImpl();
    service.setCertSvc(certificateService);
    try {
        service.getCertificates(certIds, certificateGetOptions);
    } 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 12 with ConfigurationServiceImpl

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

the class ConfigurationServiceTest method testRemoveCertificatesForOwner.

/**
     * Test the removeCertificatesForOwner method.
     */
public void testRemoveCertificatesForOwner() throws Exception {
    final CertificateService certificateService = context.mock(CertificateService.class);
    final String owner = "owner";
    context.checking(new Expectations() {

        {
            oneOf(certificateService).removeCertificatesForOwner(owner);
        }
    });
    ConfigurationServiceImpl service = new ConfigurationServiceImpl();
    service.setCertSvc(certificateService);
    try {
        service.removeCertificatesForOwner(owner);
    } catch (Exception e) {
        fail("Exception thrown");
    }
}
Also used : Expectations(org.jmock.Expectations) ConfigurationServiceImpl(org.nhindirect.config.service.impl.ConfigurationServiceImpl)

Example 13 with ConfigurationServiceImpl

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

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

the class ConfigurationServiceTest method testContains.

/**
     * Test the contains method.
     */
public void testContains() throws Exception {
    final CertificateService certificateService = context.mock(CertificateService.class);
    final Certificate certificate = new Certificate();
    context.checking(new Expectations() {

        {
            oneOf(certificateService).contains(certificate);
        }
    });
    ConfigurationServiceImpl service = new ConfigurationServiceImpl();
    service.setCertSvc(certificateService);
    try {
        service.contains(certificate);
    } catch (Exception e) {
        fail("Exception thrown");
    }
}
Also used : Expectations(org.jmock.Expectations) ConfigurationServiceImpl(org.nhindirect.config.service.impl.ConfigurationServiceImpl) Certificate(org.nhindirect.config.store.Certificate)

Example 15 with ConfigurationServiceImpl

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

the class ConfigurationServiceTest method testListCertificates.

/**
     * Test the listCertificates method.
     */
public void testListCertificates() throws Exception {
    final CertificateService certificateService = context.mock(CertificateService.class);
    final long lastCertificateId = 3L;
    final int maxResults = 3;
    final CertificateGetOptions options = CertificateGetOptions.DEFAULT;
    context.checking(new Expectations() {

        {
            oneOf(certificateService).listCertificates(lastCertificateId, maxResults, options);
        }
    });
    ConfigurationServiceImpl service = new ConfigurationServiceImpl();
    service.setCertSvc(certificateService);
    try {
        service.listCertificates(lastCertificateId, 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)

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