Skip to content

Commit

Permalink
Remove invalid dependencies from microsoft-azure-storage-blob (#39050)
Browse files Browse the repository at this point in the history
Remove invalid dependencies from microsoft-azure-storage-blob
  • Loading branch information
alzimmermsft authored Mar 1, 2024
1 parent 6daa36b commit 03c064c
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 19 deletions.
16 changes: 0 additions & 16 deletions sdk/storage/microsoft-azure-storage-blob/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,22 +73,6 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core-test</artifactId>
<version>1.23.0</version> <!-- {x-version-update;com.azure:azure-core-test;dependency} -->
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-storage-common</artifactId>
<version>12.24.2</version> <!-- {x-version-update;com.azure:azure-storage-common;dependency} -->
<classifier>tests</classifier>
<type>test-jar</type>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.spockframework</groupId>
<artifactId>spock-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

package com.microsoft.azure.storage

import com.azure.storage.common.test.shared.extensions.LiveOnly
import com.microsoft.aad.adal4j.AuthenticationContext
import com.microsoft.aad.adal4j.ClientCredential
import com.microsoft.azure.storage.blob.*
Expand Down Expand Up @@ -603,8 +602,8 @@ class APISpec extends Specification {
StorageURL.createPipeline(new TokenCredentials(token)))
}

def getTestMode(){
String testMode = System.getenv("AZURE_TEST_MODE")
static def getTestMode(){
def testMode = System.getenv("AZURE_TEST_MODE")
if(testMode == null){
testMode = "PLAYBACK"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
package com.microsoft.azure.storage;

import org.spockframework.runtime.extension.ExtensionAnnotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Inherited
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.METHOD})
@ExtensionAnnotation(LiveOnlyExtension.class)
public @interface LiveOnly {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
package com.microsoft.azure.storage;

import org.spockframework.runtime.extension.IAnnotationDrivenExtension;
import org.spockframework.runtime.model.FeatureInfo;
import org.spockframework.runtime.model.SpecInfo;

public class LiveOnlyExtension implements IAnnotationDrivenExtension<LiveOnly> {

@Override
public void visitFeatureAnnotation(LiveOnly annotation, FeatureInfo feature) {
String testMode = (String) APISpec.getTestMode();
if (!"LIVE".equalsIgnoreCase(testMode)) {
feature.skip(String.format("Test ignored in %s mode", testMode));
}
}

@Override
public void visitSpecAnnotation(LiveOnly annotation, SpecInfo spec) {
String testMode = (String) APISpec.getTestMode();
if (!"LIVE".equalsIgnoreCase(testMode)) {
spec.skip(String.format("Test ignored in %s mode", testMode));
}
}
}

0 comments on commit 03c064c

Please sign in to comment.