@Test public void getCredential_Failed_OnEmptyEnv() throws IOException { exceptionRule.expect(IBackupUploader.BackupException.class); exceptionRule.expectMessage("oauthScopes is blank"); gcpBackupUploader.getCredential(""); }
public Credentials getCredential(String oauthScopes) throws IOException { validatePathParameter(oauthScopes, "oauthScopes"); GoogleCredentials credentials = GoogleCredentials.getApplicationDefault(); if (!oauthScopes.isBlank()) { credentials = credentials.createScoped(Arrays.asList(oauthScopes.split(","))); } return credentials; }
GcpBackupUploader extends AbstractBackupUploader { public Credentials getCredential(String oauthScopes) throws IOException { validatePathParameter(oauthScopes, "oauthScopes"); GoogleCredentials credentials = GoogleCredentials.getApplicationDefault(); if (!oauthScopes.isBlank()) { credentials = credentials.createScoped(Arrays.asList(oauthScopes.split(","))); } return credentials; } }
GcpBackupUploader extends AbstractBackupUploader { public Credentials getCredential(String oauthScopes) throws IOException { validatePathParameter(oauthScopes, "oauthScopes"); GoogleCredentials credentials = GoogleCredentials.getApplicationDefault(); if (!oauthScopes.isBlank()) { credentials = credentials.createScoped(Arrays.asList(oauthScopes.split(","))); } return credentials; } GcpBackupUploader(String uploadFilePath, String gcpProjectId, Storage storage);  GcpBackupUploader(String uploadFilePath, String gcpProjectId, String oauthScopes); }
GcpBackupUploader extends AbstractBackupUploader { public Credentials getCredential(String oauthScopes) throws IOException { validatePathParameter(oauthScopes, "oauthScopes"); GoogleCredentials credentials = GoogleCredentials.getApplicationDefault(); if (!oauthScopes.isBlank()) { credentials = credentials.createScoped(Arrays.asList(oauthScopes.split(","))); } return credentials; } GcpBackupUploader(String uploadFilePath, String gcpProjectId, Storage storage);  GcpBackupUploader(String uploadFilePath, String gcpProjectId, String oauthScopes); @Override void doWriteBackup(InputStream backupData, String uniqueFileName); @Override InputStream doReadBackup(String uniqueFileName); @Override void doRemoveBackup(String uniqueFileName); String getProjectId(); String getBucketName(); String getUploadFolder(); Credentials getCredential(String oauthScopes); }
GcpBackupUploader extends AbstractBackupUploader { public Credentials getCredential(String oauthScopes) throws IOException { validatePathParameter(oauthScopes, "oauthScopes"); GoogleCredentials credentials = GoogleCredentials.getApplicationDefault(); if (!oauthScopes.isBlank()) { credentials = credentials.createScoped(Arrays.asList(oauthScopes.split(","))); } return credentials; } GcpBackupUploader(String uploadFilePath, String gcpProjectId, Storage storage);  GcpBackupUploader(String uploadFilePath, String gcpProjectId, String oauthScopes); @Override void doWriteBackup(InputStream backupData, String uniqueFileName); @Override InputStream doReadBackup(String uniqueFileName); @Override void doRemoveBackup(String uniqueFileName); String getProjectId(); String getBucketName(); String getUploadFolder(); Credentials getCredential(String oauthScopes);  }