Skip to content

Commit 87ac8b5

Browse files
committed
Initial commit
1 parent 4136805 commit 87ac8b5

File tree

4 files changed

+131
-0
lines changed

4 files changed

+131
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
package org.azd.test.attachments;
2+
3+
import org.azd.abstractions.BaseRequestBuilder;
4+
import org.azd.authentication.AccessTokenCredential;
5+
6+
/**
7+
* Provides functionality to work with Test attachments Api.
8+
*/
9+
public class AttachmentsRequestBuilder extends BaseRequestBuilder {
10+
/**
11+
* Instantiates a new RequestBuilder instance and sets the default values.
12+
*
13+
* @param organizationUrl Represents organization location request url.
14+
* @param accessTokenCredential Access token credential object.
15+
*/
16+
public AttachmentsRequestBuilder(String organizationUrl, AccessTokenCredential accessTokenCredential) {
17+
super(organizationUrl, accessTokenCredential);
18+
}
19+
20+
/**
21+
* Provides functionality to work with Test result attachments Api.
22+
*
23+
* @return TestResultAttachmentRequestBuilder {@link ResultAttachmentRequestBuilder}
24+
*/
25+
public ResultAttachmentRequestBuilder result() {
26+
return new ResultAttachmentRequestBuilder(organizationUrl, accessTokenCredential);
27+
}
28+
29+
/**
30+
* Provides functionality to work with Test run attachments Api.
31+
*
32+
* @return TestRunAttachmentRequestBuilder {@link RunAttachmentRequestBuilder}
33+
*/
34+
public RunAttachmentRequestBuilder run() {
35+
return new RunAttachmentRequestBuilder(organizationUrl, accessTokenCredential);
36+
}
37+
38+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package org.azd.test.attachments;
2+
3+
import org.azd.abstractions.BaseRequestBuilder;
4+
import org.azd.authentication.AccessTokenCredential;
5+
import org.azd.common.ApiVersion;
6+
import org.azd.exceptions.AzDException;
7+
import org.azd.test.types.TestRun;
8+
9+
/**
10+
* Provides functionality to work with Test result attachments Api.
11+
*/
12+
public class ResultAttachmentRequestBuilder extends BaseRequestBuilder {
13+
/**
14+
* Instantiates a new RequestBuilder instance and sets the default values.
15+
*
16+
* @param organizationUrl Represents organization location request url.
17+
* @param accessTokenCredential Access token credential object.
18+
*/
19+
public ResultAttachmentRequestBuilder(String organizationUrl, AccessTokenCredential accessTokenCredential) {
20+
super(organizationUrl, accessTokenCredential, "test", "2bffebe9-2f0f-4639-9af8-56129e9fed2d", ApiVersion.TEST_ATTACHMENTS);
21+
}
22+
23+
/**
24+
* Create new test run.
25+
*
26+
* @param runCreateModel Run create model object to create a test run.
27+
* @return TestRun Object {@link TestRun}
28+
* @throws AzDException Default Api Exception handler.
29+
**/
30+
// public CompletableFuture<TestAttachmentReference> createAsync(RunCreateModel runCreateModel) throws AzDException {
31+
// return builder()
32+
// .POST(runCreateModel)
33+
// .build()
34+
// .executeAsync(TestRun.class);
35+
// }
36+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package org.azd.test.attachments;
2+
3+
import org.azd.abstractions.BaseRequestBuilder;
4+
import org.azd.authentication.AccessTokenCredential;
5+
6+
/**
7+
* Provides functionality to work with Test run attachments Api.
8+
*/
9+
public class RunAttachmentRequestBuilder extends BaseRequestBuilder {
10+
/**
11+
* Instantiates a new RequestBuilder instance and sets the default values.
12+
*
13+
* @param organizationUrl Represents organization location request url.
14+
* @param accessTokenCredential Access token credential object.
15+
*/
16+
public RunAttachmentRequestBuilder(String organizationUrl, AccessTokenCredential accessTokenCredential) {
17+
super(organizationUrl, accessTokenCredential);
18+
}
19+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
package org.azd.test.types;
2+
3+
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
4+
import com.fasterxml.jackson.annotation.JsonProperty;
5+
import org.azd.abstractions.serializer.SerializableEntity;
6+
7+
/**
8+
* Reference to test attachment.
9+
*/
10+
@JsonIgnoreProperties(ignoreUnknown = true)
11+
public class TestAttachmentReference extends SerializableEntity {
12+
/**
13+
* ID of the attachment.
14+
*/
15+
@JsonProperty("id")
16+
private int id;
17+
/**
18+
* Url to download the attachment.
19+
*/
20+
@JsonProperty("url")
21+
private String url;
22+
23+
public int getId() {
24+
return id;
25+
}
26+
27+
public void setId(int id) {
28+
this.id = id;
29+
}
30+
31+
public String getUrl() {
32+
return url;
33+
}
34+
35+
public void setUrl(String url) {
36+
this.url = url;
37+
}
38+
}

0 commit comments

Comments
 (0)