@@ -0,0 +1,1682 @@
+package com.github.mtzw.twitter;%0D%0A%0D%0Aimport static org.hamcrest.CoreMatchers.*;%0D%0Aimport static org.junit.Assert.*;%0D%0Aimport static org.mockito.Mockito.*;%0D%0A%0D%0Aimport java.util.ArrayList;%0D%0A%0D%0Aimport org.junit.Test;%0D%0A%0D%0Aimport twitter4j.RateLimitStatus;%0D%0Aimport twitter4j.ResponseList;%0D%0Aimport twitter4j.Twitter;%0D%0Aimport twitter4j.TwitterException;%0D%0Aimport twitter4j.TwitterStream;%0D%0A%0D%0Apublic class GatewayTest %7B%0D%0A%0D%0A%09Gateway IMPL = new Gateway() %7B%0D%0A%0D%0A%09%09@Override%0D%0A%09%09public Twitter twitter() %7B%0D%0A%09%09%09Twitter mock = mock(Twitter.class);%0D%0A%09%09%09try %7B%0D%0A%09%09%09%09when(mock.getHomeTimeline()).thenReturn(new ListForTesting%3C%3E());%0D%0A%09%09%09%09when(mock.getScreenName()).thenReturn(%22GatewayTest%22);%0D%0A%09%09%09%7D catch (TwitterException e) %7B%0D%0A%09%09%09%09e.printStackTrace();%0D%0A%09%09%09%7D%0D%0A%09%09%09return mock;%0D%0A%09%09%7D%0D%0A%0D%0A%09%09@Override%0D%0A%09%09public TwitterStream twitterStream() %7B%0D%0A%09%09%09return mock(TwitterStream.class);%0D%0A%09%09%7D%0D%0A%0D%0A%09%7D;%0D%0A%0D%0A%09@Test%0D%0A%09public void testTwitter_getHomeTimeline() %7B%0D%0A%09%09try %7B%0D%0A%09%09%09assertThat(IMPL.twitter().getHomeTimeline(), is(notNullValue()));%0D%0A%09%09%7D catch (TwitterException e) %7B%0D%0A%09%09%09fail();%0D%0A%09%09%7D%0D%0A%09%7D%0D%0A%0D%0A%09@Test%0D%0A%09public void testTwitter_getScreenName() %7B%0D%0A%09%09try %7B%0D%0A%09%09%09assertThat(IMPL.twitter().getScreenName(), is(%22GatewayTest%22));%0D%0A%09%09%7D catch (TwitterException e) %7B%0D%0A%09%09%09fail();%0D%0A%09%09%7D%0D%0A%09%7D%0D%0A%0D%0A%09@Test%0D%0A%09public void testTwitterStream() %7B%0D%0A%09%09try %7B%0D%0A%09%09%09IMPL.twitterStream().user();%0D%0A%09%09%7D catch (Exception e) %7B%0D%0A%09%09%09fail();%0D%0A%09%09%7D%0D%0A%09%7D%0D%0A%0D%0A%09class ListForTesting%3CStatus%3E extends ArrayList%3CStatus%3E implements%0D%0A%09%09%09ResponseList%3CStatus%3E %7B%0D%0A%09%09private static final long serialVersionUID = 1L;%0D%0A%0D%0A%09%09@Override%0D%0A%09%09public int getAccessLevel() %7B%0D%0A%09%09%09return 0;%0D%0A%09%09%7D%0D%0A%0D%0A%09%09@Override%0D%0A%09%09public RateLimitStatus getRateLimitStatus() %7B%0D%0A%09%09%09return null;%0D%0A%09%09%7D%0D%0A%09%7D%0D%0A%0D%0A%7D%0D%0A

add test