Skip to content

Commit

Permalink
Added spock test framework and tests for queue service (Azure#4940)
Browse files Browse the repository at this point in the history
* Migrate queue to spock test framework

* Remove all Junit tests and dependencies
  • Loading branch information
sima-zhu authored and pull[bot] committed Aug 15, 2019
1 parent 2f1b778 commit 98341e7
Show file tree
Hide file tree
Showing 174 changed files with 6,826 additions and 5,809 deletions.
22 changes: 4 additions & 18 deletions sdk/storage/azure-storage-queue/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,31 +54,17 @@
<version>1.0.0-preview.4</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.spockframework/spock-core -->
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-identity</artifactId>
<version>1.0.0-preview.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<groupId>org.spockframework</groupId>
<artifactId>spock-core</artifactId>
<version>1.3-groovy-2.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>adal4j</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import com.azure.storage.queue.models.SignedIdentifier;
import com.azure.storage.queue.models.StorageErrorException;
import com.azure.storage.queue.models.UpdatedMessage;
import java.util.Objects;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

Expand Down Expand Up @@ -62,6 +63,7 @@ public final class QueueAsyncClient {
* @param queueName Name of the queue
*/
QueueAsyncClient(AzureQueueStorageImpl client, String queueName) {
Objects.requireNonNull(queueName);
this.queueName = queueName;

this.client = new AzureQueueStorageBuilder().pipeline(client.getHttpPipeline())
Expand All @@ -79,6 +81,7 @@ public final class QueueAsyncClient {
* @param queueName Name of the queue
*/
QueueAsyncClient(URL endpoint, HttpPipeline httpPipeline, String queueName) {
Objects.requireNonNull(queueName);
this.queueName = queueName;

this.client = new AzureQueueStorageBuilder().pipeline(httpPipeline)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ public QueueClient buildClient() {
*/
public QueueAsyncClient buildAsyncClient() {
Objects.requireNonNull(endpoint);
Objects.requireNonNull(queueName);

if (sasTokenCredential == null && sharedKeyCredential == null && bearerTokenCredential == null) {
LOGGER.logExceptionAsError(new IllegalArgumentException("Credentials are required for authorization"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ public final class StorageErrorCode extends ExpandableStringEnum<StorageErrorCod
*/
public static final StorageErrorCode ACCOUNT_IS_DISABLED = fromString("AccountIsDisabled");

/**
* Static value AuthenticationError for StorageErrorCode.
*/
public static final StorageErrorCode AUTHENTICATION_ERROR = fromString("AuthenticationError");

/**
* Static value AuthenticationFailed for StorageErrorCode.
*/
Expand Down
Loading

0 comments on commit 98341e7

Please sign in to comment.