I've been having trouble with getAuthenticatedContributor(). It query for a id that doens't exist in DB.
throws TeamRepositoryException {
......
IQueryService queryService = getService(IQueryService.class);
WorkItemQueryModel queryModel = BaseWorkItemQueryModel.WorkItemQueryModel.ROOT;
IItemQuery itemQuery = IItemQuery.FACTORY.newInstance(queryModel);
IContributorHandle contributor = getAuthenticatedContributor(); itemQuery.filter(queryModel.owner()._eq(itemQuery.newItemHandleArg()));
IItemQueryPage itemQueryPage = queryService.queryItems(itemQuery, new Object[]{contributor}, IQueryService.ITEM_QUERY_MAX_PAGE_SIZE)
IRepositoryItemService repositoryItemService = getService(IRepositoryItemService.class);
IItem[] items = repositoryItemService.fetchItems(itemQueryPage.handlesAsArray(), null);
List<IItem> wis = Arrays.asList(items);
return (IWorkItemHandle[]) wis.toArray(new IWorkItemHandle[wis.size()]);
...
And the unit test class:
The class AbstractSaturnoRemoteServiceTestCase extends AbstractRemoteServiceTestCase
public class SaturnoServiceTest extends AbstractSaturnoRemoteServiceTestCase{ ...... }