Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require playbackmode for share enable protocol tests #17931

Merged
merged 2 commits into from
Dec 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public final class BlobServiceSasSignatureValues {

private final ClientLogger logger = new ClientLogger(BlobServiceSasSignatureValues.class);

private final String version = BlobSasServiceVersion.V2019_12_12.getVersion();
private final String version = BlobSasServiceVersion.getLatest().getVersion();

private SasProtocol protocol;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2102,10 +2102,10 @@ class BlockBlobAPITest extends APISpec {
e.getErrorCode() == errorCode

where:
requestConditions | errorCode
new BlobRequestConditions().setIfMatch("dummy") | BlobErrorCode.SOURCE_CONDITION_NOT_MET
requestConditions | errorCode
new BlobRequestConditions().setIfMatch("dummy") | BlobErrorCode.SOURCE_CONDITION_NOT_MET
new BlobRequestConditions().setIfModifiedSince(OffsetDateTime.now().plusSeconds(10)) | BlobErrorCode.CANNOT_VERIFY_COPY_SOURCE
new BlobRequestConditions().setIfUnmodifiedSince(OffsetDateTime.now().minusDays(1)) | BlobErrorCode.CANNOT_VERIFY_COPY_SOURCE
new BlobRequestConditions().setIfUnmodifiedSince(OffsetDateTime.now().minusDays(1)) | BlobErrorCode.CANNOT_VERIFY_COPY_SOURCE
}

@Unroll
Expand All @@ -2116,7 +2116,9 @@ class BlockBlobAPITest extends APISpec {
def sas = sourceBlob.generateSas(new BlobServiceSasSignatureValues(OffsetDateTime.now().plusDays(1),
new BlobContainerSasPermission().setReadPermission(true)))
blockBlobClient.upload(new ByteArrayInputStream(), 0, true)
createLeaseClient(blobClient).acquireLease(60)
if (requestConditions.getLeaseId() != null) {
createLeaseClient(blobClient).acquireLease(60)
}

when:
def options = new BlobUploadFromUrlOptions(sourceBlob.getBlobUrl() + "?" + sas).setDestinationRequestConditions(requestConditions)
Expand All @@ -2127,11 +2129,11 @@ class BlockBlobAPITest extends APISpec {
e.getErrorCode() == errorCode

where:
requestConditions | errorCode
new BlobRequestConditions().setIfMatch("dummy") | BlobErrorCode.TARGET_CONDITION_NOT_MET
new BlobRequestConditions().setIfNoneMatch("*") | BlobErrorCode.BLOB_ALREADY_EXISTS
new BlobRequestConditions().setIfModifiedSince(OffsetDateTime.now().plusSeconds(10)) | BlobErrorCode.CONDITION_NOT_MET
new BlobRequestConditions().setIfUnmodifiedSince(OffsetDateTime.now().minusDays(1)) | BlobErrorCode.CONDITION_NOT_MET
new BlobRequestConditions().setLeaseId("9260fd2d-34c1-42b5-9217-8fb7c6484bfb")| BlobErrorCode.LEASE_ID_MISMATCH_WITH_BLOB_OPERATION
requestConditions | errorCode
new BlobRequestConditions().setIfMatch("dummy") | BlobErrorCode.TARGET_CONDITION_NOT_MET
new BlobRequestConditions().setIfNoneMatch("*") | BlobErrorCode.BLOB_ALREADY_EXISTS
new BlobRequestConditions().setIfModifiedSince(OffsetDateTime.now().plusDays(10)) | BlobErrorCode.CONDITION_NOT_MET
new BlobRequestConditions().setIfUnmodifiedSince(OffsetDateTime.now().minusDays(1)) | BlobErrorCode.CONDITION_NOT_MET
new BlobRequestConditions().setLeaseId("9260fd2d-34c1-42b5-9217-8fb7c6484bfb") | BlobErrorCode.LEASE_ID_MISMATCH_WITH_BLOB_OPERATION
}
}

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ class ShareAPITests extends APISpec {
}

@Unroll
@Requires({ playbackMode() })
def "Get properties premium"() {
given:
ShareProtocols enabledProtocol = ModelHelper.parseShareProtocols(protocol)
Expand Down Expand Up @@ -358,6 +359,7 @@ class ShareAPITests extends APISpec {
}

@Unroll
@Requires({ playbackMode() })
def "Set premium properties"() {
setup:
def premiumShareClient = premiumFileServiceClient.createShareWithResponse(generateShareName(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import com.azure.storage.file.share.models.ShareStorageException
import com.azure.storage.file.share.options.ShareCreateOptions
import com.azure.storage.file.share.options.ShareSetPropertiesOptions
import reactor.test.StepVerifier
import spock.lang.Requires
import spock.lang.Unroll

import java.time.LocalDateTime
Expand Down Expand Up @@ -195,6 +196,7 @@ class ShareAsyncAPITests extends APISpec {
}

@Unroll
@Requires({ playbackMode() })
def "Get properties premium"() {
given:
ShareProtocols enabledProtocol = ModelHelper.parseShareProtocols(protocol)
Expand Down Expand Up @@ -226,6 +228,7 @@ class ShareAsyncAPITests extends APISpec {
}

@Unroll
@Requires({ playbackMode() })
def "Set premium properties"() {
setup:
def premiumShareClient = premiumFileServiceAsyncClient.createShareWithResponse(generateShareName(),
Expand Down