### Question:
ServerManager { public List<Review> downloadReviews(Course course) { String fullUrl = connectionBuilder.addApiCallQueryParameters(course.getReviewsUrl()); try { String json = connectionBuilder.createConnection().getForText(fullUrl); Gson g = new GsonBuilder().setDateFormat("yyyy-MM-dd'T'HH:mm:ssX").create(); ReviewList reviews = g.fromJson(json, new TypeToken<ReviewList>() { }.getType()); return Arrays.asList(reviews.reviews); } catch (Exception e) { } return null; } 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 downloadReviewsAddsApiParameters() { Course course = mock(Course.class); when(course.getReviewsUrl()).thenReturn("url"); server.downloadReviews(course); verify(connectionBuilder, times(1)).addApiCallQueryParameters("url"); }
@Test public void downloadReviewsReadCreatesConnection() { Course course = mock(Course.class); when(course.getReviewsUrl()).thenReturn("url"); server.downloadReviews(course); verify(connectionBuilder, times(1)).createConnection(); }
@Test public void downloadReviewsReadCallsGetForText() throws Exception { Course course = mock(Course.class); when(course.getReviewsUrl()).thenReturn("url"); server.downloadReviews(course); verify(rb, times(1)).getForText(anyString()); }
@Test public void downloadReviewsDoesCatchesExceptionIfGetForTextThrows() throws Exception { Course course = mock(Course.class); when(course.getReviewsUrl()).thenReturn("url"); server.downloadReviews(course); when(rb.getForText(anyString())).thenThrow(new RuntimeException("Foo")); verify(rb, times(1)).getForText(anyString()); }