@Test
public void shouldGetResourceFromDocsService() throws IOException, ServiceException {
DocsService service = mock(DocsService.class);
DocumentListFeed feed = mock(DocumentListFeed.class);
DocumentListEntry entry = mock(DocumentListEntry.class);
MediaSource mediaSource = mock(MediaSource.class);
InputStream inputStream = mock(InputStream.class);
final MediaContent content = mock(MediaContent.class);
final DocumentQuery query = mock(DocumentQuery.class);
when(service.getFeed(query, DocumentListFeed.class)).thenReturn(feed);
when(service.getMedia(content)).thenReturn(mediaSource);
when(feed.getEntries()).thenReturn(asList(entry));
when(entry.getContent()).thenReturn(content);
when(content.getUri()).thenReturn("http://docs.google.com");
when(mediaSource.getInputStream()).thenReturn(inputStream);
LoadOdtFromGoogle storyLoader = new LoadOdtFromGoogle("user", "password", "https://docs.google.com/feeds/default/private/full/", service){