public void testGetEntryInvalidUrl() throws Exception {
// Setup
URL badUrl = new URL("http://badUrl");
String errorMsg = "invalid URL";
EasyMock.expect(mockService.getEntry(badUrl, FeedServerEntry.class)).andThrow(
new IOException(errorMsg));
EasyMock.replay(mockService);
// Perform Test
try {
@SuppressWarnings("unused")
Map<String, Object> fetchedMap = feedServerClient.getEntry(badUrl);
} catch (FeedServerClientException e) {
assertTrue(e.getCause().getMessage().equals(errorMsg));
EasyMock.verify(mockService);
return;
}
fail("Did not get FeedServerClientException");
}
TypelessFeedServerClientTest.java 文件源码
java
阅读 15
收藏 0
点赞 0
评论 0
项目:google-feedserver
作者:
评论列表
文章目录