5
5
import org .apache .logging .log4j .LogManager ;
6
6
import org .apache .logging .log4j .Logger ;
7
7
8
+ /**
9
+ * Handles the asynchronous upload of application files to the LambdaTest platform. This class
10
+ * manages the upload process and returns the application ID for test execution.
11
+ *
12
+ * <p>Uses {@link UploaderUtil#uploadAndGetId(String, String, String)} for the actual file upload
13
+ * process.
14
+ */
8
15
public class AppUploader {
9
16
10
17
private static final Logger logger = LogManager .getLogger (AppUploader .class );
@@ -13,6 +20,13 @@ public class AppUploader {
13
20
private String accessKey ;
14
21
private String appFilePath ;
15
22
23
+ /**
24
+ * Creates a new AppUploader instance with the specified credentials and file path.
25
+ *
26
+ * @param username The LambdaTest account username
27
+ * @param accessKey The LambdaTest account access key
28
+ * @param appFilePath The path to the application file to be uploaded
29
+ */
16
30
public AppUploader (String username , String accessKey , String appFilePath ) {
17
31
if (username == null ) throw new IllegalArgumentException ("Username cannot be null" );
18
32
if (accessKey == null ) throw new IllegalArgumentException ("Access Key cannot be null" );
@@ -23,6 +37,13 @@ public AppUploader(String username, String accessKey, String appFilePath) {
23
37
this .appFilePath = appFilePath ;
24
38
}
25
39
40
+ /**
41
+ * Uploads the application file asynchronously to LambdaTest.
42
+ *
43
+ * @implNote Uses CompletableFuture to perform the upload asynchronously, allowing parallel
44
+ * processing of other tasks.
45
+ * @return A CompletableFuture that resolves to the uploaded application's ID
46
+ */
26
47
public CompletableFuture <String > uploadAppAsync () {
27
48
return CompletableFuture .supplyAsync (
28
49
() -> {
0 commit comments