How to use commonWdaRealDeviceS3Path method of com.testsigma.service.ResignService class

Best Testsigma code snippet using com.testsigma.service.ResignService.commonWdaRealDeviceS3Path

Source:ResignService.java Github

copy

Full Screen

...62 certificateService.setPreSignedURLs(profile);63 String ipaName = profile.getId() + "_wda";64 String resignedPathPrefix = "wda/" + profile.getId() + "/wda.ipa";65 if (storageServiceFactory.getStorageService().getStorageType() == StorageType.ON_PREMISE) {66 File resignedIpa = resignUsingFiles(profile, ipaName, commonWdaRealDeviceS3Path());67 storageServiceFactory.getStorageService().addFile(resignedPathPrefix, resignedIpa);68 } else {69 resignUsingUrls(profile, ipaName, commonWdaRealDeviceS3Path(),70 storageServiceFactory.getStorageService().generatePreSignedURL(resignedPathPrefix, StorageAccessLevel.WRITE, 60));71 }72 }73 public void reSignUpload(ProvisioningProfile profile, UploadVersion uploadVersion) throws TestsigmaException {74 log.info(String.format("Resigning Upload [%s] - [%s] file for provisioning profile [%s] - [%s]",75 uploadVersion.getId(), uploadVersion.getName(), profile.getId(), profile.getName()));76 certificateService.setPreSignedURLs(profile);77 String ipaName = profile.getId() + "_" + uploadVersion.getId();78 String resignedPathPrefix = uploadVersion.getResignedAppS3PathSuffix(profile.getId());79 try {80 if (storageServiceFactory.getStorageService().getStorageType() == StorageType.ON_PREMISE) {81 File resignedIpa = resignUsingFiles(profile, ipaName, new URL(uploadVersionService.getPreSignedURL(uploadVersion)));82 storageServiceFactory.getStorageService().addFile(resignedPathPrefix, resignedIpa);83 } else {84 resignUsingUrls(profile, ipaName, new URL(uploadVersionService.getPreSignedURL(uploadVersion)),85 storageServiceFactory.getStorageService().generatePreSignedURL(resignedPathPrefix, StorageAccessLevel.WRITE, 60));86 }87 } catch (MalformedURLException e) {88 log.error(e.getMessage(), e);89 throw new TestsigmaException(e.getMessage(), e);90 }91 }92 public void resignPublicUrlApp(ProvisioningProfile profile, String presignedAppUrl, String resignedPathSuffix)93 throws TestsigmaException {94 log.info(String.format("Resigning App [%s] - [%s] file for provisioning profile [%s] - [%s]",95 presignedAppUrl, resignedPathSuffix, profile.getId(), profile.getName()));96 try {97 certificateService.setPreSignedURLs(profile);98 String ipaName = profile.getId() + "_" + FilenameUtils.getBaseName(new URL(presignedAppUrl).getPath());99 File resignedIpa = resignUsingFiles(profile, ipaName, new URL(presignedAppUrl));100 storageServiceFactory.getStorageService().addFile(resignedPathSuffix, resignedIpa);101 } catch (Exception e) {102 throw new TestsigmaException(e.getMessage(), e);103 }104 }105 public void reSignForAllProfiles(UploadVersion upload, List<ProvisioningProfile> profiles) throws TestsigmaException {106 provisioningProfileUploadService.removeEntitiesForUpload(upload);107 for (ProvisioningProfile profile : profiles) {108 reSignUpload(profile, upload);109 provisioningProfileUploadService.create(profile, upload);110 }111 }112 public void reSignAllUploads(ProvisioningProfile profile, List<UploadVersion> uploadVersions)113 throws TestsigmaException {114 provisioningProfileUploadService.removeEntitiesForProfile(profile);115 for (UploadVersion uploadVersion : uploadVersions) {116 try {117 reSignUpload(profile, uploadVersion);118 provisioningProfileUploadService.create(profile, uploadVersion);119 } catch (Exception e) {120 log.error(e.getMessage(), e);121 }122 }123 }124 public URL commonWdaRealDeviceS3Path() throws TestsigmaException {125 ArrayList<Header> headers = new ArrayList<>();126 headers.add(new BasicHeader(HttpHeaders.CONTENT_TYPE, "application/json"));127 HttpResponse<String> response = httpClient.get(testsigmaOSConfigService.getUrl() +128 URLConstants.TESTSIGMA_OS_PUBLIC_WDA_REAL_DEVICE_URL, headers, new TypeReference<>() {129 });130 try {131 return new URL(response.getResponseEntity());132 } catch (MalformedURLException e) {133 throw new TestsigmaException(e.getMessage(), e);134 }135 }136 private List<Header> getResignHeaders() {137 Header authorization = new BasicHeader(org.apache.http.HttpHeaders.AUTHORIZATION, "Bearer " + testsigmaOSConfigService.find().getAccessKey());138 Header accept = new BasicHeader(HttpHeaders.ACCEPT, "*/*");...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Testsigma automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful