osgiServiceMock = mock(DefaultOsgiUtilsService.class);
final List<DomainProvider> domainProviders = new ArrayList<DomainProvider>();
final List<Domain> domainEndpoints = new ArrayList<Domain>();
Domain domainEndpoint = new NullDomainImpl("id");
domainEndpoints.add(domainEndpoint);
DomainProvider domainProviderMock = mock(DomainProvider.class);
when(domainProviderMock.getDomainInterface()).thenAnswer(new Answer<Class<? extends Domain>>() {
@Override
public Class<? extends Domain> answer(InvocationOnMock invocationOnMock) throws Throwable {
return NullDomain.class;
}
});
LocalizableString descriptionMock = mock(LocalizableString.class);
LocalizableString nameDescritptionMock = mock(LocalizableString.class);
when(descriptionMock.getString(any(Locale.class))).thenReturn("Dummy description");
when(nameDescritptionMock.getString(any(Locale.class))).thenReturn("Dummy Name");
when(domainProviderMock.getDescription()).thenReturn(descriptionMock);
when(domainProviderMock.getName()).thenReturn(nameDescritptionMock);
domainProviders.add(domainProviderMock);
when(osgiServiceMock.listServices(DomainProvider.class)).thenAnswer(new Answer<List<DomainProvider>>() {
@Override
public List<DomainProvider> answer(InvocationOnMock invocationOnMock) throws Throwable {