use of org.nhindirect.config.service.impl.ConfigurationServiceImpl in project nhin-d by DirectProject.
the class ConfigurationServiceTest method testAddAddress.
/**
* Test the addAddress method.
*/
public void testAddAddress() throws Exception {
final AddressService addressService = context.mock(AddressService.class);
final Collection<Address> collection = Arrays.asList(new Address(new Domain("domain"), "address"));
context.checking(new Expectations() {
{
oneOf(addressService).addAddress(collection);
}
});
ConfigurationServiceImpl service = new ConfigurationServiceImpl();
service.setAddressSvc(addressService);
try {
service.addAddress(collection);
} catch (Exception e) {
fail("Exception thrown");
}
}
use of org.nhindirect.config.service.impl.ConfigurationServiceImpl in project nhin-d by DirectProject.
the class ConfigurationServiceTest method testAddAnchors.
/**
* Test the addAnchors method.
*/
public void testAddAnchors() throws Exception {
final AnchorService anchorService = context.mock(AnchorService.class);
final Collection<Anchor> collection = Arrays.asList(new Anchor());
context.checking(new Expectations() {
{
oneOf(anchorService).addAnchors(collection);
}
});
ConfigurationServiceImpl service = new ConfigurationServiceImpl();
service.setAnchorSvc(anchorService);
try {
service.addAnchors(collection);
} catch (Exception e) {
fail("Exception thrown");
}
}
use of org.nhindirect.config.service.impl.ConfigurationServiceImpl in project nhin-d by DirectProject.
the class ConfigurationServiceTest method testDeleteSetting.
/**
* Test the deleteSetting method.
*/
public void testDeleteSetting() throws Exception {
final SettingService settingService = context.mock(SettingService.class);
final Collection<String> names = Arrays.asList(UUID.randomUUID().toString());
context.checking(new Expectations() {
{
oneOf(settingService).deleteSetting(names);
}
});
ConfigurationServiceImpl service = new ConfigurationServiceImpl();
service.setSettingSvc(settingService);
try {
service.deleteSetting(names);
} catch (Exception e) {
fail("Exception thrown");
}
}
use of org.nhindirect.config.service.impl.ConfigurationServiceImpl in project nhin-d by DirectProject.
the class ConfigurationServiceTest method testListAddress.
/**
* Test the listAddress method.
*/
public void testListAddress() throws Exception {
final AddressService addressService = context.mock(AddressService.class);
final String lastAddressName = "address";
final int maxResults = 1;
context.checking(new Expectations() {
{
oneOf(addressService).listAddresss(lastAddressName, maxResults);
}
});
ConfigurationServiceImpl service = new ConfigurationServiceImpl();
service.setAddressSvc(addressService);
try {
service.listAddresss(lastAddressName, maxResults);
} catch (Exception e) {
fail("Exception thrown");
}
}
use of org.nhindirect.config.service.impl.ConfigurationServiceImpl in project nhin-d by DirectProject.
the class ConfigurationServiceTest method testGetAnchor.
/**
* Test the getAnchor method.
*/
public void testGetAnchor() throws Exception {
final AnchorService anchorService = context.mock(AnchorService.class);
final String owner = "owner";
final String thumbprint = "thumbprint";
final CertificateGetOptions options = CertificateGetOptions.DEFAULT;
context.checking(new Expectations() {
{
oneOf(anchorService).getAnchor(owner, thumbprint, options);
}
});
ConfigurationServiceImpl service = new ConfigurationServiceImpl();
service.setAnchorSvc(anchorService);
try {
service.getAnchor(owner, thumbprint, options);
} catch (Exception e) {
fail("Exception thrown");
}
}
Aggregations