use of org.nhindirect.config.store.dao.DNSDao in project nhin-d by DirectProject.
the class DNSServiceTest method testGetDNSByName.
/**
* Test the getDNSByName method.
*/
public void testGetDNSByName() {
final DNSDao dnsDao = context.mock(DNSDao.class);
final String name = "example.domain.com";
context.checking(new Expectations() {
{
oneOf(dnsDao).get(name);
}
});
DNSServiceImpl service = new DNSServiceImpl();
service.setDao(dnsDao);
try {
service.getDNSByName(name);
} catch (Exception e) {
fail("Exception thrown");
}
}
use of org.nhindirect.config.store.dao.DNSDao in project nhin-d by DirectProject.
the class DNSServiceTest method testGetDNSByRecordIds.
/**
* Test the getDNSByRecordIds method.
*/
public void testGetDNSByRecordIds() {
final DNSDao dnsDao = context.mock(DNSDao.class);
final long[] recIds = new long[] { 8387 };
context.checking(new Expectations() {
{
oneOf(dnsDao).get(recIds);
}
});
DNSServiceImpl service = new DNSServiceImpl();
service.setDao(dnsDao);
try {
service.getDNSByRecordIds(recIds);
} catch (Exception e) {
fail("Exception thrown");
}
}
use of org.nhindirect.config.store.dao.DNSDao in project nhin-d by DirectProject.
the class DNSServiceTest method testRemoveDNSByRecordId.
/**
* Test the removeDNSByRecordId method.
*/
public void testRemoveDNSByRecordId() {
final DNSDao dnsDao = context.mock(DNSDao.class);
final long recId = 8387;
context.checking(new Expectations() {
{
oneOf(dnsDao).remove(recId);
}
});
DNSServiceImpl service = new DNSServiceImpl();
service.setDao(dnsDao);
try {
service.removeDNSByRecordId(recId);
} catch (Exception e) {
fail("Exception thrown");
}
}
Aggregations