use of org.nhindirect.config.service.impl.AddressServiceImpl in project nhin-d by DirectProject.
the class AddressServiceTest method testRemoveAddress.
/**
* Test the removeAddress method.
*/
public void testRemoveAddress() {
final AddressDao addressDao = context.mock(AddressDao.class);
final String addressName = "beau@address.com";
context.checking(new Expectations() {
{
oneOf(addressDao).delete(addressName);
}
});
AddressServiceImpl service = new AddressServiceImpl();
service.setDao(addressDao);
try {
service.removeAddress(addressName);
} catch (Exception e) {
fail("Exception thrown");
}
}
use of org.nhindirect.config.service.impl.AddressServiceImpl in project nhin-d by DirectProject.
the class AddressServiceTest method testGetAddressCount.
/**
* Test the getAddressCount method.
*/
public void testGetAddressCount() {
final AddressDao addressDao = context.mock(AddressDao.class);
final int count = 0;
context.checking(new Expectations() {
{
oneOf(addressDao).count();
will(returnValue(count));
}
});
AddressServiceImpl service = new AddressServiceImpl();
service.setDao(addressDao);
try {
int output = service.getAddressCount();
assertEquals("Output does not match expected", count, output);
} catch (Exception e) {
fail("Exception thrown");
}
}
use of org.nhindirect.config.service.impl.AddressServiceImpl in project nhin-d by DirectProject.
the class AddressServiceTest method testGetAddress.
/**
* Test the getAddress method.
*/
public void testGetAddress() {
final AddressDao addressDao = context.mock(AddressDao.class);
final Collection<String> addresses = Arrays.asList("beau@healthdomain.com", "beau@helthdomain2.com");
final EntityStatus status = EntityStatus.ENABLED;
context.checking(new Expectations() {
{
oneOf(addressDao).listAddresses(with(equal(new ArrayList<String>(addresses))), with(same(status)));
}
});
AddressServiceImpl service = new AddressServiceImpl();
service.setDao(addressDao);
try {
service.getAddress(addresses, status);
} catch (Exception e) {
fail("Exception thrown");
}
}
use of org.nhindirect.config.service.impl.AddressServiceImpl 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");
}
}
use of org.nhindirect.config.service.impl.AddressServiceImpl 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");
}
}
Aggregations