@Test public void buildRequestTest() throws IOException { doReturn(mockedRequest).when(mockedDriveService).generateRequest(anyString(), anyString()); assertNull(driveHelper.buildRequest(null, null)); assertNull(driveHelper.buildRequest("some query", null)); assertNull(driveHelper.buildRequest(null, "some fields")); assertNotNull(driveHelper.buildRequest("some query", "some fields")); }
@Nullable public Drive.Files.List buildRequest(String query, String fields) throws IOException { if (query != null && fields != null) { return driveService.generateRequest(query, fields); } return null; }
DriveHelper { @Nullable public Drive.Files.List buildRequest(String query, String fields) throws IOException { if (query != null && fields != null) { return driveService.generateRequest(query, fields); } return null; } }
DriveHelper { @Nullable public Drive.Files.List buildRequest(String query, String fields) throws IOException { if (query != null && fields != null) { return driveService.generateRequest(query, fields); } return null; } DriveHelper(@NonNull GoogleAccountCredential credential,
                @NonNull HttpTransport transport,
                @NonNull JsonFactory jsonFactory);   DriveHelper(DriveService driveService); }
DriveHelper { @Nullable public Drive.Files.List buildRequest(String query, String fields) throws IOException { if (query != null && fields != null) { return driveService.generateRequest(query, fields); } return null; } DriveHelper(@NonNull GoogleAccountCredential credential,
                @NonNull HttpTransport transport,
                @NonNull JsonFactory jsonFactory);   DriveHelper(DriveService driveService); String getRootFolderId(); @Nullable Drive.Files.List buildRequest(String query, String fields); void downloadFile(@NonNull String fileId, @NonNull File file); String createOrGetIDOfSubmissionsFolder(); @Nullable String getIDOfFolderWithName(@NonNull String name, @Nullable String inFolder, boolean shouldCreateIfNotFound); String uploadFileToDrive(String mediaName, String destinationFolderID, File toUpload); String createFolderInDrive(@NonNull String folderName,
                                      @Nullable String parentId); com.google.api.services.drive.model.File createNewFile(@NonNull String name,
                                                                  @Nullable String mimeType,
                                                                  @Nullable String parentId); List<com.google.api.services.drive.model.File> getFilesFromDrive(
            @Nullable String folderName,
            @Nullable String parentId); @Nullable String generateSearchQuery(@Nullable String folderName,
                                      @Nullable String parentId,
                                      @Nullable String mimeType); void fetchFilesForCurrentPage(Drive.Files.List request, List<com.google.api.services.drive.model.File> files); }
DriveHelper { @Nullable public Drive.Files.List buildRequest(String query, String fields) throws IOException { if (query != null && fields != null) { return driveService.generateRequest(query, fields); } return null; } DriveHelper(@NonNull GoogleAccountCredential credential,
                @NonNull HttpTransport transport,
                @NonNull JsonFactory jsonFactory);   DriveHelper(DriveService driveService); String getRootFolderId(); @Nullable Drive.Files.List buildRequest(String query, String fields); void downloadFile(@NonNull String fileId, @NonNull File file); String createOrGetIDOfSubmissionsFolder(); @Nullable String getIDOfFolderWithName(@NonNull String name, @Nullable String inFolder, boolean shouldCreateIfNotFound); String uploadFileToDrive(String mediaName, String destinationFolderID, File toUpload); String createFolderInDrive(@NonNull String folderName,
                                      @Nullable String parentId); com.google.api.services.drive.model.File createNewFile(@NonNull String name,
                                                                  @Nullable String mimeType,
                                                                  @Nullable String parentId); List<com.google.api.services.drive.model.File> getFilesFromDrive(
            @Nullable String folderName,
            @Nullable String parentId); @Nullable String generateSearchQuery(@Nullable String folderName,
                                      @Nullable String parentId,
                                      @Nullable String mimeType); void fetchFilesForCurrentPage(Drive.Files.List request, List<com.google.api.services.drive.model.File> files); static final String ODK_GOOGLE_DRIVE_ROOT_FOLDER_NAME; static final String ODK_GOOGLE_DRIVE_SUBMISSION_FOLDER_NAME; static final String FOLDER_MIME_TYPE; }