Search in sources :

Example 16 with ConfigurationServiceImpl

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

the class ConfigurationServiceTest method testRemoveAnchors.

/**
     * Test the removeAnchors method.
     */
public void testRemoveAnchors() throws Exception {
    final AnchorService anchorService = context.mock(AnchorService.class);
    final Collection<Long> collection = Arrays.asList(3L, 4L);
    context.checking(new Expectations() {

        {
            oneOf(anchorService).removeAnchors(collection);
        }
    });
    ConfigurationServiceImpl service = new ConfigurationServiceImpl();
    service.setAnchorSvc(anchorService);
    try {
        service.removeAnchors(collection);
    } catch (Exception e) {
        fail("Exception thrown");
    }
}
Also used : Expectations(org.jmock.Expectations) ConfigurationServiceImpl(org.nhindirect.config.service.impl.ConfigurationServiceImpl)

Example 17 with ConfigurationServiceImpl

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

the class ConfigurationServiceTest method testGetCertificate.

/**
     * Test the getCertificate method.
     */
public void testGetCertificate() throws Exception {
    final CertificateService certificateService = context.mock(CertificateService.class);
    final String owner = "owner";
    final String thumbprint = "thumbprint";
    final CertificateGetOptions certificateGetOptions = CertificateGetOptions.DEFAULT;
    context.checking(new Expectations() {

        {
            oneOf(certificateService).getCertificate(owner, thumbprint, certificateGetOptions);
        }
    });
    ConfigurationServiceImpl service = new ConfigurationServiceImpl();
    service.setCertSvc(certificateService);
    try {
        service.getCertificate(owner, thumbprint, 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 18 with ConfigurationServiceImpl

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

the class ConfigurationServiceTest method testGetCertificatesForOwner.

/**
     * Test the getCertificatesForOwner method.
     */
public void testGetCertificatesForOwner() throws Exception {
    final CertificateService certificateService = context.mock(CertificateService.class);
    final String owner = "owner";
    final CertificateGetOptions certificateGetOptions = CertificateGetOptions.DEFAULT;
    context.checking(new Expectations() {

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

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

the class ConfigurationServiceTest method testUpdateAddress.

/**
     * Test the updateAddress method.
     */
public void testUpdateAddress() throws Exception {
    final AddressService addressService = context.mock(AddressService.class);
    final Address address = new Address(new Domain("domain"), "address");
    context.checking(new Expectations() {

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

Example 20 with ConfigurationServiceImpl

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

the class ConfigurationServiceTest method testGetAddressCount.

/**
     * Test the getAddressCount method.
     */
public void testGetAddressCount() throws Exception {
    final AddressService addressService = context.mock(AddressService.class);
    context.checking(new Expectations() {

        {
            oneOf(addressService).getAddressCount();
        }
    });
    ConfigurationServiceImpl service = new ConfigurationServiceImpl();
    service.setAddressSvc(addressService);
    try {
        service.getAddressCount();
    } 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