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){
@Override
DocumentQuery documentQuery(String title) throws MalformedURLException {
return query;
}
@Override
protected MediaContent mediaContent(String url) {
return content;
}
};
InputStream resourceStream = storyLoader.resourceAsStream("a_story");
MatcherAssert.assertThat(resourceStream, Matchers.equalTo(inputStream));
}