use of org.nhindirect.config.store.dao.AnchorDao in project nhin-d by DirectProject.
the class AnchorServiceTest method testGetOutgoingAnchors.
/**
* Test the getIncomingAnchors method.
*/
public void testGetOutgoingAnchors() {
final AnchorDao anchorDao = context.mock(AnchorDao.class);
final String owner = "beau";
final CertificateGetOptions certificateOptions = CertificateGetOptions.DEFAULT;
final List<String> owners = Arrays.asList(owner);
context.checking(new Expectations() {
{
oneOf(anchorDao).list(owners);
}
});
AnchorServiceImpl service = new AnchorServiceImpl();
service.setDao(anchorDao);
try {
Collection<Anchor> output = service.getOutgoingAnchors(owner, certificateOptions);
assertEquals("Output does not match expected", Collections.emptyList(), output);
} catch (Exception e) {
fail("Exception thrown");
}
}
use of org.nhindirect.config.store.dao.AnchorDao in project nhin-d by DirectProject.
the class AnchorServiceTest method testGetAnchor.
/**
* Test the getAnchor method.
*/
public void testGetAnchor() {
final AnchorDao anchorDao = context.mock(AnchorDao.class);
final String owner = "beau";
final String thumbprint = "thumbprint";
CertificateGetOptions certificateOptions = CertificateGetOptions.DEFAULT;
final List<String> owners = Arrays.asList(owner);
context.checking(new Expectations() {
{
oneOf(anchorDao).list(owners);
}
});
AnchorServiceImpl service = new AnchorServiceImpl();
service.setDao(anchorDao);
try {
Anchor output = service.getAnchor(owner, thumbprint, certificateOptions);
assertEquals("Output does not match expected", null, output);
} catch (Exception e) {
fail("Exception thrown");
}
}
Aggregations