throws ServiceCallException, HttpErrorException
{
Configuration config = new Configuration(maxIds, 0);
SyncFolderItemsType syncItems = SyncFolderItemsHelper.getSyncFolderItemsRequest(config, folder);
SyncFolderItemsResponseType syncItemsResponse = mock(SyncFolderItemsResponseType.class);
ArrayOfResponseMessagesType arrayOfResponseMessages = mock(ArrayOfResponseMessagesType.class);
SyncFolderItemsResponseMessageType syncFolderItemsResponseMessage =
mock(SyncFolderItemsResponseMessageType.class);
SyncFolderItemsChangesType syncFolderItemsChanges = mock(SyncFolderItemsChangesType.class);
LOG.debug("Expecting SyncFolderItems with User:{} Request:\n{}", folder.getUser(), syncItems);
when(service.syncFolderItems(likeThis(syncItems), eq(folder.getUser()))).thenReturn(syncItemsResponse);
when(syncItemsResponse.getResponseMessages()).thenReturn(arrayOfResponseMessages);
when(arrayOfResponseMessages.getSyncFolderItemsResponseMessageArray())
.thenReturn(new SyncFolderItemsResponseMessageType[]{syncFolderItemsResponseMessage});
when(syncFolderItemsResponseMessage.getResponseCode()).thenReturn(ResponseCodeType.NO_ERROR);
when(syncFolderItemsResponseMessage.isSetIncludesLastItemInRange()).thenReturn(true);
when(syncFolderItemsResponseMessage.getIncludesLastItemInRange()).thenReturn(includesLastItemInRange);