OAuthTokenRefresher { protected HttpPost newPostRequest(String url, String entity) { HttpPost post = new HttpPost(url); post = (HttpPost) addAuthHeader(post); if (entity != null) { try { post.setEntity(new StringEntity(entity)); } catch (UnsupportedEncodingException e) { Log.e(TAG, "error attaching entity to post", e); } } return post; } OAuthTokenRefresher(); RefreshToken useRefreshToken(String refreshToken); abstract String getTokenUrl(); abstract String getClientId(); abstract String getClientSecret();  }
@Test public void test_newPostRequest() { String url = "test_url"; String entity = "test_entity"; HttpPost post = refresher.newPostRequest(url, entity); assertNotNull(post.getEntity()); }
@Test public void test_newPostRequest_noEntity() { String url = "test_url"; String entity = null; HttpPost post = refresher.newPostRequest(url, entity); assertNull(post.getEntity()); }