Search in sources :

Example 6 with AddressDao

use of org.nhindirect.config.store.dao.AddressDao in project nhin-d by DirectProject.

the class AddressServiceTest method testUpdateAddress.

/**
     * Test the updateAddress method.
     */
public void testUpdateAddress() {
    final AddressDao addressDao = context.mock(AddressDao.class);
    final Address address = new Address();
    context.checking(new Expectations() {

        {
        // TODO
        }
    });
    AddressServiceImpl service = new AddressServiceImpl();
    service.setDao(addressDao);
    try {
        service.updateAddress(address);
    } catch (Exception e) {
        fail("Exception thrown");
    }
}
Also used : Expectations(org.jmock.Expectations) AddressServiceImpl(org.nhindirect.config.service.impl.AddressServiceImpl) Address(org.nhindirect.config.store.Address) AddressDao(org.nhindirect.config.store.dao.AddressDao)

Example 7 with AddressDao

use of org.nhindirect.config.store.dao.AddressDao in project nhin-d by DirectProject.

the class AddressServiceTest method testAddAddress.

/**
     * Test the addAddress method.
     */
public void testAddAddress() {
    final AddressDao addressDao = context.mock(AddressDao.class);
    final Collection<Address> addresses = Arrays.asList(new Address(new Domain("healthdomain.com"), "beau@healthdomain.com"), new Address(new Domain("healthdomain2.com"), "beau@healthdomain2.com"));
    context.checking(new Expectations() {

        {
        // TODO
        }
    });
    AddressServiceImpl service = new AddressServiceImpl();
    service.setDao(addressDao);
    try {
        service.addAddress(addresses);
    } catch (Exception e) {
        fail("Exception thrown");
    }
}
Also used : Expectations(org.jmock.Expectations) AddressServiceImpl(org.nhindirect.config.service.impl.AddressServiceImpl) Address(org.nhindirect.config.store.Address) Domain(org.nhindirect.config.store.Domain) AddressDao(org.nhindirect.config.store.dao.AddressDao)

Example 8 with AddressDao

use of org.nhindirect.config.store.dao.AddressDao in project nhin-d by DirectProject.

the class AddressServiceTest method testListAddresss.

/**
     * Test the listAddresss method.
     */
public void testListAddresss() {
    final AddressDao addressDao = context.mock(AddressDao.class);
    final String lastAddressName = "lastAddressName.com";
    final int maxResults = 7;
    context.checking(new Expectations() {

        {
        // TODO
        }
    });
    AddressServiceImpl service = new AddressServiceImpl();
    service.setDao(addressDao);
    try {
        service.listAddresss(lastAddressName, maxResults);
    } catch (Exception e) {
        fail("Exception thrown");
    }
}
Also used : Expectations(org.jmock.Expectations) AddressServiceImpl(org.nhindirect.config.service.impl.AddressServiceImpl) AddressDao(org.nhindirect.config.store.dao.AddressDao)

Aggregations

AddressDao (org.nhindirect.config.store.dao.AddressDao)8 Expectations (org.jmock.Expectations)6 AddressServiceImpl (org.nhindirect.config.service.impl.AddressServiceImpl)6 Address (org.nhindirect.config.store.Address)4 ArrayList (java.util.ArrayList)3 Domain (org.nhindirect.config.store.Domain)3 Anchor (org.nhindirect.config.store.Anchor)2 CertPolicy (org.nhindirect.config.store.CertPolicy)2 CertPolicyGroup (org.nhindirect.config.store.CertPolicyGroup)2 Certificate (org.nhindirect.config.store.Certificate)2 DNSRecord (org.nhindirect.config.store.DNSRecord)2 Setting (org.nhindirect.config.store.Setting)2 TrustBundle (org.nhindirect.config.store.TrustBundle)2 AnchorDao (org.nhindirect.config.store.dao.AnchorDao)2 CertPolicyDao (org.nhindirect.config.store.dao.CertPolicyDao)2 CertificateDao (org.nhindirect.config.store.dao.CertificateDao)2 DNSDao (org.nhindirect.config.store.dao.DNSDao)2 DomainDao (org.nhindirect.config.store.dao.DomainDao)2 SettingDao (org.nhindirect.config.store.dao.SettingDao)2 TrustBundleDao (org.nhindirect.config.store.dao.TrustBundleDao)2