use of org.nhindirect.config.service.impl.ConfigurationServiceImpl in project nhin-d by DirectProject.
the class ConfigurationServiceTest method testGetCertificates.
/**
* Test the getCertificates method.
*/
public void testGetCertificates() throws Exception {
final CertificateService certificateService = context.mock(CertificateService.class);
final Collection<Long> certIds = Arrays.asList(4L, 5L);
final CertificateGetOptions certificateGetOptions = CertificateGetOptions.DEFAULT;
context.checking(new Expectations() {
{
oneOf(certificateService).getCertificates(certIds, certificateGetOptions);
}
});
ConfigurationServiceImpl service = new ConfigurationServiceImpl();
service.setCertSvc(certificateService);
try {
service.getCertificates(certIds, certificateGetOptions);
} catch (Exception e) {
fail("Exception thrown");
}
}
use of org.nhindirect.config.service.impl.ConfigurationServiceImpl in project nhin-d by DirectProject.
the class ConfigurationServiceTest method testRemoveCertificatesForOwner.
/**
* Test the removeCertificatesForOwner method.
*/
public void testRemoveCertificatesForOwner() throws Exception {
final CertificateService certificateService = context.mock(CertificateService.class);
final String owner = "owner";
context.checking(new Expectations() {
{
oneOf(certificateService).removeCertificatesForOwner(owner);
}
});
ConfigurationServiceImpl service = new ConfigurationServiceImpl();
service.setCertSvc(certificateService);
try {
service.removeCertificatesForOwner(owner);
} catch (Exception e) {
fail("Exception thrown");
}
}
use of org.nhindirect.config.service.impl.ConfigurationServiceImpl in project nhin-d by DirectProject.
the class ConfigurationServiceTest method testGetAddresses.
/**
* Test the getAddresses method.
*/
public void testGetAddresses() throws Exception {
final AddressService addressService = context.mock(AddressService.class);
final Collection<String> collection = Arrays.asList("address1", "address2");
final EntityStatus status = EntityStatus.ENABLED;
context.checking(new Expectations() {
{
oneOf(addressService).getAddress(collection, status);
}
});
ConfigurationServiceImpl service = new ConfigurationServiceImpl();
service.setAddressSvc(addressService);
try {
service.getAddress(collection, status);
} catch (Exception e) {
fail("Exception thrown");
}
}
use of org.nhindirect.config.service.impl.ConfigurationServiceImpl in project nhin-d by DirectProject.
the class ConfigurationServiceTest method testContains.
/**
* Test the contains method.
*/
public void testContains() throws Exception {
final CertificateService certificateService = context.mock(CertificateService.class);
final Certificate certificate = new Certificate();
context.checking(new Expectations() {
{
oneOf(certificateService).contains(certificate);
}
});
ConfigurationServiceImpl service = new ConfigurationServiceImpl();
service.setCertSvc(certificateService);
try {
service.contains(certificate);
} catch (Exception e) {
fail("Exception thrown");
}
}
use of org.nhindirect.config.service.impl.ConfigurationServiceImpl in project nhin-d by DirectProject.
the class ConfigurationServiceTest method testListCertificates.
/**
* Test the listCertificates method.
*/
public void testListCertificates() throws Exception {
final CertificateService certificateService = context.mock(CertificateService.class);
final long lastCertificateId = 3L;
final int maxResults = 3;
final CertificateGetOptions options = CertificateGetOptions.DEFAULT;
context.checking(new Expectations() {
{
oneOf(certificateService).listCertificates(lastCertificateId, maxResults, options);
}
});
ConfigurationServiceImpl service = new ConfigurationServiceImpl();
service.setCertSvc(certificateService);
try {
service.listCertificates(lastCertificateId, maxResults, options);
} catch (Exception e) {
fail("Exception thrown");
}
}
Aggregations