### Question:
ServerManager { public boolean markReviewAsRead(Review review) { String fullUrl = connectionBuilder.addApiCallQueryParameters(review.getUpdateUrl() + ".json"); Map<String, String> extraParams = new HashMap<String, String>(); extraParams.put("_method", "put"); extraParams.put("mark_as_read", "1"); try { connectionBuilder.createConnection().postForText(fullUrl, extraParams); return true; } catch (Exception e) { return false; } } ServerManager(Gson mapper, ConnectionBuilder connectionBuilder, Settings settings);  ServerManager(Settings settings); List<Course> getCourses(); List<Exercise> getExercises(String courseId); ZippedProject getExerciseZip(String zipUrl); SubmissionResponse uploadFile(Exercise exercise, byte[] data); SubmissionResponse uploadFile(Exercise exercise, byte[] data, Map<String, String> extraParams); SubmissionResult getSubmissionResult(URI resultURI); String submitFeedback(String answerUrl, List<FeedbackAnswer> answers); void sendEventLogs(String url, List<LoggableEvent> events); List<Review> downloadReviews(Course course); boolean markReviewAsRead(Review review);  }### Answer:
@Test public void markReviewAsReadGetsApiParameters() { Review review = mock(Review.class); when(review.getUpdateUrl()).thenReturn("url"); server.markReviewAsRead(review); verify(connectionBuilder, times(1)).addApiCallQueryParameters("url.json"); }
@Test public void markReviewAsReadCreatesConnection() { Review review = mock(Review.class); when(review.getUpdateUrl()).thenReturn("url"); server.markReviewAsRead(review); verify(connectionBuilder, times(1)).createConnection(); }
@Test public void markReviewAsReadCatchesExceptionsIfPostForTextThrows() throws Exception { Review review = mock(Review.class); when(review.getUpdateUrl()).thenReturn("url"); when(rb.postForText(anyString(), anyMap())).thenThrow(new RuntimeException("Foo")); server.markReviewAsRead(review); verify(rb, times(1)).postForText(anyString(), anyMap()); }
@Test public void markReviewAsReadCallsPostForText() throws Exception { Review review = mock(Review.class); when(review.getUpdateUrl()).thenReturn("url"); server.markReviewAsRead(review); verify(rb, times(1)).postForText(anyString(), anyMap()); }