### Question:
BlockTemplate extends AbstractTwitterOperations implements BlockOperations { public TwitterProfile block(long userId) { requireUserAuthorization(); MultiValueMap<String, String> request = new LinkedMultiValueMap<String, String>(); request.set("user_id", String.valueOf(userId)); return restTemplate.postForObject(buildUri("blocks/create.json"), request, TwitterProfile.class); } BlockTemplate(RestTemplate restTemplate, boolean isAuthorizedForUser, boolean isAuthorizedForApp); TwitterProfile block(long userId); TwitterProfile block(String screenName); TwitterProfile unblock(long userId); TwitterProfile unblock(String screenName); CursoredList<TwitterProfile> getBlockedUsers(); CursoredList<TwitterProfile> getBlockedUsersInCursor(long cursor); CursoredList<Long> getBlockedUserIds(); CursoredList<Long> getBlockedUserIdsInCursor(long cursor);  }### Answer:
@Test public void block_userId() { mockServer.expect(requestTo("https: .andExpect(method(POST)) .andExpect(content().string("user_id=12345")) .andRespond(withSuccess(jsonResource("twitter-profile"), APPLICATION_JSON)); TwitterProfile blockedUser = twitter.blockOperations().block(12345); assertTwitterProfile(blockedUser); mockServer.verify(); }
@Test public void block_screenName() { mockServer.expect(requestTo("https: .andExpect(method(POST)) .andExpect(content().string("screen_name=habuma")) .andRespond(withSuccess(jsonResource("twitter-profile"), APPLICATION_JSON)); TwitterProfile blockedUser = twitter.blockOperations().block("habuma"); assertTwitterProfile(blockedUser); mockServer.verify(); }