@Test
public void sendTwitterMessageWithTwitterExceptionCausedByUnauthorized() throws Exception {
DateTime now = TimeUtil.getCurrentDateTime();
TimeUtil.setCurrentDateTime(now);
HttpResponse res = mock(HttpResponse.class);
doReturn(401).when(res).getStatusCode();
doReturn(null).when(res).getResponseHeader(eq("X-RateLimit-Limit"));
doReturn(null).when(res).getResponseHeader(eq("X-RateLimit-Remaining"));
doReturn(null).when(res).getResponseHeader(eq("X-RateLimit-Reset"));
doThrow(new TwitterException("message", res)).when(PartakeApp.getTwitterService()).updateStatus(anyString(), anyString(), eq(TWITTER_MESSAGE_WILLFAIL_MESSAGE));