11package com .sailthru .client ;
22
33import com .google .common .collect .ImmutableMap ;
4- import com .google .common .collect .Lists ;
54import com .sailthru .client .http .SailthruHttpClient ;
65import com .sailthru .client .params .Send ;
76import org .apache .http .HttpHost ;
1817import org .junit .Before ;
1918import org .junit .Test ;
2019import org .junit .runner .RunWith ;
21- import org .mockito .runners .MockitoJUnitRunner ;
20+ import org .mockito .junit .MockitoJUnitRunner ;
2221
2322import java .io .ByteArrayInputStream ;
2423import java .io .IOException ;
2524import java .util .Collections ;
2625import java .util .Date ;
2726import java .util .Map ;
2827
29- import static junit . framework .Assert .assertEquals ;
30- import static org .mockito .Matchers .any ;
31- import static org .mockito .Matchers .eq ;
28+ import static org . junit .Assert .assertEquals ;
29+ import static org .mockito .ArgumentMatchers .any ;
30+ import static org .mockito .ArgumentMatchers .eq ;
3231import static org .mockito .Mockito .doReturn ;
3332import static org .mockito .Mockito .mock ;
3433import static org .mockito .Mockito .spy ;
@@ -59,7 +58,7 @@ public void testGetLastRateLimitInfo() throws IOException {
5958 long resetTs = ((new Date ().getTime () / 1000 ) * 1000 ) + 18000 ; // pretend the top of the next minute is 18 seconds from now
6059 Date resetDate = new Date (resetTs );
6160 CloseableHttpResponse httpResponse = getMockHttpResponseWithRateLimitHeaders (limit , remaining , resetDate );
62- doReturn (httpResponse ).when (httpClient ).execute (any (HttpHost .class ), any (HttpRequest .class ), any (HttpContext . class ));
61+ doReturn (httpResponse ).when (httpClient ).execute (any (HttpHost .class ), any (HttpRequest .class ), (HttpContext ) any ( ));
6362
6463 sailthruClient .apiGet (ApiAction .send , ImmutableMap .<String ,Object >of (Send .PARAM_SEND_ID , "some valid send id" ));
6564
@@ -95,7 +94,7 @@ public void testGetLastRateLimitInfoDifferentActions() throws IOException {
9594 doReturn (sendHttpResponse ).doReturn (listHttpResponse )
9695 .doReturn (returnHttpResponse )
9796 .when (httpClient )
98- .execute (any (HttpHost .class ), any (HttpRequest .class ), any (HttpContext . class ));
97+ .execute (any (HttpHost .class ), any (HttpRequest .class ), (HttpContext ) any ( ));
9998
10099 sailthruClient .apiGet (ApiAction .send , ImmutableMap .<String ,Object >of (Send .PARAM_SEND_ID , "some valid send id" ));
101100 sailthruClient .apiGet (ApiAction .list , ImmutableMap .<String ,Object >of ("list" , "some list" ));
@@ -133,7 +132,7 @@ public void testGetLastRateLimitInfoDifferentMethods() throws IOException {
133132 Date postResetDate = new Date (postResetTs );
134133 CloseableHttpResponse postHttpResponse = getMockHttpResponseWithRateLimitHeaders (postLimit , postRemaining , postResetDate );
135134
136- doReturn (getHttpResponse ).doReturn (postHttpResponse ).when (httpClient ).execute (any (HttpHost .class ), any (HttpRequest .class ), any (HttpContext . class ));
135+ doReturn (getHttpResponse ).doReturn (postHttpResponse ).when (httpClient ).execute (any (HttpHost .class ), any (HttpRequest .class ), (HttpContext ) any ( ));
137136
138137 sailthruClient .apiGet (ApiAction .list , ImmutableMap .<String ,Object >of ("list" , "some list" ));
139138 sailthruClient .apiPost (ApiAction .list , ImmutableMap .<String ,Object >of ("list" , "some new list" ));
@@ -152,10 +151,10 @@ public void testGetLastRateLimitInfoDifferentMethods() throws IOException {
152151 @ Test
153152 public void testReturnUrl () throws IOException {
154153 CloseableHttpResponse response = getMockHttpResponseWithRateLimitHeaders (1 , 1 , new Date ());
155- doReturn (response ).when (httpClient ).execute (any (HttpHost .class ), any (HttpRequest .class ), any (HttpContext . class ));
154+ doReturn (response ).when (httpClient ).execute (any (HttpHost .class ), any (HttpRequest .class ), (HttpContext ) any ( ));
156155 sailthruClient .apiPost (ApiAction .RETURN , Collections .<String , Object >emptyMap ());
157156 verify (httpClient ).executeHttpRequest (eq ("https://api.sailthru.com/return" ), eq (AbstractSailthruClient .HttpRequestMethod .POST ),
158- any (Map .class ), any (ResponseHandler .class ), any (Map . class ));
157+ any (Map .class ), any (ResponseHandler .class ), (Map ) any ( ));
159158 }
160159
161160 private CloseableHttpResponse getMockHttpResponseWithRateLimitHeaders (int limit , int remaining , Date reset ) {
0 commit comments