@Test public void uploadFilesCreatesConnectionAndCallsUploadFileForTextDownload() throws Exception { String url = "mock_url"; String apiUrl = "wee"; Exercise exercise = mock(Exercise.class); when(exercise.getReturnUrl()).thenReturn(url); when(connectionBuilder.addApiCallQueryParameters(url)).thenReturn(apiUrl); when(settings.getErrorMsgLocale()).thenReturn(Locale.ENGLISH); byte[] data = new byte[5]; try { server.uploadFile(exercise, data); } catch (Exception e) { } verify(connectionBuilder, times(1)).createConnection(); verify(connectionBuilder, times(1)).addApiCallQueryParameters(url); verify(rb, times(1)).uploadFileForTextDownload(eq(apiUrl), anyMap(), eq("submission[file]"), eq(data)); }
public SubmissionResponse uploadFile(Exercise exercise, byte[] data) { return uploadFile(exercise, data, null); }
ServerManager { public SubmissionResponse uploadFile(Exercise exercise, byte[] data) { return uploadFile(exercise, data, null); } }
ServerManager { public SubmissionResponse uploadFile(Exercise exercise, byte[] data) { return uploadFile(exercise, data, null); } ServerManager(Gson mapper, ConnectionBuilder connectionBuilder, Settings settings);  ServerManager(Settings settings); }
ServerManager { public SubmissionResponse uploadFile(Exercise exercise, byte[] data) { return uploadFile(exercise, data, 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); }
ServerManager { public SubmissionResponse uploadFile(Exercise exercise, byte[] data) { return uploadFile(exercise, data, 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);  }