use of org.nhindirect.config.store.EntityStatus 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.store.EntityStatus in project nhin-d by DirectProject.
the class AnchorServiceTest method testSetAnchorStatusForOwner.
/**
* Test the setAnchorStatusForOwner method.
*/
public void testSetAnchorStatusForOwner() {
final AnchorDao anchorDao = context.mock(AnchorDao.class);
final String owner = "beau";
final EntityStatus status = EntityStatus.ENABLED;
final Anchor anchor = new Anchor();
anchor.setOwner(owner);
context.checking(new Expectations() {
{
oneOf(anchorDao).setStatus(owner, status);
}
});
AnchorServiceImpl service = new AnchorServiceImpl();
service.setDao(anchorDao);
try {
service.setAnchorStatusForOwner(owner, status);
} catch (Exception e) {
fail("Exception thrown");
}
}
use of org.nhindirect.config.store.EntityStatus in project nhin-d by DirectProject.
the class DomainServiceTest method testSearchDomain.
/**
* Test the searchDomain method.
*/
public void testSearchDomain() {
final DomainDao domainDao = context.mock(DomainDao.class);
final String domainName = "domain.com";
final EntityStatus status = EntityStatus.ENABLED;
final List<Domain> expected = Arrays.asList(new Domain());
final List<Domain> expectedNull = null;
context.checking(new Expectations() {
{
oneOf(domainDao).searchDomain(domainName, status);
will(returnValue(expected));
oneOf(domainDao).searchDomain(domainName, status);
will(returnValue(expectedNull));
}
});
DomainServiceImpl service = new DomainServiceImpl();
service.setDao(domainDao);
try {
service.searchDomain(domainName, status);
service.searchDomain(domainName, status);
} catch (Exception e) {
fail("Exception thrown");
}
}
use of org.nhindirect.config.store.EntityStatus in project nhin-d by DirectProject.
the class DomainServiceTest method testGetDomains.
/**
* Test the getDomains method.
*
* TODO: This test needs to be improved.
*/
@SuppressWarnings("unchecked")
public void testGetDomains() {
final DomainDao domainDao = context.mock(DomainDao.class);
final Collection<String> domainNames = Arrays.asList("domain.com", "domain2.com");
final EntityStatus status = EntityStatus.ENABLED;
context.checking(new Expectations() {
{
oneOf(domainDao).getDomains(with(any(List.class)), with(any(EntityStatus.class)));
}
});
DomainServiceImpl service = new DomainServiceImpl();
service.setDao(domainDao);
try {
service.getDomains(domainNames, status);
} catch (Exception e) {
fail("Exception thrown");
}
}
use of org.nhindirect.config.store.EntityStatus in project nhin-d by DirectProject.
the class ConfigurationServiceTest method testGetDomains.
/**
* Test the getDomains method.
*/
public void testGetDomains() throws Exception {
final DomainService domainService = context.mock(DomainService.class);
final Collection<String> collection = Arrays.asList("domain1", "domain2");
final EntityStatus status = EntityStatus.ENABLED;
context.checking(new Expectations() {
{
oneOf(domainService).getDomains(collection, status);
}
});
ConfigurationServiceImpl service = new ConfigurationServiceImpl();
service.setDomainSvc(domainService);
try {
service.getDomains(collection, status);
} catch (Exception e) {
fail("Exception thrown");
}
}
Aggregations