From 576d2be4c20b40af506a25084bfa986a265af571 Mon Sep 17 00:00:00 2001 From: Eleanor Boyd Date: Mon, 15 Jun 2020 10:51:42 -0400 Subject: [PATCH 01/33] apply old --- sdk/tables/azure-data-tables/pom.xml | 12 ++ .../tables/AzureTablesAsyncClientTest.java | 134 ++++++++++++ .../com/azure/data/tables/autorestTest.java | 201 ++++++++++++++++++ 3 files changed, 347 insertions(+) create mode 100644 sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTablesAsyncClientTest.java create mode 100644 sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/autorestTest.java diff --git a/sdk/tables/azure-data-tables/pom.xml b/sdk/tables/azure-data-tables/pom.xml index 4fb23afccc72..10fab3ff709f 100644 --- a/sdk/tables/azure-data-tables/pom.xml +++ b/sdk/tables/azure-data-tables/pom.xml @@ -42,6 +42,18 @@ Licensed under the MIT License. azure-core 1.6.0 + + com.azure + azure-storage-common + 12.7.0-beta.1 + test + + + junit + junit + 4.8.2 + test + diff --git a/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTablesAsyncClientTest.java b/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTablesAsyncClientTest.java new file mode 100644 index 000000000000..204c76d433e8 --- /dev/null +++ b/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTablesAsyncClientTest.java @@ -0,0 +1,134 @@ +package com.azure.data.tables; + +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +import java.time.Duration; +import java.util.concurrent.TimeUnit; + +public class AzureTablesAsyncClientTest { + @Test + void createTableTest() { + // Ideally, we'd use a builder to create this rather than a constructor. + AzureTableAsyncClient client = new AzureTableAsyncClient(); + + // Every time this variable is used in a downstream subscriber, it will invoke the `createTable` operation. + Mono createTableMono = client.createTable("my-table"); + + // This is a subscription to the Mono. `subscribe` is a non-blocking call. + createTableMono.subscribe(table -> { + System.out.println("Table created is: " + table.getName()); + }, error -> { + System.err.println("There was an error creating the table. " + error); + }); + + // Since .subscribe is a non-blocking call, after it hooks up the asynchronous operation, it will move + // onto the next statement. If `client.createTable` takes 30 seconds, the program would have ended before we + // ever know the response because it will leave this method. + // You'll see that there is no "System.out.println" console output because the program has ended. + } + + /** + * Notice how "CREATING TABLE with name: my-table" errors when we try to add another entrythe second time? This is + * because, every time we chain the `createTableMono`, it invokes that `createTable` operation again. + * After an error occurs in one of the operations upstream in the chain, it will call the (error) -> { } handler. + * You'll see that we didn't try to add another entity (ie. new-key-2). + * + * See {@link #createAndUpdateTableFixed()} for a resolved version. + */ + @Test + void createAndUpdateTable() throws InterruptedException { + AzureTableAsyncClient client = new AzureTableAsyncClient(); + + // Every time this variable is used in a downstream subscriber, it will invoke the `createTable` operation. + Mono createTableMono = client.createTable("my-table"); + + // FirstMono -> SecondFlatMap -> Map -> Subscribe + createTableMono.flatMap(azureTable -> { + // We are chaining another operation to this table creation. We want to use the resulting table and + // create an entity in it. We use `flatMap` because it is asynchronous (ie. returns Mono or Flux). + Mono entity = azureTable.createEntity("my-key", "my-value"); + // We return the `createEntity` operation. + return entity; + }).map(azureTableEntity -> { + // This is a transformation, maybe we only care about the value of that entity we added. + return azureTableEntity.getValue(); + }).subscribe(theValue -> { + System.out.println("This was added: " + theValue); + }, error -> { + System.err.println("Error: " + error); + }); + + createTableMono.flatMap(azureTable -> { + // We are chaining another operation to this table creation. We want to use the resulting table and + // create an entity in it. We use `flatMap` because it is asynchronous (ie. returns Mono or Flux). + return azureTable.createEntity("my-key-2", "my-value-2"); + }).map(azureTableEntity -> { + // This is a transformation, maybe we only care about the value of that entity we added. + return azureTableEntity.getValue(); + }).subscribe(theValue -> { + System.out.println("This was added: " + theValue); + }, error -> { + System.err.println("Error: " + error); + }); + + TimeUnit.SECONDS.sleep(20); + } + + /** + * We've fixed this by caching the result of the `createTable` operation if it is successful. So we don't try to + * create the table again. + * + * See {@link #createAndUpdateTable()} + */ + @Test + void createAndUpdateTableFixed() throws InterruptedException { + AzureTableAsyncClient client = new AzureTableAsyncClient(); + + // Every time this variable is used in a downstream subscriber, it will invoke the `createTable` operation. + Mono createTableMono = client.createTable("my-table") + .cache(success -> { + System.out.println("--- Table added. Caching value."); + return Duration.ofSeconds(Long.MAX_VALUE); + }, error -> { + System.out.println("--- Error while adding table. Not caching value."); + return Duration.ZERO; + }, () -> { + // This can occur because Monos can output 0 or 1 items. This would be the case where it output 0 items. + // For example, Mono.empty() will complete, but not output any items. + System.out.println("--- Expected a table to be output, not an empty value. Not caching."); + return Duration.ZERO; + }); + + // FirstMono -> SecondFlatMap -> Map -> Subscribe + createTableMono.flatMap(azureTable -> { + // We are chaining another operation to this table creation. We want to use the resulting table and + // create an entity in it. We use `flatMap` because it is asynchronous (ie. returns Mono or Flux). + Mono entity = azureTable.createEntity("my-new-key", "my-new-value"); + // We return the `createEntity` operation. + return entity; + }).map(azureTableEntity -> { + // This is a transformation, maybe we only care about the value of that entity we added. + return azureTableEntity.getValue(); + }).subscribe(theValue -> { + System.out.println("This was added: " + theValue); + }, error -> { + System.err.println("ERROR: " + error); + }); + + createTableMono.flatMap(azureTable -> { + // We are chaining another operation to this table creation. We want to use the resulting table and + // create an entity in it. We use `flatMap` because it is asynchronous (ie. returns Mono or Flux). + return azureTable.createEntity("my-new-key-2", "my-new-value-2"); + }).map(azureTableEntity -> { + // This is a transformation, maybe we only care about the value of that entity we added. + return azureTableEntity.getValue(); + }).subscribe(theValue -> { + System.out.println("This was added: " + theValue); + }, error -> { + System.err.println("ERROR: " + error); + }); + + TimeUnit.SECONDS.sleep(20); + } +} diff --git a/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/autorestTest.java b/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/autorestTest.java new file mode 100644 index 000000000000..37c2cf79a288 --- /dev/null +++ b/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/autorestTest.java @@ -0,0 +1,201 @@ +package com.azure.data.tables; + +import com.azure.core.http.*; +import com.azure.core.http.policy.*; + +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.data.tables.implementation.AzureTableImpl; +import com.azure.data.tables.implementation.AzureTableImplBuilder; + +import com.azure.data.tables.implementation.TablesImpl; +import com.azure.data.tables.implementation.models.OdataMetadataFormat; +import com.azure.data.tables.implementation.models.QueryOptions; +import com.azure.data.tables.implementation.models.ResponseFormat; +import com.azure.data.tables.implementation.models.TableProperties; +import com.azure.storage.common.StorageSharedKeyCredential; +import com.azure.storage.common.implementation.connectionstring.StorageAuthenticationSettings; +import com.azure.storage.common.implementation.connectionstring.StorageConnectionString; + +import com.azure.storage.common.policy.StorageSharedKeyCredentialPolicy; +import reactor.test.StepVerifier; + + + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; + +public class autorestTest { + + + @org.junit.Test + void createAndUpdateTableFixed() { + final String connectionString = System.getenv("azure_tables_connection_string"); + final List policies = new ArrayList<>(); + + StorageConnectionString storageConnectionString + = StorageConnectionString.create(connectionString, new ClientLogger("tables")); + + StorageAuthenticationSettings authSettings = storageConnectionString.getStorageAuthSettings(); + StorageSharedKeyCredential sharedKeyCredential = new StorageSharedKeyCredential(authSettings.getAccount().getName(), + authSettings.getAccount().getAccessKey()); + + //storagesharedkey object and the storage auth object + policies.add(new AddDatePolicy()); + policies.add(new StorageSharedKeyCredentialPolicy(sharedKeyCredential)); + //HttpLoggingPolicy() + + final HttpPipeline pipeline = new HttpPipelineBuilder() + .httpClient(null) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + + AzureTableImplBuilder azureTableImplBuilder = new AzureTableImplBuilder(); + AzureTableImpl azureTable = azureTableImplBuilder + .pipeline(pipeline) + .url("https://telboytrial.table.core.windows.net/") + .buildClient(); + + try{ + TablesImpl tables = azureTable.getTables(); + + StepVerifier.create(tables.deleteWithResponseAsync("ebTable","ID23",Context.NONE)) + .assertNext(response -> { + System.out.println(response); + Assertions.assertEquals(200, response.getStatusCode()); + }) + .expectComplete() + .verify(); + } catch (Exception e){ + System.out.print(e); + } + + } + + + @org.junit.Test + void fromConnie () { + final List policies = Arrays.asList( + new AddDatePolicy(), + new AddHeadersPolicy(new HttpHeaders().put("Accept", OdataMetadataFormat.APPLICATION_JSON_ODATA_MINIMALMETADATA.toString())), + new TablesSharedKeyCredentialPolicy(sharedKeyCredential), + new HttpLoggingPolicy(new HttpLogOptions() + .setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS)) + ); + final HttpPipeline pipeline = new HttpPipelineBuilder() + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + AzureTableImpl azureTable = new AzureTableImplBuilder() + .pipeline(pipeline) + .version("2019-02-02") + .url("https://azsstgt28603173b8764a45.table.core.windows.net/") + .buildClient(); + TableProperties tableProperties = new TableProperties().setTableName("ebTableSeven"); + QueryOptions queryOptions = new QueryOptions(); + String requestId = UUID.randomUUID().toString(); + StepVerifier.create(azureTable.getTables().createWithResponseAsync(tableProperties, requestId, + ResponseFormat.RETURN_CONTENT, queryOptions, Context.NONE)) + .assertNext(response -> { + System.out.println(response); + Assertions.assertEquals(201, response.getStatusCode()); + }) + .expectComplete() + .verify(); + } + + + + + @org.junit.Test + void TablesAuth() { + final String connectionString = System.getenv("azure_tables_connection_string"); + final List policies = new ArrayList<>(); + + StorageConnectionString storageConnectionString + = StorageConnectionString.create(connectionString, new ClientLogger("tables")); + System.out.println(storageConnectionString); + + StorageAuthenticationSettings authSettings = storageConnectionString.getStorageAuthSettings(); + + TablesSharedKeyCredential sharedKeyCredential = new TablesSharedKeyCredential(authSettings.getAccount().getName(), + authSettings.getAccount().getAccessKey()); + + //storagesharedkey object and the storage auth object + policies.add(new AddDatePolicy()); + policies.add(new TablesSharedKeyCredentialPolicy(sharedKeyCredential)); + policies.add(new HttpLoggingPolicy(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS))); + //HttpLoggingPolicy() + + final HttpPipeline pipeline = new HttpPipelineBuilder() + .httpClient(null) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + + AzureTableImplBuilder azureTableImplBuilder = new AzureTableImplBuilder(); + AzureTableImpl azureTable = azureTableImplBuilder + .pipeline(pipeline) + .url("https://telboytrial.table.core.windows.net/") + .buildClient(); + + try{ + TablesImpl tables = azureTable.getTables(); + + StepVerifier.create(tables.createWithResponseAsync(new TableProperties().setTableName("ebTable"), + "ID23", + ResponseFormat.RETURN_CONTENT, + null,null)) + .assertNext(response -> { + System.out.println(response); + Assertions.assertEquals(200, response.getStatusCode()); + }) + .expectComplete() + .verify(); + } catch (Exception e){ + System.out.print(e); + } + +// try{ +// TablesImpl tables = azureTable.getTables(); +// +// StepVerifier.create(tables.deleteWithResponseAsync("ebTable","ID23",Context.NONE)) +// .assertNext(response -> { +// System.out.println(response); +// Assertions.assertEquals(200, response.getStatusCode()); +// }) +// .expectComplete() +// .verify(); +// } catch (Exception e){ +// System.out.print(e); +// } + + } + + + + + + + + + +// @Test +// void createTableTest() { +// StringToSign = VERB + "\n" + +// Content-MD5 + "\n" + +// Content-Type + "\n" + +// Date + "\n" + +// CanonicalizedResource; +// +// } +// +// +// @Test +// void createAndUpdateTable() throws InterruptedException { +// TablesImpl ti = new TablesImpl( new AzureTableImpl()); +// Mono c = ti.createWithResponseAsync( new TableProperties(), "requestId", RETURN_CONTENT, +// null , new Context("key", "value")); +// } + +} From dea249813611e57055a83221b4d7e5a823b98433 Mon Sep 17 00:00:00 2001 From: Eleanor Boyd Date: Mon, 15 Jun 2020 10:53:04 -0400 Subject: [PATCH 02/33] apply old --- .../test/java/com/azure/data/tables/autorestTest.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/autorestTest.java b/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/autorestTest.java index 37c2cf79a288..1e538ad3e57a 100644 --- a/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/autorestTest.java +++ b/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/autorestTest.java @@ -18,19 +18,19 @@ import com.azure.storage.common.implementation.connectionstring.StorageConnectionString; import com.azure.storage.common.policy.StorageSharedKeyCredentialPolicy; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; import reactor.test.StepVerifier; - import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import java.util.UUID; public class autorestTest { - @org.junit.Test + @Test void createAndUpdateTableFixed() { final String connectionString = System.getenv("azure_tables_connection_string"); final List policies = new ArrayList<>(); @@ -75,7 +75,7 @@ void createAndUpdateTableFixed() { } - @org.junit.Test + @Test void fromConnie () { final List policies = Arrays.asList( new AddDatePolicy(), @@ -108,7 +108,7 @@ void fromConnie () { - @org.junit.Test + @Test void TablesAuth() { final String connectionString = System.getenv("azure_tables_connection_string"); final List policies = new ArrayList<>(); From 081200a0298e7c731f0166492c7bcf1da7e86dfa Mon Sep 17 00:00:00 2001 From: Eleanor Boyd Date: Tue, 16 Jun 2020 14:14:08 -0400 Subject: [PATCH 03/33] testing works on this commit --- sdk/tables/azure-data-tables/pom.xml | 18 ++ .../tables/TablesSharedKeyCredential.java | 148 ++++++++++ .../TablesSharedKeyCredentialPolicy.java | 27 ++ .../tables/AzureTablesAsyncClientTest.java | 268 +++++++++--------- .../com/azure/data/tables/autorestTest.java | 14 +- 5 files changed, 339 insertions(+), 136 deletions(-) create mode 100644 sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredential.java create mode 100644 sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredentialPolicy.java diff --git a/sdk/tables/azure-data-tables/pom.xml b/sdk/tables/azure-data-tables/pom.xml index 10fab3ff709f..56d58fd66605 100644 --- a/sdk/tables/azure-data-tables/pom.xml +++ b/sdk/tables/azure-data-tables/pom.xml @@ -54,6 +54,24 @@ Licensed under the MIT License. 4.8.2 test + + org.junit.jupiter + junit-jupiter + RELEASE + test + + + io.projectreactor + reactor-test + 3.3.5.RELEASE + test + + + com.azure + azure-storage-common + 12.6.1 + compile + diff --git a/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredential.java b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredential.java new file mode 100644 index 000000000000..cb037b99d785 --- /dev/null +++ b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredential.java @@ -0,0 +1,148 @@ +package com.azure.data.tables; + +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.util.CoreUtils; +import com.azure.storage.common.StorageSharedKeyCredential; +import com.azure.storage.common.implementation.StorageImplUtils; +import com.azure.storage.common.policy.StorageSharedKeyCredentialPolicy; + +import java.net.URL; +import java.text.Collator; +import java.util.*; +import java.util.stream.Collectors; + +public class TablesSharedKeyCredential { + + private static final String AUTHORIZATION_HEADER_FORMAT = "SharedKey %s:%s"; + private static final String ACCOUNT_NAME = "accountname"; + private static final String ACCOUNT_KEY = "accountkey"; + private final String accountName; + private final String accountKey; + + public TablesSharedKeyCredential(String accountName, String accountKey) { + Objects.requireNonNull(accountName, "'accountName' cannot be null."); + Objects.requireNonNull(accountKey, "'accountKey' cannot be null."); + this.accountName = accountName; + this.accountKey = accountKey; + } + + public static TablesSharedKeyCredential fromConnectionString(String connectionString) { + HashMap connectionStringPieces = new HashMap(); + String[] var2 = connectionString.split(";"); + int var3 = var2.length; + + for(int var4 = 0; var4 < var3; ++var4) { + String connectionStringPiece = var2[var4]; + String[] kvp = connectionStringPiece.split("=", 2); + connectionStringPieces.put(kvp[0].toLowerCase(Locale.ROOT), kvp[1]); + } + + String accountName = (String)connectionStringPieces.get("accountname"); + String accountKey = (String)connectionStringPieces.get("accountkey"); + if (!CoreUtils.isNullOrEmpty(accountName) && !CoreUtils.isNullOrEmpty(accountKey)) { + return new TablesSharedKeyCredential(accountName, accountKey); + } else { + throw new IllegalArgumentException("Connection string must contain 'AccountName' and 'AccountKey'."); + } + } + + public String getAccountName() { + return this.accountName; + } + + public String generateAuthorizationHeader(URL requestURL, String httpMethod, Map headers) { + String signature = StorageImplUtils.computeHMac256(this.accountKey, this.buildStringToSign(requestURL, httpMethod, headers)); + return String.format("SharedKey %s:%s", this.accountName, signature); + } + + public String computeHmac256(String stringToSign) { + return StorageImplUtils.computeHMac256(this.accountKey, stringToSign); + } + + private String buildStringToSign(URL requestURL, String httpMethod, Map headers) { + String contentLength = (String)headers.get("Content-Length"); + contentLength = contentLength.equals("0") ? "" : contentLength; + String dateHeader = headers.containsKey("x-ms-date") ? "" : this.getStandardHeaderValue(headers, "Date"); + String s = String.join("\n", + httpMethod, //verb + this.getStandardHeaderValue(headers, "Content-MD5"), //content-md5 + this.getStandardHeaderValue(headers, "Content-Type"), //content-type + dateHeader, //date + this.getCanonicalizedResource(requestURL)); //canonicalized resoucre + return s; + } + + private String getStandardHeaderValue(Map headers, String headerName) { + String headerValue = (String)headers.get(headerName); +// if (headerName == "Content-Type"){ +// return "application/atom+xml"; +// } + return headerValue == null ? "" : headerValue; + } + + private String getAdditionalXmsHeaders(Map headers) { + List xmsHeaderNameArray = (List)headers.entrySet().stream().filter((entry) -> { + return ((String)entry.getKey()).toLowerCase(Locale.ROOT).startsWith("x-ms-"); + }).filter((entry) -> { + return entry.getValue() != null; + }).map(Map.Entry::getKey).collect(Collectors.toList()); + if (xmsHeaderNameArray.isEmpty()) { + return ""; + } else { + Collections.sort(xmsHeaderNameArray, Collator.getInstance(Locale.ROOT)); + StringBuilder canonicalizedHeaders = new StringBuilder(); + + String key; + for(Iterator var4 = xmsHeaderNameArray.iterator(); var4.hasNext(); canonicalizedHeaders.append(key.toLowerCase(Locale.ROOT)).append(':').append((String)headers.get(key))) { + key = (String)var4.next(); + if (canonicalizedHeaders.length() > 0) { + canonicalizedHeaders.append('\n'); + } + } + + return canonicalizedHeaders.toString(); + } + } + + private String getCanonicalizedResource(URL requestURL) { + StringBuilder canonicalizedResource = new StringBuilder("/"); + canonicalizedResource.append(this.accountName); + if (requestURL.getPath().length() > 0) { + canonicalizedResource.append(requestURL.getPath()); + } else { + canonicalizedResource.append('/'); + } + + if (requestURL.getQuery() == null) { + return canonicalizedResource.toString(); + } else { + Map queryParams = StorageImplUtils.parseQueryStringSplitValues(requestURL.getQuery()); + ArrayList queryParamNames = new ArrayList(queryParams.keySet()); + Collections.sort(queryParamNames); + Iterator var5 = queryParamNames.iterator(); + + while(var5.hasNext()) { + String queryParamName = (String)var5.next(); + String[] queryParamValues = (String[])queryParams.get(queryParamName); + Arrays.sort(queryParamValues); + String queryParamValuesStr = String.join(",", queryParamValues); + canonicalizedResource.append("\n").append(queryParamName.toLowerCase(Locale.ROOT)).append(":").append(queryParamValuesStr); + } + + return canonicalizedResource.toString(); + } + } + + public static com.azure.storage.common.StorageSharedKeyCredential getSharedKeyCredentialFromPipeline(HttpPipeline httpPipeline) { + for(int i = 0; i < httpPipeline.getPolicyCount(); ++i) { + HttpPipelinePolicy httpPipelinePolicy = httpPipeline.getPolicy(i); + if (httpPipelinePolicy instanceof TablesSharedKeyCredentialPolicy) { + StorageSharedKeyCredentialPolicy storageSharedKeyCredentialPolicy = (StorageSharedKeyCredentialPolicy)httpPipelinePolicy; + return storageSharedKeyCredentialPolicy.sharedKeyCredential(); + } + } + + return null; + } +} diff --git a/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredentialPolicy.java b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredentialPolicy.java new file mode 100644 index 000000000000..26ec4f1edf6a --- /dev/null +++ b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredentialPolicy.java @@ -0,0 +1,27 @@ +package com.azure.data.tables; + + +import com.azure.core.http.HttpPipelineCallContext; +import com.azure.core.http.HttpPipelineNextPolicy; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.policy.HttpPipelinePolicy; +import reactor.core.publisher.Mono; + +public final class TablesSharedKeyCredentialPolicy implements HttpPipelinePolicy{ + + private final TablesSharedKeyCredential credential; + + public TablesSharedKeyCredentialPolicy(TablesSharedKeyCredential credential) { + this.credential = credential; + } + + public TablesSharedKeyCredential sharedKeyCredential() { + return this.credential; + } + + public Mono process(HttpPipelineCallContext context, HttpPipelineNextPolicy next) { + String authorizationValue = this.credential.generateAuthorizationHeader(context.getHttpRequest().getUrl(), context.getHttpRequest().getHttpMethod().toString(), context.getHttpRequest().getHeaders().toMap()); + context.getHttpRequest().setHeader("Authorization", authorizationValue); + return next.process(); + } +} diff --git a/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTablesAsyncClientTest.java b/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTablesAsyncClientTest.java index 204c76d433e8..4ef145357b88 100644 --- a/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTablesAsyncClientTest.java +++ b/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTablesAsyncClientTest.java @@ -1,134 +1,134 @@ -package com.azure.data.tables; - -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -import java.time.Duration; -import java.util.concurrent.TimeUnit; - -public class AzureTablesAsyncClientTest { - @Test - void createTableTest() { - // Ideally, we'd use a builder to create this rather than a constructor. - AzureTableAsyncClient client = new AzureTableAsyncClient(); - - // Every time this variable is used in a downstream subscriber, it will invoke the `createTable` operation. - Mono createTableMono = client.createTable("my-table"); - - // This is a subscription to the Mono. `subscribe` is a non-blocking call. - createTableMono.subscribe(table -> { - System.out.println("Table created is: " + table.getName()); - }, error -> { - System.err.println("There was an error creating the table. " + error); - }); - - // Since .subscribe is a non-blocking call, after it hooks up the asynchronous operation, it will move - // onto the next statement. If `client.createTable` takes 30 seconds, the program would have ended before we - // ever know the response because it will leave this method. - // You'll see that there is no "System.out.println" console output because the program has ended. - } - - /** - * Notice how "CREATING TABLE with name: my-table" errors when we try to add another entrythe second time? This is - * because, every time we chain the `createTableMono`, it invokes that `createTable` operation again. - * After an error occurs in one of the operations upstream in the chain, it will call the (error) -> { } handler. - * You'll see that we didn't try to add another entity (ie. new-key-2). - * - * See {@link #createAndUpdateTableFixed()} for a resolved version. - */ - @Test - void createAndUpdateTable() throws InterruptedException { - AzureTableAsyncClient client = new AzureTableAsyncClient(); - - // Every time this variable is used in a downstream subscriber, it will invoke the `createTable` operation. - Mono createTableMono = client.createTable("my-table"); - - // FirstMono -> SecondFlatMap -> Map -> Subscribe - createTableMono.flatMap(azureTable -> { - // We are chaining another operation to this table creation. We want to use the resulting table and - // create an entity in it. We use `flatMap` because it is asynchronous (ie. returns Mono or Flux). - Mono entity = azureTable.createEntity("my-key", "my-value"); - // We return the `createEntity` operation. - return entity; - }).map(azureTableEntity -> { - // This is a transformation, maybe we only care about the value of that entity we added. - return azureTableEntity.getValue(); - }).subscribe(theValue -> { - System.out.println("This was added: " + theValue); - }, error -> { - System.err.println("Error: " + error); - }); - - createTableMono.flatMap(azureTable -> { - // We are chaining another operation to this table creation. We want to use the resulting table and - // create an entity in it. We use `flatMap` because it is asynchronous (ie. returns Mono or Flux). - return azureTable.createEntity("my-key-2", "my-value-2"); - }).map(azureTableEntity -> { - // This is a transformation, maybe we only care about the value of that entity we added. - return azureTableEntity.getValue(); - }).subscribe(theValue -> { - System.out.println("This was added: " + theValue); - }, error -> { - System.err.println("Error: " + error); - }); - - TimeUnit.SECONDS.sleep(20); - } - - /** - * We've fixed this by caching the result of the `createTable` operation if it is successful. So we don't try to - * create the table again. - * - * See {@link #createAndUpdateTable()} - */ - @Test - void createAndUpdateTableFixed() throws InterruptedException { - AzureTableAsyncClient client = new AzureTableAsyncClient(); - - // Every time this variable is used in a downstream subscriber, it will invoke the `createTable` operation. - Mono createTableMono = client.createTable("my-table") - .cache(success -> { - System.out.println("--- Table added. Caching value."); - return Duration.ofSeconds(Long.MAX_VALUE); - }, error -> { - System.out.println("--- Error while adding table. Not caching value."); - return Duration.ZERO; - }, () -> { - // This can occur because Monos can output 0 or 1 items. This would be the case where it output 0 items. - // For example, Mono.empty() will complete, but not output any items. - System.out.println("--- Expected a table to be output, not an empty value. Not caching."); - return Duration.ZERO; - }); - - // FirstMono -> SecondFlatMap -> Map -> Subscribe - createTableMono.flatMap(azureTable -> { - // We are chaining another operation to this table creation. We want to use the resulting table and - // create an entity in it. We use `flatMap` because it is asynchronous (ie. returns Mono or Flux). - Mono entity = azureTable.createEntity("my-new-key", "my-new-value"); - // We return the `createEntity` operation. - return entity; - }).map(azureTableEntity -> { - // This is a transformation, maybe we only care about the value of that entity we added. - return azureTableEntity.getValue(); - }).subscribe(theValue -> { - System.out.println("This was added: " + theValue); - }, error -> { - System.err.println("ERROR: " + error); - }); - - createTableMono.flatMap(azureTable -> { - // We are chaining another operation to this table creation. We want to use the resulting table and - // create an entity in it. We use `flatMap` because it is asynchronous (ie. returns Mono or Flux). - return azureTable.createEntity("my-new-key-2", "my-new-value-2"); - }).map(azureTableEntity -> { - // This is a transformation, maybe we only care about the value of that entity we added. - return azureTableEntity.getValue(); - }).subscribe(theValue -> { - System.out.println("This was added: " + theValue); - }, error -> { - System.err.println("ERROR: " + error); - }); - - TimeUnit.SECONDS.sleep(20); - } -} +//package com.azure.data.tables; +// +//import org.junit.jupiter.api.Test; +//import reactor.core.publisher.Mono; +// +//import java.time.Duration; +//import java.util.concurrent.TimeUnit; +// +//public class AzureTablesAsyncClientTest { +// @Test +// void createTableTest() { +// // Ideally, we'd use a builder to create this rather than a constructor. +// AzureTableAsyncClient client = new AzureTableAsyncClient(); +// +// // Every time this variable is used in a downstream subscriber, it will invoke the `createTable` operation. +// Mono createTableMono = client.createTable("my-table"); +// +// // This is a subscription to the Mono. `subscribe` is a non-blocking call. +// createTableMono.subscribe(table -> { +// System.out.println("Table created is: " + table.getName()); +// }, error -> { +// System.err.println("There was an error creating the table. " + error); +// }); +// +// // Since .subscribe is a non-blocking call, after it hooks up the asynchronous operation, it will move +// // onto the next statement. If `client.createTable` takes 30 seconds, the program would have ended before we +// // ever know the response because it will leave this method. +// // You'll see that there is no "System.out.println" console output because the program has ended. +// } +// +// /** +// * Notice how "CREATING TABLE with name: my-table" errors when we try to add another entrythe second time? This is +// * because, every time we chain the `createTableMono`, it invokes that `createTable` operation again. +// * After an error occurs in one of the operations upstream in the chain, it will call the (error) -> { } handler. +// * You'll see that we didn't try to add another entity (ie. new-key-2). +// * +// * See {@link #createAndUpdateTableFixed()} for a resolved version. +// */ +// @Test +// void createAndUpdateTable() throws InterruptedException { +// AzureTableAsyncClient client = new AzureTableAsyncClient(); +// +// // Every time this variable is used in a downstream subscriber, it will invoke the `createTable` operation. +// Mono createTableMono = client.createTable("my-table"); +// +// // FirstMono -> SecondFlatMap -> Map -> Subscribe +// createTableMono.flatMap(azureTable -> { +// // We are chaining another operation to this table creation. We want to use the resulting table and +// // create an entity in it. We use `flatMap` because it is asynchronous (ie. returns Mono or Flux). +// Mono entity = azureTable.createEntity("my-key", "my-value"); +// // We return the `createEntity` operation. +// return entity; +// }).map(azureTableEntity -> { +// // This is a transformation, maybe we only care about the value of that entity we added. +// return azureTableEntity.getValue(); +// }).subscribe(theValue -> { +// System.out.println("This was added: " + theValue); +// }, error -> { +// System.err.println("Error: " + error); +// }); +// +// createTableMono.flatMap(azureTable -> { +// // We are chaining another operation to this table creation. We want to use the resulting table and +// // create an entity in it. We use `flatMap` because it is asynchronous (ie. returns Mono or Flux). +// return azureTable.createEntity("my-key-2", "my-value-2"); +// }).map(azureTableEntity -> { +// // This is a transformation, maybe we only care about the value of that entity we added. +// return azureTableEntity.getValue(); +// }).subscribe(theValue -> { +// System.out.println("This was added: " + theValue); +// }, error -> { +// System.err.println("Error: " + error); +// }); +// +// TimeUnit.SECONDS.sleep(20); +// } +// +// /** +// * We've fixed this by caching the result of the `createTable` operation if it is successful. So we don't try to +// * create the table again. +// * +// * See {@link #createAndUpdateTable()} +// */ +// @Test +// void createAndUpdateTableFixed() throws InterruptedException { +// AzureTableAsyncClient client = new AzureTableAsyncClient(); +// +// // Every time this variable is used in a downstream subscriber, it will invoke the `createTable` operation. +// Mono createTableMono = client.createTable("my-table") +// .cache(success -> { +// System.out.println("--- Table added. Caching value."); +// return Duration.ofSeconds(Long.MAX_VALUE); +// }, error -> { +// System.out.println("--- Error while adding table. Not caching value."); +// return Duration.ZERO; +// }, () -> { +// // This can occur because Monos can output 0 or 1 items. This would be the case where it output 0 items. +// // For example, Mono.empty() will complete, but not output any items. +// System.out.println("--- Expected a table to be output, not an empty value. Not caching."); +// return Duration.ZERO; +// }); +// +// // FirstMono -> SecondFlatMap -> Map -> Subscribe +// createTableMono.flatMap(azureTable -> { +// // We are chaining another operation to this table creation. We want to use the resulting table and +// // create an entity in it. We use `flatMap` because it is asynchronous (ie. returns Mono or Flux). +// Mono entity = azureTable.createEntity("my-new-key", "my-new-value"); +// // We return the `createEntity` operation. +// return entity; +// }).map(azureTableEntity -> { +// // This is a transformation, maybe we only care about the value of that entity we added. +// return azureTableEntity.getValue(); +// }).subscribe(theValue -> { +// System.out.println("This was added: " + theValue); +// }, error -> { +// System.err.println("ERROR: " + error); +// }); +// +// createTableMono.flatMap(azureTable -> { +// // We are chaining another operation to this table creation. We want to use the resulting table and +// // create an entity in it. We use `flatMap` because it is asynchronous (ie. returns Mono or Flux). +// return azureTable.createEntity("my-new-key-2", "my-new-value-2"); +// }).map(azureTableEntity -> { +// // This is a transformation, maybe we only care about the value of that entity we added. +// return azureTableEntity.getValue(); +// }).subscribe(theValue -> { +// System.out.println("This was added: " + theValue); +// }, error -> { +// System.err.println("ERROR: " + error); +// }); +// +// TimeUnit.SECONDS.sleep(20); +// } +//} diff --git a/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/autorestTest.java b/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/autorestTest.java index 1e538ad3e57a..bcc8b4e1aad8 100644 --- a/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/autorestTest.java +++ b/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/autorestTest.java @@ -26,6 +26,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import java.util.UUID; public class autorestTest { @@ -55,7 +56,7 @@ void createAndUpdateTableFixed() { AzureTableImplBuilder azureTableImplBuilder = new AzureTableImplBuilder(); AzureTableImpl azureTable = azureTableImplBuilder .pipeline(pipeline) - .url("https://telboytrial.table.core.windows.net/") + .url("/https://telboytrial.table.core.windows.net") .buildClient(); try{ @@ -77,6 +78,15 @@ void createAndUpdateTableFixed() { @Test void fromConnie () { + final String connectionString = System.getenv("azure_tables_connection_string"); + + StorageConnectionString storageConnectionString + = StorageConnectionString.create(connectionString, new ClientLogger("tables")); + + StorageAuthenticationSettings authSettings = storageConnectionString.getStorageAuthSettings(); + TablesSharedKeyCredential sharedKeyCredential = new TablesSharedKeyCredential(authSettings.getAccount().getName(), + authSettings.getAccount().getAccessKey()); + final List policies = Arrays.asList( new AddDatePolicy(), new AddHeadersPolicy(new HttpHeaders().put("Accept", OdataMetadataFormat.APPLICATION_JSON_ODATA_MINIMALMETADATA.toString())), @@ -90,7 +100,7 @@ void fromConnie () { AzureTableImpl azureTable = new AzureTableImplBuilder() .pipeline(pipeline) .version("2019-02-02") - .url("https://azsstgt28603173b8764a45.table.core.windows.net/") + .url("https://telboytrial.table.core.windows.net") .buildClient(); TableProperties tableProperties = new TableProperties().setTableName("ebTableSeven"); QueryOptions queryOptions = new QueryOptions(); From f6ea265119493a81cf996c6355a1af8b817ed97f Mon Sep 17 00:00:00 2001 From: Eleanor Boyd Date: Tue, 16 Jun 2020 14:40:21 -0400 Subject: [PATCH 04/33] stashing --- .../com/azure/data/tables/autorestTest.java | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/autorestTest.java b/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/autorestTest.java index bcc8b4e1aad8..8900e387d93e 100644 --- a/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/autorestTest.java +++ b/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/autorestTest.java @@ -102,17 +102,29 @@ void fromConnie () { .version("2019-02-02") .url("https://telboytrial.table.core.windows.net") .buildClient(); - TableProperties tableProperties = new TableProperties().setTableName("ebTableSeven"); + TableProperties tableProperties = new TableProperties().setTableName("ebTable6"); QueryOptions queryOptions = new QueryOptions(); String requestId = UUID.randomUUID().toString(); - StepVerifier.create(azureTable.getTables().createWithResponseAsync(tableProperties, requestId, - ResponseFormat.RETURN_CONTENT, queryOptions, Context.NONE)) + + +// StepVerifier.create(azureTable.getTables().createWithResponseAsync(tableProperties, requestId, +// ResponseFormat.RETURN_CONTENT, queryOptions, Context.NONE)) +// .assertNext(response -> { +// System.out.println(response); +// Assertions.assertEquals(201, response.getStatusCode()); +// }) +// .expectComplete() +// .verify(); + + StepVerifier.create(azureTable.getTables().deleteWithResponseAsync("ebTableSeven", requestId, + Context.NONE)) .assertNext(response -> { System.out.println(response); - Assertions.assertEquals(201, response.getStatusCode()); + Assertions.assertEquals(204, response.getStatusCode()); }) .expectComplete() .verify(); + } From 1e1efd8d6f6f398fb9690f84a5e6cc0d59406fa7 Mon Sep 17 00:00:00 2001 From: Eleanor Boyd Date: Wed, 1 Jul 2020 14:07:13 -0400 Subject: [PATCH 05/33] additional testing --- .../com/azure/data/tables/autorestTest.java | 93 ++++++++++++++++--- 1 file changed, 78 insertions(+), 15 deletions(-) diff --git a/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/autorestTest.java b/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/autorestTest.java index 8900e387d93e..9f83c6d153f7 100644 --- a/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/autorestTest.java +++ b/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/autorestTest.java @@ -23,10 +23,7 @@ import reactor.test.StepVerifier; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.UUID; +import java.util.*; public class autorestTest { @@ -77,7 +74,7 @@ void createAndUpdateTableFixed() { @Test - void fromConnie () { + AzureTableImpl auth () { final String connectionString = System.getenv("azure_tables_connection_string"); StorageConnectionString storageConnectionString @@ -102,21 +99,40 @@ void fromConnie () { .version("2019-02-02") .url("https://telboytrial.table.core.windows.net") .buildClient(); - TableProperties tableProperties = new TableProperties().setTableName("ebTable6"); + return azureTable; + } + + @Test + void createTable(String tableName) { + + AzureTableImpl azureTable = auth(); + + TableProperties tableProperties = new TableProperties().setTableName(tableName); QueryOptions queryOptions = new QueryOptions(); String requestId = UUID.randomUUID().toString(); -// StepVerifier.create(azureTable.getTables().createWithResponseAsync(tableProperties, requestId, -// ResponseFormat.RETURN_CONTENT, queryOptions, Context.NONE)) -// .assertNext(response -> { -// System.out.println(response); -// Assertions.assertEquals(201, response.getStatusCode()); -// }) -// .expectComplete() -// .verify(); + StepVerifier.create(azureTable.getTables().createWithResponseAsync(tableProperties, requestId, + ResponseFormat.RETURN_CONTENT, queryOptions, Context.NONE)) + .assertNext(response -> { + System.out.println(response); + Assertions.assertEquals(201, response.getStatusCode()); + }) + .expectComplete() + .verify(); + + } - StepVerifier.create(azureTable.getTables().deleteWithResponseAsync("ebTableSeven", requestId, + + // tests deleting a table + @Test + void deleteTable(String tableName) { + + AzureTableImpl azureTable = auth(); + String requestId = UUID.randomUUID().toString(); + + + StepVerifier.create(azureTable.getTables().deleteWithResponseAsync(tableName, requestId, Context.NONE)) .assertNext(response -> { System.out.println(response); @@ -127,6 +143,53 @@ void fromConnie () { } + @Test + void queryTable(String tableName){ + AzureTableImpl azureTable = auth(); + String requestId = UUID.randomUUID().toString(); + QueryOptions queryOptions = new QueryOptions(); + queryOptions.setTop(2); + + StepVerifier.create(azureTable.getTables().queryWithResponseAsync(requestId, tableName, + queryOptions, Context.NONE)) + .assertNext(response -> { + System.out.println(response); + Assertions.assertEquals(204, response.getStatusCode()); + }) + .expectComplete() + .verify(); + } + + @Test + void insertEntity(String tableName){ + AzureTableImpl azureTable = auth(); + String requestId = UUID.randomUUID().toString(); + + Map properties = new HashMap<>(); + properties.put("PartitionKey", "pk"); + properties.put("RowKey", "rk"); + + StepVerifier.create(azureTable.getTables().insertEntityWithResponseAsync(tableName, 500, + requestId, ResponseFormat.RETURN_CONTENT, properties, null, Context.NONE)) + .assertNext(response -> { + System.out.println(response); + Assertions.assertEquals(204, response.getStatusCode()); + }) + .expectComplete() + .verify(); + } + + @Test + void allTests() { + String tableName = "testTable2"; + //deleteTable(tableName); + //createTable(tableName); + //insertEntity(tableName); + queryTable(tableName); + //deleteTable(tableName); + + } + From 2397b8810e7ff99fd5cd3372ed993903861178f9 Mon Sep 17 00:00:00 2001 From: Eleanor Boyd Date: Mon, 22 Jun 2020 16:04:38 -0400 Subject: [PATCH 06/33] stashing --- .../tables/TablesSharedKeyCredential.java | 10 +++++++++ .../com/azure/data/tables/autorestTest.java | 22 +++++++++++++++++-- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredential.java b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredential.java index cb037b99d785..acb7cad4f8f1 100644 --- a/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredential.java +++ b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredential.java @@ -64,12 +64,22 @@ private String buildStringToSign(URL requestURL, String httpMethod, Map { + System.out.println(response); + Assertions.assertEquals(204, response.getStatusCode()); + }) + .expectComplete() + .verify(); + } + @Test void allTests() { - String tableName = "testTable2"; + String tableName = "table3"; //deleteTable(tableName); //createTable(tableName); //insertEntity(tableName); - queryTable(tableName); + queryEntity(tableName); + //queryTable(tableName); //deleteTable(tableName); } From c2e8eb76197132c777e93c39fa4b1b074f56c603 Mon Sep 17 00:00:00 2001 From: Eleanor Boyd Date: Wed, 24 Jun 2020 11:21:50 -0400 Subject: [PATCH 07/33] stashing --- .../tables/TablesSharedKeyCredential.java | 26 +-- .../com/azure/data/tables/autorestTest.java | 184 +++++++++++++++--- 2 files changed, 174 insertions(+), 36 deletions(-) diff --git a/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredential.java b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredential.java index acb7cad4f8f1..7e3e213f0376 100644 --- a/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredential.java +++ b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredential.java @@ -8,6 +8,7 @@ import com.azure.storage.common.policy.StorageSharedKeyCredentialPolicy; import java.net.URL; +import java.nio.charset.StandardCharsets; import java.text.Collator; import java.util.*; import java.util.stream.Collectors; @@ -53,7 +54,7 @@ public String getAccountName() { public String generateAuthorizationHeader(URL requestURL, String httpMethod, Map headers) { String signature = StorageImplUtils.computeHMac256(this.accountKey, this.buildStringToSign(requestURL, httpMethod, headers)); - return String.format("SharedKey %s:%s", this.accountName, signature); + return String.format("SharedKeyLite %s:%s", this.accountName, signature); } public String computeHmac256(String stringToSign) { @@ -64,18 +65,15 @@ private String buildStringToSign(URL requestURL, String httpMethod, Map { System.out.println(response); Assertions.assertEquals(201, response.getStatusCode()); @@ -121,12 +118,19 @@ void createTable(String tableName) { .expectComplete() .verify(); + //error if it tries to create a table with the same name that already exists + StepVerifier.create(azureTable.getTables().createWithResponseAsync(tableProperties, requestId, + ResponseFormat.RETURN_CONTENT, null, Context.NONE)) + .expectError(com.azure.data.tables.implementation.models.TableServiceErrorException.class) + .verify(); + + //delete table + //deleteTableHelper(tableName); + } - // tests deleting a table - @Test - void deleteTable(String tableName) { + void deleteTableHelper(String tableName) { AzureTableImpl azureTable = auth(); String requestId = UUID.randomUUID().toString(); @@ -144,16 +148,127 @@ void deleteTable(String tableName) { } @Test - void queryTable(String tableName){ + void deleteTable() { + String tableName = "testDeleteTable2"; + AzureTableImpl azureTable = auth(); + TableProperties tableProperties = new TableProperties().setTableName(tableName); + + //create than delete a table, successful path + azureTable.getTables().createWithResponseAsync(tableProperties, UUID.randomUUID().toString(), + ResponseFormat.RETURN_CONTENT, null, Context.NONE).subscribe(Void -> { + StepVerifier.create(azureTable.getTables().deleteWithResponseAsync(tableName, UUID.randomUUID().toString(), + Context.NONE)) + .assertNext(response -> { + Assertions.assertEquals(204, response.getStatusCode()); + }) + .expectComplete() + .verify(); + }); + + StepVerifier.create(azureTable.getTables().deleteWithResponseAsync(tableName, UUID.randomUUID().toString(), + Context.NONE)) + .expectError(com.azure.data.tables.implementation.models.TableServiceErrorException.class) + .verify(); + } + + @Test + void queryTable(){ + String tableName = "testTable3"; AzureTableImpl azureTable = auth(); String requestId = UUID.randomUUID().toString(); - QueryOptions queryOptions = new QueryOptions(); - queryOptions.setTop(2); + QueryOptions queryOptions = new QueryOptions() + .setFormat(OdataMetadataFormat.APPLICATION_JSON_ODATA_MINIMALMETADATA) + .setTop(2); - StepVerifier.create(azureTable.getTables().queryWithResponseAsync(requestId, tableName, + StepVerifier.create(azureTable.getTables().queryWithResponseAsync(requestId, null, queryOptions, Context.NONE)) .assertNext(response -> { - System.out.println(response); + System.out.println("OUT" + response.getValue().getValue().get(0).getTableName()); + //System.out.println((TableQueryResponse) response); + Assertions.assertEquals(200, response.getStatusCode()); + }) + .expectComplete() + .verify(); + } + +// @Test +// void insertAndDeleteWithEtag(){ +// String tableName = "table3"; +// AzureTableImpl azureTable = auth(); +// String requestId = UUID.randomUUID().toString(); +// String pk = "Product"; +// String rk = "whiteboard2"; +// String etag = ""; +// +// Map properties = new HashMap<>(); +// properties.put("PartitionKey", pk); +// properties.put("RowKey", rk); +// +// TestPublisher testPublisher = TestPublisher.create(); +// //insert +// StepVerifier.create(azureTable.getTables().insertEntityWithResponseAsync(tableName, 500, +// requestId, ResponseFormat.RETURN_CONTENT, properties, null, Context.NONE)) +// .assertNext(response -> { +// System.out.println(response); +// response.getValue().get("odata.etag"); +// Assertions.assertEquals(201, response.getStatusCode()); +// +// StepVerifier.create(azureTable.getTables().deleteEntityWithResponseAsync(tableName, pk, +// rk, response.getValue().get("odata.etag").toString(), 500, requestId, null, Context.NONE)) +// .assertNext(response2 -> { +// System.out.println(response2); +// Assertions.assertEquals(204, response2.getStatusCode()); +// }) +// .expectComplete() +// .verify(); +// +// }) +// .expectComplete() +// .verify(); +// } + + @Test + void insertAndDeleteNoEtag(){ +// String tableName = "table3"; +// String pk = "product"; +// String rk = "glue"; +// insertEntity(tableName,pk, rk); +// deleteEntity(tableName,pk,rk); + } + + @Test + void insertMergeDeleteEntity(){ + String tableName = "table3"; + Map properties = new HashMap<>(); + properties.put("PartitionKey", "Store"); + properties.put("RowKey", "Atlanta"); + properties.put("Size", "200"); + insertEntity(tableName, properties); + properties.put("Employees", "15"); + properties.remove("Size"); + mergeEntity(tableName,properties); + //deleteEntity(tableName,properties); + } + + @Test + void insertUpdateDeleteEntity(){ + String tableName = "table3"; + Map properties = new HashMap<>(); + properties.put("PartitionKey", "Store"); + properties.put("RowKey", "Boston"); + properties.put("Size", "200"); + insertEntity(tableName,properties); + properties.put("Employees", "15"); + properties.remove("Size"); + updateEntity(tableName, properties); + deleteEntity(tableName, properties); + } + + void updateEntity(String tableName, Map properties) { + AzureTableImpl azureTable = auth(); + StepVerifier.create(azureTable.getTables().updateEntityWithResponseAsync(tableName, properties.get("PartitionKey").toString(), + properties.get("RowKey").toString(), 500, UUID.randomUUID().toString(), "*", properties, null, Context.NONE)) + .assertNext(response -> { Assertions.assertEquals(204, response.getStatusCode()); }) .expectComplete() @@ -161,16 +276,39 @@ void queryTable(String tableName){ } @Test - void insertEntity(String tableName){ + void mergeEntity(String tableName, Map properties ){ AzureTableImpl azureTable = auth(); - String requestId = UUID.randomUUID().toString(); - Map properties = new HashMap<>(); - properties.put("PartitionKey", "pk"); - properties.put("RowKey", "rk"); + StepVerifier.create(azureTable.getTables().mergeEntityWithResponseAsync(tableName, properties.get("PartitionKey").toString(), + properties.get("RowKey").toString(), 500, UUID.randomUUID().toString(), "*", properties, null, Context.NONE)) + .assertNext(response -> { + Assertions.assertEquals(204, response.getStatusCode()); + }) + .expectComplete() + .verify(); + } + + @Test + void insertEntity(String tableName, Map properties){ + AzureTableImpl azureTable = auth(); + String requestId = UUID.randomUUID().toString(); StepVerifier.create(azureTable.getTables().insertEntityWithResponseAsync(tableName, 500, requestId, ResponseFormat.RETURN_CONTENT, properties, null, Context.NONE)) + .assertNext(response -> { + Assertions.assertEquals(201, response.getStatusCode()); + }) + .expectComplete() + .verify(); + } + + @Test + void deleteEntity(String tableName, Map properties){ + AzureTableImpl azureTable = auth(); + String requestId = UUID.randomUUID().toString(); + + StepVerifier.create(azureTable.getTables().deleteEntityWithResponseAsync(tableName, properties.get("PartitionKey").toString(), + properties.get("RowKey").toString(), "*", 500, requestId, null, Context.NONE)) .assertNext(response -> { System.out.println(response); Assertions.assertEquals(204, response.getStatusCode()); @@ -202,7 +340,7 @@ void allTests() { //deleteTable(tableName); //createTable(tableName); //insertEntity(tableName); - queryEntity(tableName); + //queryEntity(tableName); //queryTable(tableName); //deleteTable(tableName); From b2ebec78d42b60b76636c62f583f27333a5d4eac Mon Sep 17 00:00:00 2001 From: Eleanor Boyd Date: Thu, 25 Jun 2020 11:16:05 -0400 Subject: [PATCH 08/33] adding tests --- sdk/tables/azure-data-tables/pom.xml | 6 + .../com/azure/data/tables/autorestTest.java | 386 +++++++----------- 2 files changed, 158 insertions(+), 234 deletions(-) diff --git a/sdk/tables/azure-data-tables/pom.xml b/sdk/tables/azure-data-tables/pom.xml index 56d58fd66605..e83bba6f29c4 100644 --- a/sdk/tables/azure-data-tables/pom.xml +++ b/sdk/tables/azure-data-tables/pom.xml @@ -72,6 +72,12 @@ Licensed under the MIT License. 12.6.1 compile + + junit + junit + 4.8.2 + test + diff --git a/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/autorestTest.java b/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/autorestTest.java index db9c022e5453..2a782cd61a34 100644 --- a/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/autorestTest.java +++ b/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/autorestTest.java @@ -15,18 +15,23 @@ import com.azure.storage.common.implementation.connectionstring.StorageConnectionString; import com.azure.storage.common.policy.StorageSharedKeyCredentialPolicy; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.*; import reactor.test.StepVerifier; -import reactor.test.publisher.TestPublisher; import java.util.*; +import java.util.concurrent.TimeUnit; public class autorestTest { + final String tableA = "tableA"; + final String tableB = "tableB"; + final String tableZ = "tableZ"; + final AzureTableImpl azureTable = auth(); + final String pk = "PartitionKey"; + final String rk = "RowKey"; + Map propertiesB = new HashMap<>(); - @Test void createAndUpdateTableFixed() { final String connectionString = System.getenv("azure_tables_connection_string"); final List policies = new ArrayList<>(); @@ -71,8 +76,7 @@ void createAndUpdateTableFixed() { } - @Test - AzureTableImpl auth () { + static AzureTableImpl auth() { final String connectionString = System.getenv("azure_tables_connection_string"); StorageConnectionString storageConnectionString @@ -100,14 +104,68 @@ AzureTableImpl auth () { return azureTable; } - @Test - void createTable() { - String tableName = "testTable3"; + + @BeforeEach + void beforeTests() { + createTableHelper(tableA); + createTableHelper(tableB); + + propertiesB.put("PartitionKey", "Store"); + propertiesB.put("RowKey", "Boston"); + propertiesB.put("Employees", "200"); + insertEntityHelper(tableA, propertiesB); + + Map propertiesA = new HashMap<>(); + propertiesA.put("PartitionKey", "Store"); + propertiesA.put("RowKey", "Atlanta"); + propertiesA.put("Employees", "50"); + insertEntityHelper(tableA, propertiesA); + + + } + + @AfterEach + void afterTests() throws InterruptedException { + deleteTableHelper(tableA); + deleteTableHelper(tableB); + + } + + void createTableHelper(String tableName){ AzureTableImpl azureTable = auth(); TableProperties tableProperties = new TableProperties().setTableName(tableName); String requestId = UUID.randomUUID().toString(); + azureTable.getTables().createWithResponseAsync(tableProperties, requestId, + ResponseFormat.RETURN_CONTENT, null, Context.NONE).block(); + + } + + void deleteTableHelper(String tableName) throws InterruptedException { + + AzureTableImpl azureTable = auth(); + String requestId = UUID.randomUUID().toString(); + + + azureTable.getTables().deleteWithResponseAsync(tableName, requestId, + Context.NONE).block(); + TimeUnit.SECONDS.sleep(2); + + } + + void insertEntityHelper(String tableName, Map properties){ + String requestId = UUID.randomUUID().toString(); + + azureTable.getTables().insertEntityWithResponseAsync(tableName, 500, + requestId, ResponseFormat.RETURN_CONTENT, properties, null, Context.NONE).log().block(); + } + + @Test + void createTable() throws InterruptedException { + TableProperties tableProperties = new TableProperties().setTableName(tableZ); + String requestId = UUID.randomUUID().toString(); + //successful path StepVerifier.create(azureTable.getTables().createWithResponseAsync(tableProperties, requestId, ResponseFormat.RETURN_CONTENT, null, Context.NONE)) @@ -125,47 +183,27 @@ void createTable() { .verify(); //delete table - //deleteTableHelper(tableName); + deleteTableHelper(tableZ); } + @Test + void deleteTable() { - void deleteTableHelper(String tableName) { - - AzureTableImpl azureTable = auth(); - String requestId = UUID.randomUUID().toString(); - + //create Table + createTableHelper(tableZ); - StepVerifier.create(azureTable.getTables().deleteWithResponseAsync(tableName, requestId, + //delete a table, successful path + StepVerifier.create(azureTable.getTables().deleteWithResponseAsync(tableZ, UUID.randomUUID().toString(), Context.NONE)) .assertNext(response -> { - System.out.println(response); Assertions.assertEquals(204, response.getStatusCode()); }) .expectComplete() .verify(); - } - - @Test - void deleteTable() { - String tableName = "testDeleteTable2"; - AzureTableImpl azureTable = auth(); - TableProperties tableProperties = new TableProperties().setTableName(tableName); - - //create than delete a table, successful path - azureTable.getTables().createWithResponseAsync(tableProperties, UUID.randomUUID().toString(), - ResponseFormat.RETURN_CONTENT, null, Context.NONE).subscribe(Void -> { - StepVerifier.create(azureTable.getTables().deleteWithResponseAsync(tableName, UUID.randomUUID().toString(), - Context.NONE)) - .assertNext(response -> { - Assertions.assertEquals(204, response.getStatusCode()); - }) - .expectComplete() - .verify(); - }); - - StepVerifier.create(azureTable.getTables().deleteWithResponseAsync(tableName, UUID.randomUUID().toString(), + //try to delete table that is already deleted, should return a TableServiceError + StepVerifier.create(azureTable.getTables().deleteWithResponseAsync(tableZ, UUID.randomUUID().toString(), Context.NONE)) .expectError(com.azure.data.tables.implementation.models.TableServiceErrorException.class) .verify(); @@ -173,142 +211,94 @@ void deleteTable() { @Test void queryTable(){ - String tableName = "testTable3"; - AzureTableImpl azureTable = auth(); String requestId = UUID.randomUUID().toString(); QueryOptions queryOptions = new QueryOptions() - .setFormat(OdataMetadataFormat.APPLICATION_JSON_ODATA_MINIMALMETADATA) - .setTop(2); + .setFormat(OdataMetadataFormat.APPLICATION_JSON_ODATA_MINIMALMETADATA); + //Verify both are returned with a query without criteria StepVerifier.create(azureTable.getTables().queryWithResponseAsync(requestId, null, queryOptions, Context.NONE)) .assertNext(response -> { - System.out.println("OUT" + response.getValue().getValue().get(0).getTableName()); - //System.out.println((TableQueryResponse) response); Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals(response.getValue().getValue().get(0).getTableName(), tableA); + Assertions.assertEquals(response.getValue().getValue().get(1).getTableName(), tableB); }) .expectComplete() .verify(); - } -// @Test -// void insertAndDeleteWithEtag(){ -// String tableName = "table3"; -// AzureTableImpl azureTable = auth(); -// String requestId = UUID.randomUUID().toString(); -// String pk = "Product"; -// String rk = "whiteboard2"; -// String etag = ""; -// -// Map properties = new HashMap<>(); -// properties.put("PartitionKey", pk); -// properties.put("RowKey", rk); -// -// TestPublisher testPublisher = TestPublisher.create(); -// //insert -// StepVerifier.create(azureTable.getTables().insertEntityWithResponseAsync(tableName, 500, -// requestId, ResponseFormat.RETURN_CONTENT, properties, null, Context.NONE)) -// .assertNext(response -> { -// System.out.println(response); -// response.getValue().get("odata.etag"); -// Assertions.assertEquals(201, response.getStatusCode()); -// -// StepVerifier.create(azureTable.getTables().deleteEntityWithResponseAsync(tableName, pk, -// rk, response.getValue().get("odata.etag").toString(), 500, requestId, null, Context.NONE)) -// .assertNext(response2 -> { -// System.out.println(response2); -// Assertions.assertEquals(204, response2.getStatusCode()); -// }) -// .expectComplete() -// .verify(); -// -// }) -// .expectComplete() -// .verify(); -// } + queryOptions.setTop(1); - @Test - void insertAndDeleteNoEtag(){ -// String tableName = "table3"; -// String pk = "product"; -// String rk = "glue"; -// insertEntity(tableName,pk, rk); -// deleteEntity(tableName,pk,rk); + //Verify both only first is returned with top filter + StepVerifier.create(azureTable.getTables().queryWithResponseAsync(requestId, null, + queryOptions, Context.NONE)) + .assertNext(response -> { + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals(response.getValue().getValue().size(), 1); + }) + .expectComplete() + .verify(); } @Test - void insertMergeDeleteEntity(){ - String tableName = "table3"; + void insertNoEtag(){ Map properties = new HashMap<>(); - properties.put("PartitionKey", "Store"); - properties.put("RowKey", "Atlanta"); - properties.put("Size", "200"); - insertEntity(tableName, properties); - properties.put("Employees", "15"); - properties.remove("Size"); - mergeEntity(tableName,properties); - //deleteEntity(tableName,properties); - } + properties.put(pk, "Store"); + properties.put(rk, "Seattle"); - @Test - void insertUpdateDeleteEntity(){ - String tableName = "table3"; - Map properties = new HashMap<>(); - properties.put("PartitionKey", "Store"); - properties.put("RowKey", "Boston"); - properties.put("Size", "200"); - insertEntity(tableName,properties); - properties.put("Employees", "15"); - properties.remove("Size"); - updateEntity(tableName, properties); - deleteEntity(tableName, properties); - } - void updateEntity(String tableName, Map properties) { AzureTableImpl azureTable = auth(); - StepVerifier.create(azureTable.getTables().updateEntityWithResponseAsync(tableName, properties.get("PartitionKey").toString(), - properties.get("RowKey").toString(), 500, UUID.randomUUID().toString(), "*", properties, null, Context.NONE)) + String requestId = UUID.randomUUID().toString(); + + StepVerifier.create(azureTable.getTables().insertEntityWithResponseAsync(tableB, 500, + requestId, ResponseFormat.RETURN_CONTENT, properties, null, Context.NONE)) .assertNext(response -> { - Assertions.assertEquals(204, response.getStatusCode()); + Assertions.assertEquals(201, response.getStatusCode()); }) .expectComplete() .verify(); + } @Test - void mergeEntity(String tableName, Map properties ){ - AzureTableImpl azureTable = auth(); - - StepVerifier.create(azureTable.getTables().mergeEntityWithResponseAsync(tableName, properties.get("PartitionKey").toString(), - properties.get("RowKey").toString(), 500, UUID.randomUUID().toString(), "*", properties, null, Context.NONE)) + void mergeEntity(){ + propertiesB.put("Address", "23 Newbury Street"); + StepVerifier.create(azureTable.getTables().mergeEntityWithResponseAsync(tableA, propertiesB.get("PartitionKey").toString(), + propertiesB.get("RowKey").toString(), 500, UUID.randomUUID().toString(), "*", propertiesB, null, Context.NONE)) .assertNext(response -> { Assertions.assertEquals(204, response.getStatusCode()); }) .expectComplete() .verify(); + + //TODO: Query and check } @Test - void insertEntity(String tableName, Map properties){ - AzureTableImpl azureTable = auth(); - String requestId = UUID.randomUUID().toString(); + void updateEntity(){ + propertiesB.remove("Size"); + propertiesB.put("Manager", "Jessica Davis"); - StepVerifier.create(azureTable.getTables().insertEntityWithResponseAsync(tableName, 500, - requestId, ResponseFormat.RETURN_CONTENT, properties, null, Context.NONE)) + StepVerifier.create(azureTable.getTables().updateEntityWithResponseAsync(tableA, propertiesB.get("PartitionKey").toString(), + propertiesB.get("RowKey").toString(), 500, UUID.randomUUID().toString(), "*", propertiesB, null, Context.NONE)) .assertNext(response -> { - Assertions.assertEquals(201, response.getStatusCode()); + Assertions.assertEquals(204, response.getStatusCode()); }) .expectComplete() .verify(); + + //TODO: Query and check } @Test - void deleteEntity(String tableName, Map properties){ - AzureTableImpl azureTable = auth(); + void deleteEntity(){ String requestId = UUID.randomUUID().toString(); + Map propertiesC = new HashMap<>(); + propertiesC.put(pk, "Store"); + propertiesC.put(rk, "Chicago"); + insertEntityHelper(tableB, propertiesC); - StepVerifier.create(azureTable.getTables().deleteEntityWithResponseAsync(tableName, properties.get("PartitionKey").toString(), - properties.get("RowKey").toString(), "*", 500, requestId, null, Context.NONE)) + StepVerifier.create(azureTable.getTables().deleteEntityWithResponseAsync(tableB, propertiesC.get("PartitionKey").toString(), + propertiesC.get("RowKey").toString(), "*", 500, requestId, null, Context.NONE)) .assertNext(response -> { System.out.println(response); Assertions.assertEquals(204, response.getStatusCode()); @@ -318,125 +308,53 @@ void deleteEntity(String tableName, Map properties){ } @Test - void queryEntity(String tableName){ - AzureTableImpl azureTable = auth(); + void queryEntity() throws InterruptedException { String requestId = UUID.randomUUID().toString(); QueryOptions queryOptions = new QueryOptions(); - queryOptions.setSelect("name"); - StepVerifier.create(azureTable.getTables().queryEntitiesWithResponseAsync(tableName, null, + StepVerifier.create(azureTable.getTables().queryEntitiesWithResponseAsync(tableA, null, requestId, null, null, queryOptions, Context.NONE)) .assertNext(response -> { - System.out.println(response); - Assertions.assertEquals(204, response.getStatusCode()); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals(true, response.getValue().getValue().get(0).containsValue("Atlanta")); + Assertions.assertEquals(true, response.getValue().getValue().get(1).containsValue("Boston")); + }) .expectComplete() .verify(); - } - - @Test - void allTests() { - String tableName = "table3"; - //deleteTable(tableName); - //createTable(tableName); - //insertEntity(tableName); - //queryEntity(tableName); - //queryTable(tableName); - //deleteTable(tableName); - - } - - - - @Test - void TablesAuth() { - final String connectionString = System.getenv("azure_tables_connection_string"); - final List policies = new ArrayList<>(); - - StorageConnectionString storageConnectionString - = StorageConnectionString.create(connectionString, new ClientLogger("tables")); - System.out.println(storageConnectionString); - - StorageAuthenticationSettings authSettings = storageConnectionString.getStorageAuthSettings(); - - TablesSharedKeyCredential sharedKeyCredential = new TablesSharedKeyCredential(authSettings.getAccount().getName(), - authSettings.getAccount().getAccessKey()); - - //storagesharedkey object and the storage auth object - policies.add(new AddDatePolicy()); - policies.add(new TablesSharedKeyCredentialPolicy(sharedKeyCredential)); - policies.add(new HttpLoggingPolicy(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS))); - //HttpLoggingPolicy() - - final HttpPipeline pipeline = new HttpPipelineBuilder() - .httpClient(null) - .policies(policies.toArray(new HttpPipelinePolicy[0])) - .build(); + queryOptions.setSelect("Employees"); + StepVerifier.create(azureTable.getTables().queryEntitiesWithResponseAsync(tableA, null, + requestId, null, null, queryOptions, Context.NONE)) + .assertNext(response -> { + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals(true, response.getValue().getValue().get(0).containsValue("50")); + Assertions.assertEquals(true, response.getValue().getValue().get(1).containsValue("200")); - AzureTableImplBuilder azureTableImplBuilder = new AzureTableImplBuilder(); - AzureTableImpl azureTable = azureTableImplBuilder - .pipeline(pipeline) - .url("https://telboytrial.table.core.windows.net/") - .buildClient(); + }) + .expectComplete() + .verify(); - try{ - TablesImpl tables = azureTable.getTables(); + //queryOptions.setSelect(""); + queryOptions.setFilter("RowKey eq Boston"); + StepVerifier.create(azureTable.getTables().queryEntitiesWithResponseAsync(tableA, null, + requestId, null, null, queryOptions, Context.NONE)) + .assertNext(response -> { + System.out.print("Here"); + for (Iterator> it = response.getValue().getValue().iterator(); it.hasNext(); ) { + Map m = it.next(); + System.out.println(m); - StepVerifier.create(tables.createWithResponseAsync(new TableProperties().setTableName("ebTable"), - "ID23", - ResponseFormat.RETURN_CONTENT, - null,null)) - .assertNext(response -> { - System.out.println(response); - Assertions.assertEquals(200, response.getStatusCode()); - }) - .expectComplete() - .verify(); - } catch (Exception e){ - System.out.print(e); - } + } + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals(true, response.getValue().getValue().get(0).containsValue("Boston")); -// try{ -// TablesImpl tables = azureTable.getTables(); -// -// StepVerifier.create(tables.deleteWithResponseAsync("ebTable","ID23",Context.NONE)) -// .assertNext(response -> { -// System.out.println(response); -// Assertions.assertEquals(200, response.getStatusCode()); -// }) -// .expectComplete() -// .verify(); -// } catch (Exception e){ -// System.out.print(e); -// } + }) + .expectComplete() + .verify(); + TimeUnit.SECONDS.sleep(5); } - - - - - - - -// @Test -// void createTableTest() { -// StringToSign = VERB + "\n" + -// Content-MD5 + "\n" + -// Content-Type + "\n" + -// Date + "\n" + -// CanonicalizedResource; -// -// } -// -// -// @Test -// void createAndUpdateTable() throws InterruptedException { -// TablesImpl ti = new TablesImpl( new AzureTableImpl()); -// Mono c = ti.createWithResponseAsync( new TableProperties(), "requestId", RETURN_CONTENT, -// null , new Context("key", "value")); -// } - } From d54ae2589a45cb82c2924e3283390ac41416db60 Mon Sep 17 00:00:00 2001 From: Eleanor Boyd Date: Thu, 25 Jun 2020 11:27:31 -0400 Subject: [PATCH 09/33] fixing format and POM --- sdk/tables/azure-data-tables/pom.xml | 21 +------- .../tables/TablesSharedKeyCredential.java | 51 ++++++------------- .../TablesSharedKeyCredentialPolicy.java | 2 +- .../com/azure/data/tables/autorestTest.java | 44 ++++++++-------- 4 files changed, 42 insertions(+), 76 deletions(-) diff --git a/sdk/tables/azure-data-tables/pom.xml b/sdk/tables/azure-data-tables/pom.xml index e83bba6f29c4..7eec75455151 100644 --- a/sdk/tables/azure-data-tables/pom.xml +++ b/sdk/tables/azure-data-tables/pom.xml @@ -45,14 +45,7 @@ Licensed under the MIT License. com.azure azure-storage-common - 12.7.0-beta.1 - test - - - junit - junit - 4.8.2 - test + 12.7.0-beta.1 org.junit.jupiter @@ -66,18 +59,6 @@ Licensed under the MIT License. 3.3.5.RELEASE test - - com.azure - azure-storage-common - 12.6.1 - compile - - - junit - junit - 4.8.2 - test - diff --git a/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredential.java b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredential.java index 7e3e213f0376..4ceaf9689694 100644 --- a/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredential.java +++ b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredential.java @@ -3,12 +3,10 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.http.policy.HttpPipelinePolicy; import com.azure.core.util.CoreUtils; -import com.azure.storage.common.StorageSharedKeyCredential; import com.azure.storage.common.implementation.StorageImplUtils; import com.azure.storage.common.policy.StorageSharedKeyCredentialPolicy; import java.net.URL; -import java.nio.charset.StandardCharsets; import java.text.Collator; import java.util.*; import java.util.stream.Collectors; @@ -33,14 +31,14 @@ public static TablesSharedKeyCredential fromConnectionString(String connectionSt String[] var2 = connectionString.split(";"); int var3 = var2.length; - for(int var4 = 0; var4 < var3; ++var4) { + for (int var4 = 0; var4 < var3; ++var4) { String connectionStringPiece = var2[var4]; String[] kvp = connectionStringPiece.split("=", 2); connectionStringPieces.put(kvp[0].toLowerCase(Locale.ROOT), kvp[1]); } - String accountName = (String)connectionStringPieces.get("accountname"); - String accountKey = (String)connectionStringPieces.get("accountkey"); + String accountName = (String) connectionStringPieces.get("accountname"); + String accountKey = (String) connectionStringPieces.get("accountkey"); if (!CoreUtils.isNullOrEmpty(accountName) && !CoreUtils.isNullOrEmpty(accountKey)) { return new TablesSharedKeyCredential(accountName, accountKey); } else { @@ -62,36 +60,20 @@ public String computeHmac256(String stringToSign) { } private String buildStringToSign(URL requestURL, String httpMethod, Map headers) { - String contentLength = (String)headers.get("Content-Length"); - contentLength = contentLength.equals("0") ? "" : contentLength; String dateHeader = headers.containsKey("x-ms-date") ? "" : this.getStandardHeaderValue(headers, "Date"); -// String a = String.join("\n", -// httpMethod, -// this.getStandardHeaderValue(headers, "Content-MD5"), //content-md5 -// this.getStandardHeaderValue(headers, "Content-Type"), //content-type -// dateHeader, -// "/telboytrial/table3()&$select=name" -// ); - - String s = String.join("\n", + return String.join("\n", dateHeader, //date - this.getCanonicalizedResource(requestURL)); //canonicalized resoucre - System.out.println("EB-t vvv"); - System.out.println(s); - return s; + this.getCanonicalizedResource(requestURL)); //Canonicalized resource } private String getStandardHeaderValue(Map headers, String headerName) { - String headerValue = (String)headers.get(headerName); -// if (headerName == "Content-Type"){ -// return "application/atom+xml"; -// } + String headerValue = (String) headers.get(headerName); return headerValue == null ? "" : headerValue; } private String getAdditionalXmsHeaders(Map headers) { - List xmsHeaderNameArray = (List)headers.entrySet().stream().filter((entry) -> { - return ((String)entry.getKey()).toLowerCase(Locale.ROOT).startsWith("x-ms-"); + List xmsHeaderNameArray = (List) headers.entrySet().stream().filter((entry) -> { + return ((String) entry.getKey()).toLowerCase(Locale.ROOT).startsWith("x-ms-"); }).filter((entry) -> { return entry.getValue() != null; }).map(Map.Entry::getKey).collect(Collectors.toList()); @@ -102,8 +84,8 @@ private String getAdditionalXmsHeaders(Map headers) { StringBuilder canonicalizedHeaders = new StringBuilder(); String key; - for(Iterator var4 = xmsHeaderNameArray.iterator(); var4.hasNext(); canonicalizedHeaders.append(key.toLowerCase(Locale.ROOT)).append(':').append((String)headers.get(key))) { - key = (String)var4.next(); + for (Iterator var4 = xmsHeaderNameArray.iterator(); var4.hasNext(); canonicalizedHeaders.append(key.toLowerCase(Locale.ROOT)).append(':').append((String) headers.get(key))) { + key = (String) var4.next(); if (canonicalizedHeaders.length() > 0) { canonicalizedHeaders.append('\n'); } @@ -130,25 +112,24 @@ private String getCanonicalizedResource(URL requestURL) { Collections.sort(queryParamNames); Iterator var5 = queryParamNames.iterator(); - while(var5.hasNext()) { - String queryParamName = (String)var5.next(); - String[] queryParamValues = (String[])queryParams.get(queryParamName); + while (var5.hasNext()) { + String queryParamName = (String) var5.next(); + String[] queryParamValues = (String[]) queryParams.get(queryParamName); Arrays.sort(queryParamValues); String queryParamValuesStr = String.join(",", queryParamValues); - if(queryParamName.equals("comp")) { + if (queryParamName.equals("comp")) { canonicalizedResource.append("?").append(queryParamName.toLowerCase(Locale.ROOT)).append("=").append(queryParamValuesStr); } } -// canonicalizedResource.append("?").append("comp".toLowerCase(Locale.ROOT)).append("=").append("metadata"); return canonicalizedResource.toString(); } } public static com.azure.storage.common.StorageSharedKeyCredential getSharedKeyCredentialFromPipeline(HttpPipeline httpPipeline) { - for(int i = 0; i < httpPipeline.getPolicyCount(); ++i) { + for (int i = 0; i < httpPipeline.getPolicyCount(); ++i) { HttpPipelinePolicy httpPipelinePolicy = httpPipeline.getPolicy(i); if (httpPipelinePolicy instanceof TablesSharedKeyCredentialPolicy) { - StorageSharedKeyCredentialPolicy storageSharedKeyCredentialPolicy = (StorageSharedKeyCredentialPolicy)httpPipelinePolicy; + StorageSharedKeyCredentialPolicy storageSharedKeyCredentialPolicy = (StorageSharedKeyCredentialPolicy) httpPipelinePolicy; return storageSharedKeyCredentialPolicy.sharedKeyCredential(); } } diff --git a/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredentialPolicy.java b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredentialPolicy.java index 26ec4f1edf6a..e60573ab9ffb 100644 --- a/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredentialPolicy.java +++ b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredentialPolicy.java @@ -7,7 +7,7 @@ import com.azure.core.http.policy.HttpPipelinePolicy; import reactor.core.publisher.Mono; -public final class TablesSharedKeyCredentialPolicy implements HttpPipelinePolicy{ +public final class TablesSharedKeyCredentialPolicy implements HttpPipelinePolicy { private final TablesSharedKeyCredential credential; diff --git a/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/autorestTest.java b/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/autorestTest.java index 2a782cd61a34..8072c6d72d5c 100644 --- a/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/autorestTest.java +++ b/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/autorestTest.java @@ -1,24 +1,28 @@ package com.azure.data.tables; -import com.azure.core.http.*; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; import com.azure.core.http.policy.*; - import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.data.tables.implementation.AzureTableImpl; import com.azure.data.tables.implementation.AzureTableImplBuilder; - import com.azure.data.tables.implementation.TablesImpl; -import com.azure.data.tables.implementation.models.*; +import com.azure.data.tables.implementation.models.OdataMetadataFormat; +import com.azure.data.tables.implementation.models.QueryOptions; +import com.azure.data.tables.implementation.models.ResponseFormat; +import com.azure.data.tables.implementation.models.TableProperties; import com.azure.storage.common.StorageSharedKeyCredential; import com.azure.storage.common.implementation.connectionstring.StorageAuthenticationSettings; import com.azure.storage.common.implementation.connectionstring.StorageConnectionString; - import com.azure.storage.common.policy.StorageSharedKeyCredentialPolicy; -import org.junit.jupiter.api.*; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import reactor.test.StepVerifier; - import java.util.*; import java.util.concurrent.TimeUnit; @@ -59,17 +63,17 @@ void createAndUpdateTableFixed() { .url("/https://telboytrial.table.core.windows.net") .buildClient(); - try{ + try { TablesImpl tables = azureTable.getTables(); - StepVerifier.create(tables.deleteWithResponseAsync("ebTable","ID23",Context.NONE)) + StepVerifier.create(tables.deleteWithResponseAsync("ebTable", "ID23", Context.NONE)) .assertNext(response -> { System.out.println(response); Assertions.assertEquals(200, response.getStatusCode()); }) .expectComplete() .verify(); - } catch (Exception e){ + } catch (Exception e) { System.out.print(e); } @@ -106,7 +110,7 @@ static AzureTableImpl auth() { @BeforeEach - void beforeTests() { + void beforeTests() { createTableHelper(tableA); createTableHelper(tableB); @@ -131,7 +135,7 @@ void afterTests() throws InterruptedException { } - void createTableHelper(String tableName){ + void createTableHelper(String tableName) { AzureTableImpl azureTable = auth(); TableProperties tableProperties = new TableProperties().setTableName(tableName); @@ -154,7 +158,7 @@ void deleteTableHelper(String tableName) throws InterruptedException { } - void insertEntityHelper(String tableName, Map properties){ + void insertEntityHelper(String tableName, Map properties) { String requestId = UUID.randomUUID().toString(); azureTable.getTables().insertEntityWithResponseAsync(tableName, 500, @@ -194,7 +198,7 @@ void deleteTable() { createTableHelper(tableZ); //delete a table, successful path - StepVerifier.create(azureTable.getTables().deleteWithResponseAsync(tableZ, UUID.randomUUID().toString(), + StepVerifier.create(azureTable.getTables().deleteWithResponseAsync(tableZ, UUID.randomUUID().toString(), Context.NONE)) .assertNext(response -> { Assertions.assertEquals(204, response.getStatusCode()); @@ -203,14 +207,14 @@ void deleteTable() { .verify(); //try to delete table that is already deleted, should return a TableServiceError - StepVerifier.create(azureTable.getTables().deleteWithResponseAsync(tableZ, UUID.randomUUID().toString(), + StepVerifier.create(azureTable.getTables().deleteWithResponseAsync(tableZ, UUID.randomUUID().toString(), Context.NONE)) .expectError(com.azure.data.tables.implementation.models.TableServiceErrorException.class) .verify(); } @Test - void queryTable(){ + void queryTable() { String requestId = UUID.randomUUID().toString(); QueryOptions queryOptions = new QueryOptions() .setFormat(OdataMetadataFormat.APPLICATION_JSON_ODATA_MINIMALMETADATA); @@ -240,7 +244,7 @@ void queryTable(){ } @Test - void insertNoEtag(){ + void insertNoEtag() { Map properties = new HashMap<>(); properties.put(pk, "Store"); properties.put(rk, "Seattle"); @@ -260,7 +264,7 @@ void insertNoEtag(){ } @Test - void mergeEntity(){ + void mergeEntity() { propertiesB.put("Address", "23 Newbury Street"); StepVerifier.create(azureTable.getTables().mergeEntityWithResponseAsync(tableA, propertiesB.get("PartitionKey").toString(), propertiesB.get("RowKey").toString(), 500, UUID.randomUUID().toString(), "*", propertiesB, null, Context.NONE)) @@ -274,7 +278,7 @@ void mergeEntity(){ } @Test - void updateEntity(){ + void updateEntity() { propertiesB.remove("Size"); propertiesB.put("Manager", "Jessica Davis"); @@ -290,7 +294,7 @@ void updateEntity(){ } @Test - void deleteEntity(){ + void deleteEntity() { String requestId = UUID.randomUUID().toString(); Map propertiesC = new HashMap<>(); propertiesC.put(pk, "Store"); From ac21a3d8424c519f6625b942013ccd24be521419 Mon Sep 17 00:00:00 2001 From: Eleanor Boyd Date: Mon, 29 Jun 2020 16:12:21 -0400 Subject: [PATCH 10/33] arrange-act-assert formatting --- sdk/tables/azure-data-tables/pom.xml | 25 +- .../tables/TablesSharedKeyCredential.java | 144 ++-- .../TablesSharedKeyCredentialPolicy.java | 25 +- .../tables/implementation/TablesImpl.java | 755 +++++++++--------- .../azure/data/tables/AzureTableImplTest.java | 477 +++++++++++ .../tables/AzureTablesAsyncClientTest.java | 134 ---- .../com/azure/data/tables/autorestTest.java | 364 --------- 7 files changed, 936 insertions(+), 988 deletions(-) create mode 100644 sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java delete mode 100644 sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTablesAsyncClientTest.java delete mode 100644 sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/autorestTest.java diff --git a/sdk/tables/azure-data-tables/pom.xml b/sdk/tables/azure-data-tables/pom.xml index 7eec75455151..8f18fa043f49 100644 --- a/sdk/tables/azure-data-tables/pom.xml +++ b/sdk/tables/azure-data-tables/pom.xml @@ -2,7 +2,8 @@ Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. --> - + 4.0.0 com.azure @@ -45,20 +46,26 @@ Licensed under the MIT License. com.azure azure-storage-common - 12.7.0-beta.1 + 12.7.0 + + + org.junit.jupiter + junit-jupiter + RELEASE + test - - org.junit.jupiter - junit-jupiter - RELEASE - test - io.projectreactor - reactor-test + reactor-test 3.3.5.RELEASE test + + com.azure + azure-core-test + 1.3.0 + test + diff --git a/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredential.java b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredential.java index 4ceaf9689694..c5287404a5a2 100644 --- a/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredential.java +++ b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredential.java @@ -1,24 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + package com.azure.data.tables; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.util.CoreUtils; import com.azure.storage.common.implementation.StorageImplUtils; -import com.azure.storage.common.policy.StorageSharedKeyCredentialPolicy; import java.net.URL; -import java.text.Collator; import java.util.*; -import java.util.stream.Collectors; +/** + * A Class which helps generate the shared key credentials for a given storage account to create a Http requests to + * access Azure Tables + */ public class TablesSharedKeyCredential { - private static final String AUTHORIZATION_HEADER_FORMAT = "SharedKey %s:%s"; - private static final String ACCOUNT_NAME = "accountname"; - private static final String ACCOUNT_KEY = "accountkey"; + private static final String AUTHORIZATION_HEADER_FORMAT = "SharedKeyLite %s:%s"; private final String accountName; private final String accountKey; + /** + * Constructor for TableSharedKeyCredential Class + * + * @param accountName name of the storage account + * @param accountKey key to the storage account + */ public TablesSharedKeyCredential(String accountName, String accountKey) { Objects.requireNonNull(accountName, "'accountName' cannot be null."); Objects.requireNonNull(accountKey, "'accountKey' cannot be null."); @@ -26,75 +31,53 @@ public TablesSharedKeyCredential(String accountName, String accountKey) { this.accountKey = accountKey; } - public static TablesSharedKeyCredential fromConnectionString(String connectionString) { - HashMap connectionStringPieces = new HashMap(); - String[] var2 = connectionString.split(";"); - int var3 = var2.length; - - for (int var4 = 0; var4 < var3; ++var4) { - String connectionStringPiece = var2[var4]; - String[] kvp = connectionStringPiece.split("=", 2); - connectionStringPieces.put(kvp[0].toLowerCase(Locale.ROOT), kvp[1]); - } - - String accountName = (String) connectionStringPieces.get("accountname"); - String accountKey = (String) connectionStringPieces.get("accountkey"); - if (!CoreUtils.isNullOrEmpty(accountName) && !CoreUtils.isNullOrEmpty(accountKey)) { - return new TablesSharedKeyCredential(accountName, accountKey); - } else { - throw new IllegalArgumentException("Connection string must contain 'AccountName' and 'AccountKey'."); - } + /** + * Generates the Auth Headers + * + * @param requestURL the URL which the request is going to + * @param headers the headers of the request + * @return the auth header + */ + public String generateAuthorizationHeader(URL requestURL, Map headers) { + String signature = StorageImplUtils.computeHMac256(this.accountKey, this.buildStringToSign(requestURL, + headers)); + return String.format(AUTHORIZATION_HEADER_FORMAT, this.accountName, signature); } - public String getAccountName() { - return this.accountName; - } - - public String generateAuthorizationHeader(URL requestURL, String httpMethod, Map headers) { - String signature = StorageImplUtils.computeHMac256(this.accountKey, this.buildStringToSign(requestURL, httpMethod, headers)); - return String.format("SharedKeyLite %s:%s", this.accountName, signature); - } - - public String computeHmac256(String stringToSign) { - return StorageImplUtils.computeHMac256(this.accountKey, stringToSign); - } - - private String buildStringToSign(URL requestURL, String httpMethod, Map headers) { - String dateHeader = headers.containsKey("x-ms-date") ? "" : this.getStandardHeaderValue(headers, "Date"); + /** + * creates the String to Sign + * + * @param requestURL the URL which the request is going to + * @param headers the headers of the request + * @return a string to sign for the request + */ + private String buildStringToSign(URL requestURL, Map headers) { + String dateHeader = headers.containsKey("x-ms-date") ? "" : this.getStandardHeaderValue(headers, + "Date"); return String.join("\n", dateHeader, //date this.getCanonicalizedResource(requestURL)); //Canonicalized resource } + /** + * gets necessary headers if the request does not already contain them + * + * @param headers a map of the headers which the request has + * @param headerName the name of the header to get the standard header for + * @return the standard header for the given name + */ private String getStandardHeaderValue(Map headers, String headerName) { - String headerValue = (String) headers.get(headerName); + String headerValue = headers.get(headerName); return headerValue == null ? "" : headerValue; } - private String getAdditionalXmsHeaders(Map headers) { - List xmsHeaderNameArray = (List) headers.entrySet().stream().filter((entry) -> { - return ((String) entry.getKey()).toLowerCase(Locale.ROOT).startsWith("x-ms-"); - }).filter((entry) -> { - return entry.getValue() != null; - }).map(Map.Entry::getKey).collect(Collectors.toList()); - if (xmsHeaderNameArray.isEmpty()) { - return ""; - } else { - Collections.sort(xmsHeaderNameArray, Collator.getInstance(Locale.ROOT)); - StringBuilder canonicalizedHeaders = new StringBuilder(); - - String key; - for (Iterator var4 = xmsHeaderNameArray.iterator(); var4.hasNext(); canonicalizedHeaders.append(key.toLowerCase(Locale.ROOT)).append(':').append((String) headers.get(key))) { - key = (String) var4.next(); - if (canonicalizedHeaders.length() > 0) { - canonicalizedHeaders.append('\n'); - } - } - - return canonicalizedHeaders.toString(); - } - } + /** + * returns the canonicalized resource needed for a request + * + * @param requestURL the url of the request + * @return the string that is the canonicalized resource + */ private String getCanonicalizedResource(URL requestURL) { StringBuilder canonicalizedResource = new StringBuilder("/"); canonicalizedResource.append(this.accountName); @@ -104,36 +87,21 @@ private String getCanonicalizedResource(URL requestURL) { canonicalizedResource.append('/'); } - if (requestURL.getQuery() == null) { - return canonicalizedResource.toString(); - } else { + if (requestURL.getQuery() != null) { Map queryParams = StorageImplUtils.parseQueryStringSplitValues(requestURL.getQuery()); - ArrayList queryParamNames = new ArrayList(queryParams.keySet()); + ArrayList queryParamNames = new ArrayList<>(queryParams.keySet()); Collections.sort(queryParamNames); - Iterator var5 = queryParamNames.iterator(); - while (var5.hasNext()) { - String queryParamName = (String) var5.next(); - String[] queryParamValues = (String[]) queryParams.get(queryParamName); + for (String queryParamName : queryParamNames) { + String[] queryParamValues = queryParams.get(queryParamName); Arrays.sort(queryParamValues); String queryParamValuesStr = String.join(",", queryParamValues); if (queryParamName.equals("comp")) { - canonicalizedResource.append("?").append(queryParamName.toLowerCase(Locale.ROOT)).append("=").append(queryParamValuesStr); + canonicalizedResource.append("?").append(queryParamName.toLowerCase(Locale.ROOT)).append("=") + .append(queryParamValuesStr); } } - return canonicalizedResource.toString(); - } - } - - public static com.azure.storage.common.StorageSharedKeyCredential getSharedKeyCredentialFromPipeline(HttpPipeline httpPipeline) { - for (int i = 0; i < httpPipeline.getPolicyCount(); ++i) { - HttpPipelinePolicy httpPipelinePolicy = httpPipeline.getPolicy(i); - if (httpPipelinePolicy instanceof TablesSharedKeyCredentialPolicy) { - StorageSharedKeyCredentialPolicy storageSharedKeyCredentialPolicy = (StorageSharedKeyCredentialPolicy) httpPipelinePolicy; - return storageSharedKeyCredentialPolicy.sharedKeyCredential(); - } } - - return null; + return canonicalizedResource.toString(); } } diff --git a/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredentialPolicy.java b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredentialPolicy.java index e60573ab9ffb..3ed371e874b0 100644 --- a/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredentialPolicy.java +++ b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredentialPolicy.java @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + package com.azure.data.tables; @@ -7,20 +10,32 @@ import com.azure.core.http.policy.HttpPipelinePolicy; import reactor.core.publisher.Mono; +/** + * This class helps authenticate an Http request for the Tables service + */ public final class TablesSharedKeyCredentialPolicy implements HttpPipelinePolicy { private final TablesSharedKeyCredential credential; + /** + * constructor for the TablesSharedKeyCredentialPolicy class + * + * @param credential the credentials of the account + */ public TablesSharedKeyCredentialPolicy(TablesSharedKeyCredential credential) { this.credential = credential; } - public TablesSharedKeyCredential sharedKeyCredential() { - return this.credential; - } - + /** + * creates an Http response + * + * @param context the context of the http pipeline + * @param next the next Http pipeline policy + * @return an Http response + */ public Mono process(HttpPipelineCallContext context, HttpPipelineNextPolicy next) { - String authorizationValue = this.credential.generateAuthorizationHeader(context.getHttpRequest().getUrl(), context.getHttpRequest().getHttpMethod().toString(), context.getHttpRequest().getHeaders().toMap()); + String authorizationValue = this.credential.generateAuthorizationHeader(context.getHttpRequest().getUrl(), + context.getHttpRequest().getHeaders().toMap()); context.getHttpRequest().setHeader("Authorization", authorizationValue); return next.process(); } diff --git a/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/implementation/TablesImpl.java b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/implementation/TablesImpl.java index e65eb9d22457..2fbecbba2b29 100644 --- a/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/implementation/TablesImpl.java +++ b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/implementation/TablesImpl.java @@ -4,52 +4,28 @@ package com.azure.data.tables.implementation; -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.annotation.*; import com.azure.core.exception.HttpResponseException; import com.azure.core.http.rest.RestProxy; import com.azure.core.util.Context; -import com.azure.data.tables.implementation.models.OdataMetadataFormat; -import com.azure.data.tables.implementation.models.QueryOptions; -import com.azure.data.tables.implementation.models.ResponseFormat; -import com.azure.data.tables.implementation.models.SignedIdentifier; -import com.azure.data.tables.implementation.models.TableProperties; -import com.azure.data.tables.implementation.models.TableServiceErrorException; -import com.azure.data.tables.implementation.models.TablesCreateResponse; -import com.azure.data.tables.implementation.models.TablesDeleteEntityResponse; -import com.azure.data.tables.implementation.models.TablesDeleteResponse; -import com.azure.data.tables.implementation.models.TablesGetAccessPolicyResponse; -import com.azure.data.tables.implementation.models.TablesInsertEntityResponse; -import com.azure.data.tables.implementation.models.TablesMergeEntityResponse; -import com.azure.data.tables.implementation.models.TablesQueryEntitiesResponse; -import com.azure.data.tables.implementation.models.TablesQueryEntitiesWithPartitionAndRowKeyResponse; -import com.azure.data.tables.implementation.models.TablesQueryResponse; -import com.azure.data.tables.implementation.models.TablesSetAccessPolicyResponse; -import com.azure.data.tables.implementation.models.TablesUpdateEntityResponse; +import com.azure.data.tables.implementation.models.*; +import reactor.core.publisher.Mono; + import java.util.List; import java.util.Map; -import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in Tables. */ +/** + * An instance of this class provides access to all the operations defined in Tables. + */ public final class TablesImpl { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final TablesService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final AzureTableImpl client; /** @@ -73,182 +49,182 @@ private interface TablesService { @ExpectedResponses({200}) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono query( - @HostParam("url") String url, - @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("DataServiceVersion") String dataServiceVersion, - @QueryParam("$format") OdataMetadataFormat format, - @QueryParam("$top") Integer top, - @QueryParam("$select") String select, - @QueryParam("$filter") String filter, - @QueryParam("NextTableName") String nextTableName, - Context context); + @HostParam("url") String url, + @HeaderParam("x-ms-version") String version, + @HeaderParam("x-ms-client-request-id") String requestId, + @HeaderParam("DataServiceVersion") String dataServiceVersion, + @QueryParam("$format") OdataMetadataFormat format, + @QueryParam("$top") Integer top, + @QueryParam("$select") String select, + @QueryParam("$filter") String filter, + @QueryParam("NextTableName") String nextTableName, + Context context); @Post("/Tables") @ExpectedResponses({201, 204}) @UnexpectedResponseExceptionType(TableServiceErrorException.class) Mono create( - @HostParam("url") String url, - @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("DataServiceVersion") String dataServiceVersion, - @QueryParam("$format") OdataMetadataFormat format, - @HeaderParam("Prefer") ResponseFormat responsePreference, - @BodyParam("application/json") TableProperties tableProperties, - Context context); + @HostParam("url") String url, + @HeaderParam("x-ms-version") String version, + @HeaderParam("x-ms-client-request-id") String requestId, + @HeaderParam("DataServiceVersion") String dataServiceVersion, + @QueryParam("$format") OdataMetadataFormat format, + @HeaderParam("Prefer") ResponseFormat responsePreference, + @BodyParam("application/json") TableProperties tableProperties, + Context context); @Delete("/Tables('{table}')") @ExpectedResponses({204}) @UnexpectedResponseExceptionType(TableServiceErrorException.class) Mono delete( - @HostParam("url") String url, - @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @PathParam("table") String table, - Context context); + @HostParam("url") String url, + @HeaderParam("x-ms-version") String version, + @HeaderParam("x-ms-client-request-id") String requestId, + @PathParam("table") String table, + Context context); @Get("/{table}()") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(TableServiceErrorException.class) Mono queryEntities( - @HostParam("url") String url, - @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("DataServiceVersion") String dataServiceVersion, - @QueryParam("$format") OdataMetadataFormat format, - @QueryParam("$top") Integer top, - @QueryParam("$select") String select, - @QueryParam("$filter") String filter, - @PathParam("table") String table, - @QueryParam("NextPartitionKey") String nextPartitionKey, - @QueryParam("NextRowKey") String nextRowKey, - Context context); + @HostParam("url") String url, + @QueryParam("timeout") Integer timeout, + @HeaderParam("x-ms-version") String version, + @HeaderParam("x-ms-client-request-id") String requestId, + @HeaderParam("DataServiceVersion") String dataServiceVersion, + @QueryParam("$format") OdataMetadataFormat format, + @QueryParam("$top") Integer top, + @QueryParam("$select") String select, + @QueryParam("$filter") String filter, + @PathParam("table") String table, + @QueryParam("NextPartitionKey") String nextPartitionKey, + @QueryParam("NextRowKey") String nextRowKey, + Context context); @Get("/{table}(PartitionKey='{partitionKey}',RowKey='{rowKey}')") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(TableServiceErrorException.class) Mono queryEntitiesWithPartitionAndRowKey( - @HostParam("url") String url, - @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("DataServiceVersion") String dataServiceVersion, - @QueryParam("$format") OdataMetadataFormat format, - @QueryParam("$select") String select, - @QueryParam("$filter") String filter, - @PathParam("table") String table, - @PathParam("partitionKey") String partitionKey, - @PathParam("rowKey") String rowKey, - Context context); + @HostParam("url") String url, + @QueryParam("timeout") Integer timeout, + @HeaderParam("x-ms-version") String version, + @HeaderParam("x-ms-client-request-id") String requestId, + @HeaderParam("DataServiceVersion") String dataServiceVersion, + @QueryParam("$format") OdataMetadataFormat format, + @QueryParam("$select") String select, + @QueryParam("$filter") String filter, + @PathParam("table") String table, + @PathParam("partitionKey") String partitionKey, + @PathParam("rowKey") String rowKey, + Context context); @Put("/{table}(PartitionKey='{partitionKey}',RowKey='{rowKey}')") @ExpectedResponses({204}) @UnexpectedResponseExceptionType(TableServiceErrorException.class) Mono updateEntity( - @HostParam("url") String url, - @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("DataServiceVersion") String dataServiceVersion, - @QueryParam("$format") OdataMetadataFormat format, - @PathParam("table") String table, - @PathParam("partitionKey") String partitionKey, - @PathParam("rowKey") String rowKey, - @HeaderParam("If-Match") String ifMatch, - @BodyParam("application/json") Map tableEntityProperties, - Context context); + @HostParam("url") String url, + @QueryParam("timeout") Integer timeout, + @HeaderParam("x-ms-version") String version, + @HeaderParam("x-ms-client-request-id") String requestId, + @HeaderParam("DataServiceVersion") String dataServiceVersion, + @QueryParam("$format") OdataMetadataFormat format, + @PathParam("table") String table, + @PathParam("partitionKey") String partitionKey, + @PathParam("rowKey") String rowKey, + @HeaderParam("If-Match") String ifMatch, + @BodyParam("application/json") Map tableEntityProperties, + Context context); @Patch("/{table}(PartitionKey='{partitionKey}',RowKey='{rowKey}')") @ExpectedResponses({204}) @UnexpectedResponseExceptionType(TableServiceErrorException.class) Mono mergeEntity( - @HostParam("url") String url, - @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("DataServiceVersion") String dataServiceVersion, - @QueryParam("$format") OdataMetadataFormat format, - @PathParam("table") String table, - @PathParam("partitionKey") String partitionKey, - @PathParam("rowKey") String rowKey, - @HeaderParam("If-Match") String ifMatch, - @BodyParam("application/json") Map tableEntityProperties, - Context context); + @HostParam("url") String url, + @QueryParam("timeout") Integer timeout, + @HeaderParam("x-ms-version") String version, + @HeaderParam("x-ms-client-request-id") String requestId, + @HeaderParam("DataServiceVersion") String dataServiceVersion, + @QueryParam("$format") OdataMetadataFormat format, + @PathParam("table") String table, + @PathParam("partitionKey") String partitionKey, + @PathParam("rowKey") String rowKey, + @HeaderParam("If-Match") String ifMatch, + @BodyParam("application/json") Map tableEntityProperties, + Context context); @Delete("/{table}(PartitionKey='{partitionKey}',RowKey='{rowKey}')") @ExpectedResponses({204}) @UnexpectedResponseExceptionType(TableServiceErrorException.class) Mono deleteEntity( - @HostParam("url") String url, - @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("DataServiceVersion") String dataServiceVersion, - @QueryParam("$format") OdataMetadataFormat format, - @PathParam("table") String table, - @PathParam("partitionKey") String partitionKey, - @PathParam("rowKey") String rowKey, - @HeaderParam("If-Match") String ifMatch, - Context context); + @HostParam("url") String url, + @QueryParam("timeout") Integer timeout, + @HeaderParam("x-ms-version") String version, + @HeaderParam("x-ms-client-request-id") String requestId, + @HeaderParam("DataServiceVersion") String dataServiceVersion, + @QueryParam("$format") OdataMetadataFormat format, + @PathParam("table") String table, + @PathParam("partitionKey") String partitionKey, + @PathParam("rowKey") String rowKey, + @HeaderParam("If-Match") String ifMatch, + Context context); @Post("/{table}") @ExpectedResponses({201, 204}) @UnexpectedResponseExceptionType(TableServiceErrorException.class) Mono insertEntity( - @HostParam("url") String url, - @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("DataServiceVersion") String dataServiceVersion, - @QueryParam("$format") OdataMetadataFormat format, - @PathParam("table") String table, - @HeaderParam("Prefer") ResponseFormat responsePreference, - @BodyParam("application/json") Map tableEntityProperties, - Context context); + @HostParam("url") String url, + @QueryParam("timeout") Integer timeout, + @HeaderParam("x-ms-version") String version, + @HeaderParam("x-ms-client-request-id") String requestId, + @HeaderParam("DataServiceVersion") String dataServiceVersion, + @QueryParam("$format") OdataMetadataFormat format, + @PathParam("table") String table, + @HeaderParam("Prefer") ResponseFormat responsePreference, + @BodyParam("application/json") Map tableEntityProperties, + Context context); @Get("/{table}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(TableServiceErrorException.class) Mono getAccessPolicy( - @HostParam("url") String url, - @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @PathParam("table") String table, - @QueryParam("comp") String comp, - Context context); + @HostParam("url") String url, + @QueryParam("timeout") Integer timeout, + @HeaderParam("x-ms-version") String version, + @HeaderParam("x-ms-client-request-id") String requestId, + @PathParam("table") String table, + @QueryParam("comp") String comp, + Context context); @Put("/{table}") @ExpectedResponses({204}) @UnexpectedResponseExceptionType(TableServiceErrorException.class) Mono setAccessPolicy( - @HostParam("url") String url, - @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @PathParam("table") String table, - @QueryParam("comp") String comp, - @BodyParam("application/xml") List tableAcl, - Context context); + @HostParam("url") String url, + @QueryParam("timeout") Integer timeout, + @HeaderParam("x-ms-version") String version, + @HeaderParam("x-ms-client-request-id") String requestId, + @PathParam("table") String table, + @QueryParam("comp") String comp, + @BodyParam("application/xml") List tableAcl, + Context context); } /** * Queries tables under the given account. * - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when analytics logging is enabled. + * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in + * the analytics logs when analytics logging is enabled. * @param nextTableName A table query continuation token from a previous call. - * @param queryOptions Parameter group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @param queryOptions Parameter group. + * @param context The context to associate with this operation. * @return the properties for the table query response. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono queryWithResponseAsync( - String requestId, String nextTableName, QueryOptions queryOptions, Context context) { + String requestId, String nextTableName, QueryOptions queryOptions, Context context) { final String dataServiceVersion = "3.0"; OdataMetadataFormat formatInternal = null; if (queryOptions != null) { @@ -286,25 +262,25 @@ public Mono queryWithResponseAsync( /** * Creates a new table under the given account. * - * @param tableProperties The properties for creating a table. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when analytics logging is enabled. + * @param tableProperties The properties for creating a table. + * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded + * in the analytics logs when analytics logging is enabled. * @param responsePreference Specifies whether the response should include the inserted entity in the payload. - * Possible values are return-no-content and return-content. - * @param queryOptions Parameter group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws TableServiceErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * Possible values are return-no-content and return-content. + * @param queryOptions Parameter group. + * @param context The context to associate with this operation. * @return the response for a single table. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws TableServiceErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono createWithResponseAsync( - TableProperties tableProperties, - String requestId, - ResponseFormat responsePreference, - QueryOptions queryOptions, - Context context) { + TableProperties tableProperties, + String requestId, + ResponseFormat responsePreference, + QueryOptions queryOptions, + Context context) { final String dataServiceVersion = "3.0"; OdataMetadataFormat formatInternal = null; if (queryOptions != null) { @@ -312,27 +288,27 @@ public Mono createWithResponseAsync( } OdataMetadataFormat format = formatInternal; return service.create( - this.client.getUrl(), - this.client.getVersion(), - requestId, - dataServiceVersion, - format, - responsePreference, - tableProperties, - context); + this.client.getUrl(), + this.client.getVersion(), + requestId, + dataServiceVersion, + format, + responsePreference, + tableProperties, + context); } /** * Operation permanently deletes the specified table. * - * @param table The name of the table. + * @param table The name of the table. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws TableServiceErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * analytics logs when analytics logging is enabled. + * @param context The context to associate with this operation. * @return the completion. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws TableServiceErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono deleteWithResponseAsync(String table, String requestId, Context context) { @@ -342,28 +318,28 @@ public Mono deleteWithResponseAsync(String table, String r /** * Queries entities in a table. * - * @param table The name of the table. - * @param timeout The timeout parameter is expressed in seconds. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when analytics logging is enabled. + * @param table The name of the table. + * @param timeout The timeout parameter is expressed in seconds. + * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded + * in the analytics logs when analytics logging is enabled. * @param nextPartitionKey An entity query continuation token from a previous call. - * @param nextRowKey An entity query continuation token from a previous call. - * @param queryOptions Parameter group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws TableServiceErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @param nextRowKey An entity query continuation token from a previous call. + * @param queryOptions Parameter group. + * @param context The context to associate with this operation. * @return the properties for the table entity query response. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws TableServiceErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono queryEntitiesWithResponseAsync( - String table, - Integer timeout, - String requestId, - String nextPartitionKey, - String nextRowKey, - QueryOptions queryOptions, - Context context) { + String table, + Integer timeout, + String requestId, + String nextPartitionKey, + String nextRowKey, + QueryOptions queryOptions, + Context context) { final String dataServiceVersion = "3.0"; OdataMetadataFormat formatInternal = null; if (queryOptions != null) { @@ -386,46 +362,46 @@ public Mono queryEntitiesWithResponseAsync( } String filter = filterInternal; return service.queryEntities( - this.client.getUrl(), - timeout, - this.client.getVersion(), - requestId, - dataServiceVersion, - format, - top, - select, - filter, - table, - nextPartitionKey, - nextRowKey, - context); + this.client.getUrl(), + timeout, + this.client.getVersion(), + requestId, + dataServiceVersion, + format, + top, + select, + filter, + table, + nextPartitionKey, + nextRowKey, + context); } /** * Queries entities in a table. * - * @param table The name of the table. + * @param table The name of the table. * @param partitionKey The partition key of the entity. - * @param rowKey The row key of the entity. - * @param timeout The timeout parameter is expressed in seconds. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when analytics logging is enabled. + * @param rowKey The row key of the entity. + * @param timeout The timeout parameter is expressed in seconds. + * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the + * analytics logs when analytics logging is enabled. * @param queryOptions Parameter group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws TableServiceErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @param context The context to associate with this operation. * @return the properties for the table entity query response. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws TableServiceErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono queryEntitiesWithPartitionAndRowKeyWithResponseAsync( - String table, - String partitionKey, - String rowKey, - Integer timeout, - String requestId, - QueryOptions queryOptions, - Context context) { + String table, + String partitionKey, + String rowKey, + Integer timeout, + String requestId, + QueryOptions queryOptions, + Context context) { final String dataServiceVersion = "3.0"; OdataMetadataFormat formatInternal = null; if (queryOptions != null) { @@ -443,52 +419,53 @@ public Mono queryEntitiesWith } String filter = filterInternal; return service.queryEntitiesWithPartitionAndRowKey( - this.client.getUrl(), - timeout, - this.client.getVersion(), - requestId, - dataServiceVersion, - format, - select, - filter, - table, - partitionKey, - rowKey, - context); + this.client.getUrl(), + timeout, + this.client.getVersion(), + requestId, + dataServiceVersion, + format, + select, + filter, + table, + partitionKey, + rowKey, + context); } /** * Update entity in a table. * - * @param table The name of the table. - * @param partitionKey The partition key of the entity. - * @param rowKey The row key of the entity. - * @param timeout The timeout parameter is expressed in seconds. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when analytics logging is enabled. - * @param ifMatch Match condition for an entity to be updated. If specified and a matching entity is not found, an - * error will be raised. To force an unconditional update, set to the wildcard character (*). If not specified, - * an insert will be performed when no existing entity is found to update and a replace will be performed if an - * existing entity is found. + * @param table The name of the table. + * @param partitionKey The partition key of the entity. + * @param rowKey The row key of the entity. + * @param timeout The timeout parameter is expressed in seconds. + * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is + * recorded in the analytics logs when analytics logging is enabled. + * @param ifMatch Match condition for an entity to be updated. If specified and a matching entity + * is not found, an error will be raised. To force an unconditional update, set to the + * wildcard character (*). If not specified, an insert will be performed when no + * existing entity is found to update and a replace will be performed if an + * existing entity is found. * @param tableEntityProperties The other properties of the table entity. - * @param queryOptions Parameter group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws TableServiceErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @param queryOptions Parameter group. + * @param context The context to associate with this operation. * @return the completion. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws TableServiceErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono updateEntityWithResponseAsync( - String table, - String partitionKey, - String rowKey, - Integer timeout, - String requestId, - String ifMatch, - Map tableEntityProperties, - QueryOptions queryOptions, - Context context) { + String table, + String partitionKey, + String rowKey, + Integer timeout, + String requestId, + String ifMatch, + Map tableEntityProperties, + QueryOptions queryOptions, + Context context) { final String dataServiceVersion = "3.0"; OdataMetadataFormat formatInternal = null; if (queryOptions != null) { @@ -496,52 +473,53 @@ public Mono updateEntityWithResponseAsync( } OdataMetadataFormat format = formatInternal; return service.updateEntity( - this.client.getUrl(), - timeout, - this.client.getVersion(), - requestId, - dataServiceVersion, - format, - table, - partitionKey, - rowKey, - ifMatch, - tableEntityProperties, - context); + this.client.getUrl(), + timeout, + this.client.getVersion(), + requestId, + dataServiceVersion, + format, + table, + partitionKey, + rowKey, + ifMatch, + tableEntityProperties, + context); } /** * Merge entity in a table. * - * @param table The name of the table. - * @param partitionKey The partition key of the entity. - * @param rowKey The row key of the entity. - * @param timeout The timeout parameter is expressed in seconds. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when analytics logging is enabled. - * @param ifMatch Match condition for an entity to be updated. If specified and a matching entity is not found, an - * error will be raised. To force an unconditional update, set to the wildcard character (*). If not specified, - * an insert will be performed when no existing entity is found to update and a merge will be performed if an - * existing entity is found. + * @param table The name of the table. + * @param partitionKey The partition key of the entity. + * @param rowKey The row key of the entity. + * @param timeout The timeout parameter is expressed in seconds. + * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is + * recorded in the analytics logs when analytics logging is enabled. + * @param ifMatch Match condition for an entity to be updated. If specified and a matching entity is + * not found, an error will be raised. To force an unconditional update, set to the + * wildcard character (*). If not specified, an insert will be performed when no + * existing entity is found to update and a merge will be performed if an + * existing entity is found. * @param tableEntityProperties The other properties of the table entity. - * @param queryOptions Parameter group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws TableServiceErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @param queryOptions Parameter group. + * @param context The context to associate with this operation. * @return the completion. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws TableServiceErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono mergeEntityWithResponseAsync( - String table, - String partitionKey, - String rowKey, - Integer timeout, - String requestId, - String ifMatch, - Map tableEntityProperties, - QueryOptions queryOptions, - Context context) { + String table, + String partitionKey, + String rowKey, + Integer timeout, + String requestId, + String ifMatch, + Map tableEntityProperties, + QueryOptions queryOptions, + Context context) { final String dataServiceVersion = "3.0"; OdataMetadataFormat formatInternal = null; if (queryOptions != null) { @@ -549,48 +527,49 @@ public Mono mergeEntityWithResponseAsync( } OdataMetadataFormat format = formatInternal; return service.mergeEntity( - this.client.getUrl(), - timeout, - this.client.getVersion(), - requestId, - dataServiceVersion, - format, - table, - partitionKey, - rowKey, - ifMatch, - tableEntityProperties, - context); + this.client.getUrl(), + timeout, + this.client.getVersion(), + requestId, + dataServiceVersion, + format, + table, + partitionKey, + rowKey, + ifMatch, + tableEntityProperties, + context); } /** * Deletes the specified entity in a table. * - * @param table The name of the table. + * @param table The name of the table. * @param partitionKey The partition key of the entity. - * @param rowKey The row key of the entity. - * @param ifMatch Match condition for an entity to be deleted. If specified and a matching entity is not found, an - * error will be raised. To force an unconditional delete, set to the wildcard character (*). - * @param timeout The timeout parameter is expressed in seconds. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when analytics logging is enabled. + * @param rowKey The row key of the entity. + * @param ifMatch Match condition for an entity to be deleted. If specified and a matching entity is not + * found, an error will be raised. To force an unconditional delete, set to the wildcard + * character (*). + * @param timeout The timeout parameter is expressed in seconds. + * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the + * analytics logs when analytics logging is enabled. * @param queryOptions Parameter group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws TableServiceErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @param context The context to associate with this operation. * @return the completion. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws TableServiceErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono deleteEntityWithResponseAsync( - String table, - String partitionKey, - String rowKey, - String ifMatch, - Integer timeout, - String requestId, - QueryOptions queryOptions, - Context context) { + String table, + String partitionKey, + String rowKey, + String ifMatch, + Integer timeout, + String requestId, + QueryOptions queryOptions, + Context context) { final String dataServiceVersion = "3.0"; OdataMetadataFormat formatInternal = null; if (queryOptions != null) { @@ -598,45 +577,45 @@ public Mono deleteEntityWithResponseAsync( } OdataMetadataFormat format = formatInternal; return service.deleteEntity( - this.client.getUrl(), - timeout, - this.client.getVersion(), - requestId, - dataServiceVersion, - format, - table, - partitionKey, - rowKey, - ifMatch, - context); + this.client.getUrl(), + timeout, + this.client.getVersion(), + requestId, + dataServiceVersion, + format, + table, + partitionKey, + rowKey, + ifMatch, + context); } /** * Insert entity in a table. * - * @param table The name of the table. - * @param timeout The timeout parameter is expressed in seconds. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when analytics logging is enabled. - * @param responsePreference Specifies whether the response should include the inserted entity in the payload. - * Possible values are return-no-content and return-content. + * @param table The name of the table. + * @param timeout The timeout parameter is expressed in seconds. + * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is + * recorded in the analytics logs when analytics logging is enabled. + * @param responsePreference Specifies whether the response should include the inserted entity in the payload. + * Possible values are return-no-content and return-content. * @param tableEntityProperties The other properties of the table entity. - * @param queryOptions Parameter group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws TableServiceErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @param queryOptions Parameter group. + * @param context The context to associate with this operation. * @return the other properties of the table entity. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws TableServiceErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono insertEntityWithResponseAsync( - String table, - Integer timeout, - String requestId, - ResponseFormat responsePreference, - Map tableEntityProperties, - QueryOptions queryOptions, - Context context) { + String table, + Integer timeout, + String requestId, + ResponseFormat responsePreference, + Map tableEntityProperties, + QueryOptions queryOptions, + Context context) { final String dataServiceVersion = "3.0"; OdataMetadataFormat formatInternal = null; if (queryOptions != null) { @@ -644,59 +623,59 @@ public Mono insertEntityWithResponseAsync( } OdataMetadataFormat format = formatInternal; return service.insertEntity( - this.client.getUrl(), - timeout, - this.client.getVersion(), - requestId, - dataServiceVersion, - format, - table, - responsePreference, - tableEntityProperties, - context); + this.client.getUrl(), + timeout, + this.client.getVersion(), + requestId, + dataServiceVersion, + format, + table, + responsePreference, + tableEntityProperties, + context); } /** * Retrieves details about any stored access policies specified on the table that may be used with Shared Access * Signatures. * - * @param table The name of the table. - * @param timeout The timeout parameter is expressed in seconds. + * @param table The name of the table. + * @param timeout The timeout parameter is expressed in seconds. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws TableServiceErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * analytics logs when analytics logging is enabled. + * @param context The context to associate with this operation. * @return a collection of signed identifiers. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws TableServiceErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getAccessPolicyWithResponseAsync( - String table, Integer timeout, String requestId, Context context) { + String table, Integer timeout, String requestId, Context context) { final String comp = "acl"; return service.getAccessPolicy( - this.client.getUrl(), timeout, this.client.getVersion(), requestId, table, comp, context); + this.client.getUrl(), timeout, this.client.getVersion(), requestId, table, comp, context); } /** * Sets stored access policies for the table that may be used with Shared Access Signatures. * - * @param table The name of the table. - * @param timeout The timeout parameter is expressed in seconds. + * @param table The name of the table. + * @param timeout The timeout parameter is expressed in seconds. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when analytics logging is enabled. - * @param tableAcl A collection of signed identifiers. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws TableServiceErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * analytics logs when analytics logging is enabled. + * @param tableAcl A collection of signed identifiers. + * @param context The context to associate with this operation. * @return the completion. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws TableServiceErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono setAccessPolicyWithResponseAsync( - String table, Integer timeout, String requestId, List tableAcl, Context context) { + String table, Integer timeout, String requestId, List tableAcl, Context context) { final String comp = "acl"; return service.setAccessPolicy( - this.client.getUrl(), timeout, this.client.getVersion(), requestId, table, comp, tableAcl, context); + this.client.getUrl(), timeout, this.client.getVersion(), requestId, table, comp, tableAcl, context); } } diff --git a/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java b/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java new file mode 100644 index 000000000000..7d2227ed57de --- /dev/null +++ b/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java @@ -0,0 +1,477 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.data.tables; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.*; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.data.tables.implementation.AzureTableImpl; +import com.azure.data.tables.implementation.AzureTableImplBuilder; +import com.azure.data.tables.implementation.models.*; +import com.azure.storage.common.implementation.connectionstring.StorageAuthenticationSettings; +import com.azure.storage.common.implementation.connectionstring.StorageConnectionString; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; +import reactor.test.StepVerifier; +import com.azure.core.test.TestBase; +import java.util.*; + +/** + * This class tests the Autorest code for the Tables track 2 SDK + */ +public class AzureTableImplTest extends TestBase { + private static final String PARTITION_KEY = "PartitionKey"; + private static final String ROW_KEY = "RowKey"; + private AzureTableImpl azureTable; + + + static AzureTableImpl auth() { + + final String connectionString = System.getenv("azure_tables_connection_string"); + StorageConnectionString storageConnectionString + = StorageConnectionString.create(connectionString, new ClientLogger(AzureTableImplTest.class)); + + StorageAuthenticationSettings authSettings = storageConnectionString.getStorageAuthSettings(); + TablesSharedKeyCredential sharedKeyCredential = new TablesSharedKeyCredential(authSettings.getAccount().getName(), + authSettings.getAccount().getAccessKey()); + + final List policies = Arrays.asList( + new AddDatePolicy(), + new AddHeadersPolicy(new HttpHeaders().put("Accept", OdataMetadataFormat.APPLICATION_JSON_ODATA_MINIMALMETADATA.toString())), + new TablesSharedKeyCredentialPolicy(sharedKeyCredential), + new HttpLoggingPolicy(new HttpLogOptions() + .setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS)) + ); + final HttpPipeline pipeline = new HttpPipelineBuilder() + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + AzureTableImpl azureTable = new AzureTableImplBuilder() + .pipeline(pipeline) + .version("2019-02-02") + .url(storageConnectionString.getTableEndpoint().getPrimaryUri()) + .buildClient(); + return azureTable; + } + + @Override + protected void beforeTest() { + super.beforeTest(); + } + + @BeforeEach + void before() { + azureTable = auth(); + } + + @AfterEach + void after() { + QueryOptions queryOptions = new QueryOptions() + .setFormat(OdataMetadataFormat.APPLICATION_JSON_ODATA_MINIMALMETADATA); + + Mono.when(azureTable.getTables().queryWithResponseAsync(UUID.randomUUID().toString(), null, + queryOptions, Context.NONE).flatMapMany(tablesQueryResponse -> { + return Flux.fromIterable(tablesQueryResponse.getValue().getValue()).flatMap(tableResponseProperty -> { + return azureTable.getTables().deleteWithResponseAsync(tableResponseProperty.getTableName(), + testResourceNamer.randomUuid(), Context.NONE); + }); + })).block(); + } + + void createTable(String tableName) { + TableProperties tableProperties = new TableProperties().setTableName(tableName); + + azureTable.getTables().createWithResponseAsync(tableProperties, testResourceNamer.randomUuid(), + ResponseFormat.RETURN_CONTENT, null, Context.NONE).block(); + + + } + + void insertNoEtag(String tableName, Map properties) { + azureTable.getTables().insertEntityWithResponseAsync(tableName, 500, + UUID.randomUUID().toString(), ResponseFormat.RETURN_CONTENT, properties, null, Context.NONE).log().block(); + } + + String randomCharOnlyName(String prefix, int length) { + Random rnd = new Random(); + String result = prefix; + while (result.length() < length) { + char c = (char) (rnd.nextInt(26) + 'a'); + result += c; + } + return result; + } + + @Test + void createTable() { + // Arrange + String tableName = randomCharOnlyName("test", 10); + TableProperties tableProperties = new TableProperties().setTableName(tableName); + int expectedStatusCode = 201; + String requestId = testResourceNamer.randomUuid(); + + // Act & Assert + StepVerifier.create(azureTable.getTables().createWithResponseAsync(tableProperties, + requestId, ResponseFormat.RETURN_CONTENT, null, Context.NONE)) + .assertNext(response -> { + Assertions.assertEquals(expectedStatusCode, response.getStatusCode()); + }) + .expectComplete() + .verify(); + } + + @Test + void createTableDuplicateName() { + // Arrange + String tableName = randomCharOnlyName("test", 10); + TableProperties tableProperties = new TableProperties().setTableName(tableName); + createTable(tableName); + String requestId = testResourceNamer.randomUuid(); + + // Act & Assert + StepVerifier.create(azureTable.getTables().createWithResponseAsync(tableProperties, + requestId, ResponseFormat.RETURN_CONTENT, null, Context.NONE)) + .expectError(com.azure.data.tables.implementation.models.TableServiceErrorException.class) + .verify(); + } + + @Test + void deleteTable() { + // Arrange + String tableName = randomCharOnlyName("test", 10); + createTable(tableName); + int expectedStatusCode = 204; + String requestId = testResourceNamer.randomUuid(); + + // Act & Assert + StepVerifier.create(azureTable.getTables().deleteWithResponseAsync(tableName, requestId, + Context.NONE)) + .assertNext(response -> { + Assertions.assertEquals(expectedStatusCode, response.getStatusCode()); + }) + .expectComplete() + .verify(); + } + + @Test + void deleteNonExistentTable() { + // Arrange + String tableName = randomCharOnlyName("test", 10); + String requestId = testResourceNamer.randomUuid(); + + // Act & Assert + StepVerifier.create(azureTable.getTables().deleteWithResponseAsync(tableName, requestId, + Context.NONE)) + .expectError(com.azure.data.tables.implementation.models.TableServiceErrorException.class) + .verify(); + } + + + @Test + void queryTable() { + // Arrange + QueryOptions queryOptions = new QueryOptions() + .setFormat(OdataMetadataFormat.APPLICATION_JSON_ODATA_MINIMALMETADATA); + String tableA = randomCharOnlyName("AtestA", 10); + String tableB = randomCharOnlyName("BtestB", 10); + createTable(tableA); + createTable(tableB); + int expectedStatusCode = 200; + String requestId = testResourceNamer.randomUuid(); + + // Act & Assert + StepVerifier.create(azureTable.getTables().queryWithResponseAsync(requestId, null, + queryOptions, Context.NONE)) + .assertNext(response -> { + Assertions.assertEquals(expectedStatusCode, response.getStatusCode()); + Assertions.assertEquals(response.getValue().getValue().get(0).getTableName(), tableA); + Assertions.assertEquals(response.getValue().getValue().get(1).getTableName(), tableB); + }) + .expectComplete() + .verify(); + } + + @Test + void insertNoEtag() { + // Arrange + String tableName = randomCharOnlyName("test", 10); + createTable(tableName); + Map properties = new HashMap<>(); + String pkName = randomCharOnlyName("pk", 10); + String rkName = randomCharOnlyName("rk", 10); + properties.put(PARTITION_KEY, pkName); + properties.put(ROW_KEY, rkName); + int expectedStatusCode = 201; + String requestId = testResourceNamer.randomUuid(); + + // Act & Assert + StepVerifier.create(azureTable.getTables().insertEntityWithResponseAsync(tableName, 500, + requestId, ResponseFormat.RETURN_CONTENT, properties, null, Context.NONE)) + .assertNext(response -> { + Assertions.assertEquals(expectedStatusCode, response.getStatusCode()); + }) + .expectComplete() + .verify(); + } + + @Test + void mergeEntity() { + // Arrange + String tableName = randomCharOnlyName("test", 10); + createTable(tableName); + Map properties = new HashMap<>(); + String pkName = randomCharOnlyName("pk", 10); + String rkName = randomCharOnlyName("rk", 10); + properties.put(PARTITION_KEY, pkName); + properties.put(ROW_KEY, rkName); + int expectedStatusCode = 204; + String requestId = testResourceNamer.randomUuid(); + insertNoEtag(tableName, properties); + properties.put("additionalProperty", randomCharOnlyName("ap", 10)); + + // Act & Assert + StepVerifier.create(azureTable.getTables().mergeEntityWithResponseAsync(tableName, pkName, + rkName, 500, requestId, "*", properties, null, Context.NONE)) + .assertNext(response -> { + Assertions.assertEquals(expectedStatusCode, response.getStatusCode()); + }) + .expectComplete() + .verify(); + } + + @Test + void mergeNonExistentEntity() { + // Arrange + String tableName = randomCharOnlyName("test", 10); + createTable(tableName); + Map properties = new HashMap<>(); + String pkName = randomCharOnlyName("pk", 10); + String rkName = randomCharOnlyName("rk", 10); + String requestId = testResourceNamer.randomUuid(); + + // Act & Assert + StepVerifier.create(azureTable.getTables().mergeEntityWithResponseAsync(tableName, pkName, + rkName, 500, requestId, "*", properties, null, Context.NONE)) + .expectError(com.azure.data.tables.implementation.models.TableServiceErrorException.class) + .verify(); + } + + @Test + void updateEntity() { + // Arrange + String tableName = randomCharOnlyName("test", 10); + createTable(tableName); + Map properties = new HashMap<>(); + String pkName = randomCharOnlyName("pk", 10); + String rkName = randomCharOnlyName("rk", 10); + properties.put(PARTITION_KEY, pkName); + properties.put(ROW_KEY, rkName); + int expectedStatusCode = 204; + String requestId = testResourceNamer.randomUuid(); + insertNoEtag(tableName, properties); + properties.put("additionalProperty", randomCharOnlyName("ap", 10)); + + // Act & Assert + StepVerifier.create(azureTable.getTables().updateEntityWithResponseAsync(tableName, pkName, + rkName, 500, requestId, "*", properties, null, Context.NONE)) + .assertNext(response -> { + Assertions.assertEquals(expectedStatusCode, response.getStatusCode()); + }) + .expectComplete() + .verify(); + } + + @Test + void updateNonExistentEntity() { + // Arrange + String tableName = randomCharOnlyName("test", 10); + createTable(tableName); + Map properties = new HashMap<>(); + String pkName = randomCharOnlyName("pk", 10); + String rkName = randomCharOnlyName("rk", 10); + String requestId = testResourceNamer.randomUuid(); + + // Act & Assert + StepVerifier.create(azureTable.getTables().updateEntityWithResponseAsync(tableName, pkName, + rkName, 500, requestId, "*", properties, null, Context.NONE)) + .expectError(com.azure.data.tables.implementation.models.TableServiceErrorException.class) + .verify(); + } + + @Test + void deleteEntity() { + // Arrange + String tableName = randomCharOnlyName("test", 10); + createTable(tableName); + Map properties = new HashMap<>(); + String pkName = randomCharOnlyName("pk", 10); + String rkName = randomCharOnlyName("rk", 10); + properties.put(PARTITION_KEY, pkName); + properties.put(ROW_KEY, rkName); + int expectedStatusCode = 204; + String requestId = testResourceNamer.randomUuid(); + insertNoEtag(tableName, properties); + + // Act & Assert + StepVerifier.create(azureTable.getTables().deleteEntityWithResponseAsync(tableName, pkName, + rkName, "*", 500, requestId, null, Context.NONE)) + .assertNext(response -> { + Assertions.assertEquals(expectedStatusCode, response.getStatusCode()); + }) + .expectComplete() + .verify(); + } + + @Test + void deleteNonExistentEntity() { + // Arrange + String tableName = randomCharOnlyName("test", 10); + createTable(tableName); + String pkName = randomCharOnlyName("pk", 10); + String rkName = randomCharOnlyName("rk", 10); + String requestId = testResourceNamer.randomUuid(); + + // Act & Assert + StepVerifier.create(azureTable.getTables().deleteEntityWithResponseAsync(tableName, pkName, + rkName, "*", 500, requestId, null, Context.NONE)) + .expectError(com.azure.data.tables.implementation.models.TableServiceErrorException.class) + .verify(); + } + + @Test + void queryEntity() { + // Arrange + String requestId = testResourceNamer.randomUuid(); + QueryOptions queryOptions = new QueryOptions().setFormat(OdataMetadataFormat.APPLICATION_JSON_ODATA_FULLMETADATA); + String tableName = randomCharOnlyName("test", 10); + createTable(tableName); + Map propertiesA = new HashMap<>(); + String pkNameA = randomCharOnlyName("pkA", 10); + String rkNameA = randomCharOnlyName("rkA", 10); + propertiesA.put(PARTITION_KEY, pkNameA); + propertiesA.put(ROW_KEY, rkNameA); + insertNoEtag(tableName, propertiesA); + Map propertiesB = new HashMap<>(); + String pkNameB = randomCharOnlyName("pkB", 10); + String rkNameB = randomCharOnlyName("rkB", 10); + propertiesB.put(PARTITION_KEY, pkNameB); + propertiesB.put(ROW_KEY, rkNameB); + insertNoEtag(tableName, propertiesB); + int expectedStatusCode = 200; + + // Act & Assert + StepVerifier.create(azureTable.getTables().queryEntitiesWithResponseAsync(tableName, null, + requestId, null, null, queryOptions, Context.NONE)) + .assertNext(response -> { + Assertions.assertEquals(expectedStatusCode, response.getStatusCode()); + Assertions.assertEquals(true, response.getValue().getValue().get(0).containsValue(pkNameA)); + Assertions.assertEquals(true, response.getValue().getValue().get(1).containsValue(pkNameB)); + + }) + .expectComplete() + .verify(); + } + + @Test + void queryEntityWithSelect() { + // Arrange + String ap = "additionalProperty"; + String requestId = testResourceNamer.randomUuid(); + QueryOptions queryOptions = new QueryOptions().setFormat(OdataMetadataFormat.APPLICATION_JSON_ODATA_FULLMETADATA); + String tableName = randomCharOnlyName("test", 10); + createTable(tableName); + Map propertiesA = new HashMap<>(); + String apNameA = randomCharOnlyName("apA", 10); + propertiesA.put(PARTITION_KEY, randomCharOnlyName("pkA", 10)); + propertiesA.put(ROW_KEY, randomCharOnlyName("rkA", 10)); + propertiesA.put(ap, apNameA); + insertNoEtag(tableName, propertiesA); + Map propertiesB = new HashMap<>(); + String apNameB = randomCharOnlyName("apA", 10); + propertiesB.put(PARTITION_KEY, randomCharOnlyName("pkB", 10)); + propertiesB.put(ROW_KEY, randomCharOnlyName("rkB", 10)); + propertiesB.put(ap, apNameB); + insertNoEtag(tableName, propertiesB); + int expectedStatusCode = 200; + queryOptions.setSelect(ap); + + // Act & Assert + StepVerifier.create(azureTable.getTables().queryEntitiesWithResponseAsync(tableName, null, + requestId, null, null, queryOptions, Context.NONE)) + .assertNext(response -> { + Assertions.assertEquals(expectedStatusCode, response.getStatusCode()); + Assertions.assertEquals(true, response.getValue().getValue().get(0).containsValue(apNameA)); + Assertions.assertEquals(true, response.getValue().getValue().get(1).containsValue(apNameB)); + + }) + .expectComplete() + .verify(); + } + + @Test + void queryEntityWithFilter() { + // Arrange + String ap = "additionalProperty"; + String requestId = testResourceNamer.randomUuid(); + QueryOptions queryOptions = new QueryOptions().setFormat(OdataMetadataFormat.APPLICATION_JSON_ODATA_FULLMETADATA); + String tableName = randomCharOnlyName("test", 10); + createTable(tableName); + Map propertiesA = new HashMap<>(); + String apNameA = randomCharOnlyName("apA", 10); + propertiesA.put(PARTITION_KEY, randomCharOnlyName("pkA", 10)); + propertiesA.put(ROW_KEY, randomCharOnlyName("rkA", 10)); + propertiesA.put(ap, apNameA); + insertNoEtag(tableName, propertiesA); + Map propertiesB = new HashMap<>(); + String apNameB = randomCharOnlyName("apA", 10); + propertiesB.put(PARTITION_KEY, randomCharOnlyName("pkB", 10)); + propertiesB.put(ROW_KEY, randomCharOnlyName("rkB", 10)); + propertiesB.put(ap, apNameB); + insertNoEtag(tableName, propertiesB); + int expectedStatusCode = 200; + queryOptions.setFilter(ap + " eq " + apNameA); + + // Act & Assert + StepVerifier.create(azureTable.getTables().queryEntitiesWithResponseAsync(tableName, null, + requestId, null, null, queryOptions, Context.NONE)) + .assertNext(response -> { + Assertions.assertEquals(expectedStatusCode, response.getStatusCode()); + Assertions.assertEquals(true, response.getValue().getValue().get(0).containsValue(apNameA)); + // Assertions.assertEquals(false, response.getValue().getValue().get(1).containsValue(apNameB)); + + }) + .expectComplete() + .verify(); + } + + @Test + void queryEntitiesWithPartitionAndRowKey() { + // Arrange + QueryOptions queryOptions = new QueryOptions().setFormat(OdataMetadataFormat.APPLICATION_JSON_ODATA_FULLMETADATA); + String tableName = randomCharOnlyName("test", 10); + createTable(tableName); + Map properties = new HashMap<>(); + String pkName = randomCharOnlyName("pk", 10); + String rkName = randomCharOnlyName("rk", 10); + properties.put(PARTITION_KEY, pkName); + properties.put(ROW_KEY, rkName); + insertNoEtag(tableName, properties); + + // Act & Assert + StepVerifier.create(azureTable.getTables().queryEntitiesWithPartitionAndRowKeyWithResponseAsync(tableName, pkName, + rkName, 1000, UUID.randomUUID().toString(), queryOptions, Context.NONE)) + .assertNext(response -> { + Assertions.assertEquals(200, response.getStatusCode()); + }) + .expectComplete() + .verify(); + } + +} diff --git a/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTablesAsyncClientTest.java b/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTablesAsyncClientTest.java deleted file mode 100644 index 4ef145357b88..000000000000 --- a/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTablesAsyncClientTest.java +++ /dev/null @@ -1,134 +0,0 @@ -//package com.azure.data.tables; -// -//import org.junit.jupiter.api.Test; -//import reactor.core.publisher.Mono; -// -//import java.time.Duration; -//import java.util.concurrent.TimeUnit; -// -//public class AzureTablesAsyncClientTest { -// @Test -// void createTableTest() { -// // Ideally, we'd use a builder to create this rather than a constructor. -// AzureTableAsyncClient client = new AzureTableAsyncClient(); -// -// // Every time this variable is used in a downstream subscriber, it will invoke the `createTable` operation. -// Mono createTableMono = client.createTable("my-table"); -// -// // This is a subscription to the Mono. `subscribe` is a non-blocking call. -// createTableMono.subscribe(table -> { -// System.out.println("Table created is: " + table.getName()); -// }, error -> { -// System.err.println("There was an error creating the table. " + error); -// }); -// -// // Since .subscribe is a non-blocking call, after it hooks up the asynchronous operation, it will move -// // onto the next statement. If `client.createTable` takes 30 seconds, the program would have ended before we -// // ever know the response because it will leave this method. -// // You'll see that there is no "System.out.println" console output because the program has ended. -// } -// -// /** -// * Notice how "CREATING TABLE with name: my-table" errors when we try to add another entrythe second time? This is -// * because, every time we chain the `createTableMono`, it invokes that `createTable` operation again. -// * After an error occurs in one of the operations upstream in the chain, it will call the (error) -> { } handler. -// * You'll see that we didn't try to add another entity (ie. new-key-2). -// * -// * See {@link #createAndUpdateTableFixed()} for a resolved version. -// */ -// @Test -// void createAndUpdateTable() throws InterruptedException { -// AzureTableAsyncClient client = new AzureTableAsyncClient(); -// -// // Every time this variable is used in a downstream subscriber, it will invoke the `createTable` operation. -// Mono createTableMono = client.createTable("my-table"); -// -// // FirstMono -> SecondFlatMap -> Map -> Subscribe -// createTableMono.flatMap(azureTable -> { -// // We are chaining another operation to this table creation. We want to use the resulting table and -// // create an entity in it. We use `flatMap` because it is asynchronous (ie. returns Mono or Flux). -// Mono entity = azureTable.createEntity("my-key", "my-value"); -// // We return the `createEntity` operation. -// return entity; -// }).map(azureTableEntity -> { -// // This is a transformation, maybe we only care about the value of that entity we added. -// return azureTableEntity.getValue(); -// }).subscribe(theValue -> { -// System.out.println("This was added: " + theValue); -// }, error -> { -// System.err.println("Error: " + error); -// }); -// -// createTableMono.flatMap(azureTable -> { -// // We are chaining another operation to this table creation. We want to use the resulting table and -// // create an entity in it. We use `flatMap` because it is asynchronous (ie. returns Mono or Flux). -// return azureTable.createEntity("my-key-2", "my-value-2"); -// }).map(azureTableEntity -> { -// // This is a transformation, maybe we only care about the value of that entity we added. -// return azureTableEntity.getValue(); -// }).subscribe(theValue -> { -// System.out.println("This was added: " + theValue); -// }, error -> { -// System.err.println("Error: " + error); -// }); -// -// TimeUnit.SECONDS.sleep(20); -// } -// -// /** -// * We've fixed this by caching the result of the `createTable` operation if it is successful. So we don't try to -// * create the table again. -// * -// * See {@link #createAndUpdateTable()} -// */ -// @Test -// void createAndUpdateTableFixed() throws InterruptedException { -// AzureTableAsyncClient client = new AzureTableAsyncClient(); -// -// // Every time this variable is used in a downstream subscriber, it will invoke the `createTable` operation. -// Mono createTableMono = client.createTable("my-table") -// .cache(success -> { -// System.out.println("--- Table added. Caching value."); -// return Duration.ofSeconds(Long.MAX_VALUE); -// }, error -> { -// System.out.println("--- Error while adding table. Not caching value."); -// return Duration.ZERO; -// }, () -> { -// // This can occur because Monos can output 0 or 1 items. This would be the case where it output 0 items. -// // For example, Mono.empty() will complete, but not output any items. -// System.out.println("--- Expected a table to be output, not an empty value. Not caching."); -// return Duration.ZERO; -// }); -// -// // FirstMono -> SecondFlatMap -> Map -> Subscribe -// createTableMono.flatMap(azureTable -> { -// // We are chaining another operation to this table creation. We want to use the resulting table and -// // create an entity in it. We use `flatMap` because it is asynchronous (ie. returns Mono or Flux). -// Mono entity = azureTable.createEntity("my-new-key", "my-new-value"); -// // We return the `createEntity` operation. -// return entity; -// }).map(azureTableEntity -> { -// // This is a transformation, maybe we only care about the value of that entity we added. -// return azureTableEntity.getValue(); -// }).subscribe(theValue -> { -// System.out.println("This was added: " + theValue); -// }, error -> { -// System.err.println("ERROR: " + error); -// }); -// -// createTableMono.flatMap(azureTable -> { -// // We are chaining another operation to this table creation. We want to use the resulting table and -// // create an entity in it. We use `flatMap` because it is asynchronous (ie. returns Mono or Flux). -// return azureTable.createEntity("my-new-key-2", "my-new-value-2"); -// }).map(azureTableEntity -> { -// // This is a transformation, maybe we only care about the value of that entity we added. -// return azureTableEntity.getValue(); -// }).subscribe(theValue -> { -// System.out.println("This was added: " + theValue); -// }, error -> { -// System.err.println("ERROR: " + error); -// }); -// -// TimeUnit.SECONDS.sleep(20); -// } -//} diff --git a/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/autorestTest.java b/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/autorestTest.java deleted file mode 100644 index 8072c6d72d5c..000000000000 --- a/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/autorestTest.java +++ /dev/null @@ -1,364 +0,0 @@ -package com.azure.data.tables; - -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.policy.*; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.data.tables.implementation.AzureTableImpl; -import com.azure.data.tables.implementation.AzureTableImplBuilder; -import com.azure.data.tables.implementation.TablesImpl; -import com.azure.data.tables.implementation.models.OdataMetadataFormat; -import com.azure.data.tables.implementation.models.QueryOptions; -import com.azure.data.tables.implementation.models.ResponseFormat; -import com.azure.data.tables.implementation.models.TableProperties; -import com.azure.storage.common.StorageSharedKeyCredential; -import com.azure.storage.common.implementation.connectionstring.StorageAuthenticationSettings; -import com.azure.storage.common.implementation.connectionstring.StorageConnectionString; -import com.azure.storage.common.policy.StorageSharedKeyCredentialPolicy; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import reactor.test.StepVerifier; - -import java.util.*; -import java.util.concurrent.TimeUnit; - -public class autorestTest { - final String tableA = "tableA"; - final String tableB = "tableB"; - final String tableZ = "tableZ"; - final AzureTableImpl azureTable = auth(); - final String pk = "PartitionKey"; - final String rk = "RowKey"; - Map propertiesB = new HashMap<>(); - - - void createAndUpdateTableFixed() { - final String connectionString = System.getenv("azure_tables_connection_string"); - final List policies = new ArrayList<>(); - - StorageConnectionString storageConnectionString - = StorageConnectionString.create(connectionString, new ClientLogger("tables")); - - StorageAuthenticationSettings authSettings = storageConnectionString.getStorageAuthSettings(); - StorageSharedKeyCredential sharedKeyCredential = new StorageSharedKeyCredential(authSettings.getAccount().getName(), - authSettings.getAccount().getAccessKey()); - - //storagesharedkey object and the storage auth object - policies.add(new AddDatePolicy()); - policies.add(new StorageSharedKeyCredentialPolicy(sharedKeyCredential)); - //HttpLoggingPolicy() - - final HttpPipeline pipeline = new HttpPipelineBuilder() - .httpClient(null) - .policies(policies.toArray(new HttpPipelinePolicy[0])) - .build(); - - AzureTableImplBuilder azureTableImplBuilder = new AzureTableImplBuilder(); - AzureTableImpl azureTable = azureTableImplBuilder - .pipeline(pipeline) - .url("/https://telboytrial.table.core.windows.net") - .buildClient(); - - try { - TablesImpl tables = azureTable.getTables(); - - StepVerifier.create(tables.deleteWithResponseAsync("ebTable", "ID23", Context.NONE)) - .assertNext(response -> { - System.out.println(response); - Assertions.assertEquals(200, response.getStatusCode()); - }) - .expectComplete() - .verify(); - } catch (Exception e) { - System.out.print(e); - } - - } - - - static AzureTableImpl auth() { - final String connectionString = System.getenv("azure_tables_connection_string"); - - StorageConnectionString storageConnectionString - = StorageConnectionString.create(connectionString, new ClientLogger("tables")); - - StorageAuthenticationSettings authSettings = storageConnectionString.getStorageAuthSettings(); - TablesSharedKeyCredential sharedKeyCredential = new TablesSharedKeyCredential(authSettings.getAccount().getName(), - authSettings.getAccount().getAccessKey()); - - final List policies = Arrays.asList( - new AddDatePolicy(), - new AddHeadersPolicy(new HttpHeaders().put("Accept", OdataMetadataFormat.APPLICATION_JSON_ODATA_MINIMALMETADATA.toString())), - new TablesSharedKeyCredentialPolicy(sharedKeyCredential), - new HttpLoggingPolicy(new HttpLogOptions() - .setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS)) - ); - final HttpPipeline pipeline = new HttpPipelineBuilder() - .policies(policies.toArray(new HttpPipelinePolicy[0])) - .build(); - AzureTableImpl azureTable = new AzureTableImplBuilder() - .pipeline(pipeline) - .version("2019-02-02") - .url("https://telboytrial.table.core.windows.net") - .buildClient(); - return azureTable; - } - - - @BeforeEach - void beforeTests() { - createTableHelper(tableA); - createTableHelper(tableB); - - propertiesB.put("PartitionKey", "Store"); - propertiesB.put("RowKey", "Boston"); - propertiesB.put("Employees", "200"); - insertEntityHelper(tableA, propertiesB); - - Map propertiesA = new HashMap<>(); - propertiesA.put("PartitionKey", "Store"); - propertiesA.put("RowKey", "Atlanta"); - propertiesA.put("Employees", "50"); - insertEntityHelper(tableA, propertiesA); - - - } - - @AfterEach - void afterTests() throws InterruptedException { - deleteTableHelper(tableA); - deleteTableHelper(tableB); - - } - - void createTableHelper(String tableName) { - AzureTableImpl azureTable = auth(); - - TableProperties tableProperties = new TableProperties().setTableName(tableName); - String requestId = UUID.randomUUID().toString(); - - azureTable.getTables().createWithResponseAsync(tableProperties, requestId, - ResponseFormat.RETURN_CONTENT, null, Context.NONE).block(); - - } - - void deleteTableHelper(String tableName) throws InterruptedException { - - AzureTableImpl azureTable = auth(); - String requestId = UUID.randomUUID().toString(); - - - azureTable.getTables().deleteWithResponseAsync(tableName, requestId, - Context.NONE).block(); - TimeUnit.SECONDS.sleep(2); - - } - - void insertEntityHelper(String tableName, Map properties) { - String requestId = UUID.randomUUID().toString(); - - azureTable.getTables().insertEntityWithResponseAsync(tableName, 500, - requestId, ResponseFormat.RETURN_CONTENT, properties, null, Context.NONE).log().block(); - } - - @Test - void createTable() throws InterruptedException { - TableProperties tableProperties = new TableProperties().setTableName(tableZ); - String requestId = UUID.randomUUID().toString(); - - //successful path - StepVerifier.create(azureTable.getTables().createWithResponseAsync(tableProperties, requestId, - ResponseFormat.RETURN_CONTENT, null, Context.NONE)) - .assertNext(response -> { - System.out.println(response); - Assertions.assertEquals(201, response.getStatusCode()); - }) - .expectComplete() - .verify(); - - //error if it tries to create a table with the same name that already exists - StepVerifier.create(azureTable.getTables().createWithResponseAsync(tableProperties, requestId, - ResponseFormat.RETURN_CONTENT, null, Context.NONE)) - .expectError(com.azure.data.tables.implementation.models.TableServiceErrorException.class) - .verify(); - - //delete table - deleteTableHelper(tableZ); - - } - - @Test - void deleteTable() { - - //create Table - createTableHelper(tableZ); - - //delete a table, successful path - StepVerifier.create(azureTable.getTables().deleteWithResponseAsync(tableZ, UUID.randomUUID().toString(), - Context.NONE)) - .assertNext(response -> { - Assertions.assertEquals(204, response.getStatusCode()); - }) - .expectComplete() - .verify(); - - //try to delete table that is already deleted, should return a TableServiceError - StepVerifier.create(azureTable.getTables().deleteWithResponseAsync(tableZ, UUID.randomUUID().toString(), - Context.NONE)) - .expectError(com.azure.data.tables.implementation.models.TableServiceErrorException.class) - .verify(); - } - - @Test - void queryTable() { - String requestId = UUID.randomUUID().toString(); - QueryOptions queryOptions = new QueryOptions() - .setFormat(OdataMetadataFormat.APPLICATION_JSON_ODATA_MINIMALMETADATA); - - //Verify both are returned with a query without criteria - StepVerifier.create(azureTable.getTables().queryWithResponseAsync(requestId, null, - queryOptions, Context.NONE)) - .assertNext(response -> { - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertEquals(response.getValue().getValue().get(0).getTableName(), tableA); - Assertions.assertEquals(response.getValue().getValue().get(1).getTableName(), tableB); - }) - .expectComplete() - .verify(); - - queryOptions.setTop(1); - - //Verify both only first is returned with top filter - StepVerifier.create(azureTable.getTables().queryWithResponseAsync(requestId, null, - queryOptions, Context.NONE)) - .assertNext(response -> { - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertEquals(response.getValue().getValue().size(), 1); - }) - .expectComplete() - .verify(); - } - - @Test - void insertNoEtag() { - Map properties = new HashMap<>(); - properties.put(pk, "Store"); - properties.put(rk, "Seattle"); - - - AzureTableImpl azureTable = auth(); - String requestId = UUID.randomUUID().toString(); - - StepVerifier.create(azureTable.getTables().insertEntityWithResponseAsync(tableB, 500, - requestId, ResponseFormat.RETURN_CONTENT, properties, null, Context.NONE)) - .assertNext(response -> { - Assertions.assertEquals(201, response.getStatusCode()); - }) - .expectComplete() - .verify(); - - } - - @Test - void mergeEntity() { - propertiesB.put("Address", "23 Newbury Street"); - StepVerifier.create(azureTable.getTables().mergeEntityWithResponseAsync(tableA, propertiesB.get("PartitionKey").toString(), - propertiesB.get("RowKey").toString(), 500, UUID.randomUUID().toString(), "*", propertiesB, null, Context.NONE)) - .assertNext(response -> { - Assertions.assertEquals(204, response.getStatusCode()); - }) - .expectComplete() - .verify(); - - //TODO: Query and check - } - - @Test - void updateEntity() { - propertiesB.remove("Size"); - propertiesB.put("Manager", "Jessica Davis"); - - StepVerifier.create(azureTable.getTables().updateEntityWithResponseAsync(tableA, propertiesB.get("PartitionKey").toString(), - propertiesB.get("RowKey").toString(), 500, UUID.randomUUID().toString(), "*", propertiesB, null, Context.NONE)) - .assertNext(response -> { - Assertions.assertEquals(204, response.getStatusCode()); - }) - .expectComplete() - .verify(); - - //TODO: Query and check - } - - @Test - void deleteEntity() { - String requestId = UUID.randomUUID().toString(); - Map propertiesC = new HashMap<>(); - propertiesC.put(pk, "Store"); - propertiesC.put(rk, "Chicago"); - insertEntityHelper(tableB, propertiesC); - - StepVerifier.create(azureTable.getTables().deleteEntityWithResponseAsync(tableB, propertiesC.get("PartitionKey").toString(), - propertiesC.get("RowKey").toString(), "*", 500, requestId, null, Context.NONE)) - .assertNext(response -> { - System.out.println(response); - Assertions.assertEquals(204, response.getStatusCode()); - }) - .expectComplete() - .verify(); - } - - @Test - void queryEntity() throws InterruptedException { - String requestId = UUID.randomUUID().toString(); - QueryOptions queryOptions = new QueryOptions(); - - StepVerifier.create(azureTable.getTables().queryEntitiesWithResponseAsync(tableA, null, - requestId, null, null, queryOptions, Context.NONE)) - .assertNext(response -> { - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertEquals(true, response.getValue().getValue().get(0).containsValue("Atlanta")); - Assertions.assertEquals(true, response.getValue().getValue().get(1).containsValue("Boston")); - - }) - .expectComplete() - .verify(); - - queryOptions.setSelect("Employees"); - StepVerifier.create(azureTable.getTables().queryEntitiesWithResponseAsync(tableA, null, - requestId, null, null, queryOptions, Context.NONE)) - .assertNext(response -> { - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertEquals(true, response.getValue().getValue().get(0).containsValue("50")); - Assertions.assertEquals(true, response.getValue().getValue().get(1).containsValue("200")); - - }) - .expectComplete() - .verify(); - - //queryOptions.setSelect(""); - queryOptions.setFilter("RowKey eq Boston"); - StepVerifier.create(azureTable.getTables().queryEntitiesWithResponseAsync(tableA, null, - requestId, null, null, queryOptions, Context.NONE)) - .assertNext(response -> { - System.out.print("Here"); - for (Iterator> it = response.getValue().getValue().iterator(); it.hasNext(); ) { - Map m = it.next(); - System.out.println(m); - - } - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertEquals(true, response.getValue().getValue().get(0).containsValue("Boston")); - - }) - .expectComplete() - .verify(); - - TimeUnit.SECONDS.sleep(5); - } - - -} From 5086d4a027c554f6e92e70dea6826ab490eafef1 Mon Sep 17 00:00:00 2001 From: Eleanor Boyd Date: Mon, 29 Jun 2020 16:45:57 -0400 Subject: [PATCH 11/33] stashing --- .../java/com/azure/data/tables/AzureTableImplTest.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java b/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java index 7d2227ed57de..c654772e8afb 100644 --- a/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java +++ b/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java @@ -33,9 +33,10 @@ public class AzureTableImplTest extends TestBase { private AzureTableImpl azureTable; - static AzureTableImpl auth() { - - final String connectionString = System.getenv("azure_tables_connection_string"); + AzureTableImpl auth() { + String connectionString = interceptorManager.isPlaybackMode() + ? "DefaultEndpointsProtocol=https;=AccountName=dummyAccount;AccountKey=xyzDummy;EndpointSuffix=core.windows.net" + : System.getenv("azure_tables_connection_string"); StorageConnectionString storageConnectionString = StorageConnectionString.create(connectionString, new ClientLogger(AzureTableImplTest.class)); @@ -69,6 +70,7 @@ protected void beforeTest() { @BeforeEach void before() { azureTable = auth(); + } @AfterEach From 68f0cea590c956daa39b7d872c4364f3eacdb23b Mon Sep 17 00:00:00 2001 From: Eleanor Boyd Date: Tue, 30 Jun 2020 11:22:11 -0400 Subject: [PATCH 12/33] adding tests --- sdk/tables/azure-data-tables/pom.xml | 2 +- .../tables/TablesSharedKeyCredential.java | 3 +- .../azure/data/tables/AzureTableImplTest.java | 328 ++++++++++-------- .../azure-data-tables/swagger/README.md | 4 +- 4 files changed, 189 insertions(+), 148 deletions(-) diff --git a/sdk/tables/azure-data-tables/pom.xml b/sdk/tables/azure-data-tables/pom.xml index 8f18fa043f49..dff0ee5f8a90 100644 --- a/sdk/tables/azure-data-tables/pom.xml +++ b/sdk/tables/azure-data-tables/pom.xml @@ -32,7 +32,7 @@ Licensed under the MIT License. HEAD - + true diff --git a/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredential.java b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredential.java index c5287404a5a2..640f0729f8b9 100644 --- a/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredential.java +++ b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredential.java @@ -54,9 +54,10 @@ public String generateAuthorizationHeader(URL requestURL, Map he private String buildStringToSign(URL requestURL, Map headers) { String dateHeader = headers.containsKey("x-ms-date") ? "" : this.getStandardHeaderValue(headers, "Date"); - return String.join("\n", + String s = String.join("\n", dateHeader, //date this.getCanonicalizedResource(requestURL)); //Canonicalized resource + return s; } /** diff --git a/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java b/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java index c654772e8afb..55563e14bb39 100644 --- a/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java +++ b/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java @@ -3,6 +3,7 @@ package com.azure.data.tables; +import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaders; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; @@ -14,9 +15,7 @@ import com.azure.data.tables.implementation.models.*; import com.azure.storage.common.implementation.connectionstring.StorageAuthenticationSettings; import com.azure.storage.common.implementation.connectionstring.StorageConnectionString; -import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -30,13 +29,15 @@ public class AzureTableImplTest extends TestBase { private static final String PARTITION_KEY = "PartitionKey"; private static final String ROW_KEY = "RowKey"; + private static final int TIMEOUT = 5000; private AzureTableImpl azureTable; - - AzureTableImpl auth() { + @Override + protected void beforeTest() { + super.beforeTest(); String connectionString = interceptorManager.isPlaybackMode() ? "DefaultEndpointsProtocol=https;=AccountName=dummyAccount;AccountKey=xyzDummy;EndpointSuffix=core.windows.net" - : System.getenv("azure_tables_connection_string"); + : System.getenv("AZURE_TABLES_CONNECTION_STRING"); StorageConnectionString storageConnectionString = StorageConnectionString.create(connectionString, new ClientLogger(AzureTableImplTest.class)); @@ -44,37 +45,34 @@ AzureTableImpl auth() { TablesSharedKeyCredential sharedKeyCredential = new TablesSharedKeyCredential(authSettings.getAccount().getName(), authSettings.getAccount().getAccessKey()); - final List policies = Arrays.asList( - new AddDatePolicy(), - new AddHeadersPolicy(new HttpHeaders().put("Accept", OdataMetadataFormat.APPLICATION_JSON_ODATA_MINIMALMETADATA.toString())), - new TablesSharedKeyCredentialPolicy(sharedKeyCredential), - new HttpLoggingPolicy(new HttpLogOptions() - .setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS)) - ); + final List policies = new ArrayList<>(); + policies.add(new AddDatePolicy()); + policies.add(new AddHeadersPolicy(new HttpHeaders().put("Accept", + OdataMetadataFormat.APPLICATION_JSON_ODATA_MINIMALMETADATA.toString()))); + policies.add(new TablesSharedKeyCredentialPolicy(sharedKeyCredential)); + policies.add(new HttpLoggingPolicy(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS))); + + final HttpClient httpClientToUse; + if (interceptorManager.isPlaybackMode()) { + httpClientToUse = interceptorManager.getPlaybackClient(); + } else { + httpClientToUse = HttpClient.createDefault(); + policies.add(interceptorManager.getRecordPolicy()); + policies.add(new RetryPolicy()); + } final HttpPipeline pipeline = new HttpPipelineBuilder() + .httpClient(httpClientToUse) .policies(policies.toArray(new HttpPipelinePolicy[0])) .build(); - AzureTableImpl azureTable = new AzureTableImplBuilder() + azureTable = new AzureTableImplBuilder() .pipeline(pipeline) .version("2019-02-02") .url(storageConnectionString.getTableEndpoint().getPrimaryUri()) .buildClient(); - return azureTable; } @Override - protected void beforeTest() { - super.beforeTest(); - } - - @BeforeEach - void before() { - azureTable = auth(); - - } - - @AfterEach - void after() { + protected void afterTest() { QueryOptions queryOptions = new QueryOptions() .setFormat(OdataMetadataFormat.APPLICATION_JSON_ODATA_MINIMALMETADATA); @@ -89,16 +87,19 @@ void after() { void createTable(String tableName) { TableProperties tableProperties = new TableProperties().setTableName(tableName); + String requestId = testResourceNamer.randomUuid(); - azureTable.getTables().createWithResponseAsync(tableProperties, testResourceNamer.randomUuid(), + azureTable.getTables().createWithResponseAsync(tableProperties, requestId, ResponseFormat.RETURN_CONTENT, null, Context.NONE).block(); } - void insertNoEtag(String tableName, Map properties) { - azureTable.getTables().insertEntityWithResponseAsync(tableName, 500, - UUID.randomUUID().toString(), ResponseFormat.RETURN_CONTENT, properties, null, Context.NONE).log().block(); + void insertNoETag(String tableName, Map properties) { + String requestId = testResourceNamer.randomUuid(); + + azureTable.getTables().insertEntityWithResponseAsync(tableName, TIMEOUT, + requestId, ResponseFormat.RETURN_CONTENT, properties, null, Context.NONE).log().block(); } String randomCharOnlyName(String prefix, int length) { @@ -114,7 +115,7 @@ String randomCharOnlyName(String prefix, int length) { @Test void createTable() { // Arrange - String tableName = randomCharOnlyName("test", 10); + String tableName = randomCharOnlyName("test", 20); TableProperties tableProperties = new TableProperties().setTableName(tableName); int expectedStatusCode = 201; String requestId = testResourceNamer.randomUuid(); @@ -132,7 +133,7 @@ void createTable() { @Test void createTableDuplicateName() { // Arrange - String tableName = randomCharOnlyName("test", 10); + String tableName = randomCharOnlyName("test", 20); TableProperties tableProperties = new TableProperties().setTableName(tableName); createTable(tableName); String requestId = testResourceNamer.randomUuid(); @@ -147,7 +148,7 @@ void createTableDuplicateName() { @Test void deleteTable() { // Arrange - String tableName = randomCharOnlyName("test", 10); + String tableName = randomCharOnlyName("test", 20); createTable(tableName); int expectedStatusCode = 204; String requestId = testResourceNamer.randomUuid(); @@ -165,7 +166,7 @@ void deleteTable() { @Test void deleteNonExistentTable() { // Arrange - String tableName = randomCharOnlyName("test", 10); + String tableName = randomCharOnlyName("test", 20); String requestId = testResourceNamer.randomUuid(); // Act & Assert @@ -175,14 +176,13 @@ void deleteNonExistentTable() { .verify(); } - @Test void queryTable() { // Arrange QueryOptions queryOptions = new QueryOptions() .setFormat(OdataMetadataFormat.APPLICATION_JSON_ODATA_MINIMALMETADATA); - String tableA = randomCharOnlyName("AtestA", 10); - String tableB = randomCharOnlyName("BtestB", 10); + String tableA = randomCharOnlyName("AtestA", 20); + String tableB = randomCharOnlyName("BtestB", 20); createTable(tableA); createTable(tableB); int expectedStatusCode = 200; @@ -200,21 +200,47 @@ void queryTable() { .verify(); } + @Test + void queryTablewithTop() { + // Arrange + QueryOptions queryOptions = new QueryOptions() + .setFormat(OdataMetadataFormat.APPLICATION_JSON_ODATA_MINIMALMETADATA); + String tableA = randomCharOnlyName("AtestA", 20); + String tableB = randomCharOnlyName("BtestB", 20); + createTable(tableA); + createTable(tableB); + int expectedStatusCode = 200; + int expectedSize = 1; + String requestId = testResourceNamer.randomUuid(); + queryOptions.setTop(1); + + // Act & Assert + StepVerifier.create(azureTable.getTables().queryWithResponseAsync(requestId, null, + queryOptions, Context.NONE)) + .assertNext(response -> { + Assertions.assertEquals(expectedStatusCode, response.getStatusCode()); + Assertions.assertEquals(expectedSize, response.getValue().getValue().size()); + Assertions.assertEquals(tableA, response.getValue().getValue().get(0).getTableName()); + }) + .expectComplete() + .verify(); + } + @Test void insertNoEtag() { // Arrange - String tableName = randomCharOnlyName("test", 10); + String tableName = randomCharOnlyName("test", 20); createTable(tableName); Map properties = new HashMap<>(); - String pkName = randomCharOnlyName("pk", 10); - String rkName = randomCharOnlyName("rk", 10); - properties.put(PARTITION_KEY, pkName); - properties.put(ROW_KEY, rkName); + String partitionKeyValue = randomCharOnlyName("partitionKey", 20); + String rowKeyValue = randomCharOnlyName("rowKey", 20); + properties.put(PARTITION_KEY, partitionKeyValue); + properties.put(ROW_KEY, rowKeyValue); int expectedStatusCode = 201; String requestId = testResourceNamer.randomUuid(); // Act & Assert - StepVerifier.create(azureTable.getTables().insertEntityWithResponseAsync(tableName, 500, + StepVerifier.create(azureTable.getTables().insertEntityWithResponseAsync(tableName, TIMEOUT, requestId, ResponseFormat.RETURN_CONTENT, properties, null, Context.NONE)) .assertNext(response -> { Assertions.assertEquals(expectedStatusCode, response.getStatusCode()); @@ -226,21 +252,21 @@ void insertNoEtag() { @Test void mergeEntity() { // Arrange - String tableName = randomCharOnlyName("test", 10); + String tableName = randomCharOnlyName("test", 20); createTable(tableName); Map properties = new HashMap<>(); - String pkName = randomCharOnlyName("pk", 10); - String rkName = randomCharOnlyName("rk", 10); - properties.put(PARTITION_KEY, pkName); - properties.put(ROW_KEY, rkName); + String partitionKeyValue = randomCharOnlyName("partitionKey", 20); + String rowKeyValue = randomCharOnlyName("rowKey", 20); + properties.put(PARTITION_KEY, partitionKeyValue); + properties.put(ROW_KEY, rowKeyValue); int expectedStatusCode = 204; String requestId = testResourceNamer.randomUuid(); - insertNoEtag(tableName, properties); - properties.put("additionalProperty", randomCharOnlyName("ap", 10)); + insertNoETag(tableName, properties); + properties.put("extraProperty", randomCharOnlyName("extraProperty", 16)); // Act & Assert - StepVerifier.create(azureTable.getTables().mergeEntityWithResponseAsync(tableName, pkName, - rkName, 500, requestId, "*", properties, null, Context.NONE)) + StepVerifier.create(azureTable.getTables().mergeEntityWithResponseAsync(tableName, partitionKeyValue, + rowKeyValue, TIMEOUT, requestId, "*", properties, null, Context.NONE)) .assertNext(response -> { Assertions.assertEquals(expectedStatusCode, response.getStatusCode()); }) @@ -251,16 +277,16 @@ void mergeEntity() { @Test void mergeNonExistentEntity() { // Arrange - String tableName = randomCharOnlyName("test", 10); + String tableName = randomCharOnlyName("test", 20); createTable(tableName); Map properties = new HashMap<>(); - String pkName = randomCharOnlyName("pk", 10); - String rkName = randomCharOnlyName("rk", 10); + String partitionKeyValue = randomCharOnlyName("partitionKey", 20); + String rowKeyValue = randomCharOnlyName("rowKey", 20); String requestId = testResourceNamer.randomUuid(); // Act & Assert - StepVerifier.create(azureTable.getTables().mergeEntityWithResponseAsync(tableName, pkName, - rkName, 500, requestId, "*", properties, null, Context.NONE)) + StepVerifier.create(azureTable.getTables().mergeEntityWithResponseAsync(tableName, partitionKeyValue, + rowKeyValue, TIMEOUT, requestId, "*", properties, null, Context.NONE)) .expectError(com.azure.data.tables.implementation.models.TableServiceErrorException.class) .verify(); } @@ -268,21 +294,21 @@ void mergeNonExistentEntity() { @Test void updateEntity() { // Arrange - String tableName = randomCharOnlyName("test", 10); + String tableName = randomCharOnlyName("test", 20); createTable(tableName); Map properties = new HashMap<>(); - String pkName = randomCharOnlyName("pk", 10); - String rkName = randomCharOnlyName("rk", 10); - properties.put(PARTITION_KEY, pkName); - properties.put(ROW_KEY, rkName); + String partitionKeyValue = randomCharOnlyName("partitionKey", 20); + String rowKeyValue = randomCharOnlyName("rowKey", 20); + properties.put(PARTITION_KEY, partitionKeyValue); + properties.put(ROW_KEY, rowKeyValue); int expectedStatusCode = 204; String requestId = testResourceNamer.randomUuid(); - insertNoEtag(tableName, properties); - properties.put("additionalProperty", randomCharOnlyName("ap", 10)); + insertNoETag(tableName, properties); + properties.put("extraProperty", randomCharOnlyName("extraProperty", 16)); // Act & Assert - StepVerifier.create(azureTable.getTables().updateEntityWithResponseAsync(tableName, pkName, - rkName, 500, requestId, "*", properties, null, Context.NONE)) + StepVerifier.create(azureTable.getTables().updateEntityWithResponseAsync(tableName, partitionKeyValue, + rowKeyValue, TIMEOUT, requestId, "*", properties, null, Context.NONE)) .assertNext(response -> { Assertions.assertEquals(expectedStatusCode, response.getStatusCode()); }) @@ -293,16 +319,16 @@ void updateEntity() { @Test void updateNonExistentEntity() { // Arrange - String tableName = randomCharOnlyName("test", 10); + String tableName = randomCharOnlyName("test", 20); createTable(tableName); Map properties = new HashMap<>(); - String pkName = randomCharOnlyName("pk", 10); - String rkName = randomCharOnlyName("rk", 10); + String partitionKeyValue = randomCharOnlyName("partitionKey", 20); + String rowKeyValue = randomCharOnlyName("rowKey", 20); String requestId = testResourceNamer.randomUuid(); // Act & Assert - StepVerifier.create(azureTable.getTables().updateEntityWithResponseAsync(tableName, pkName, - rkName, 500, requestId, "*", properties, null, Context.NONE)) + StepVerifier.create(azureTable.getTables().updateEntityWithResponseAsync(tableName, partitionKeyValue, + rowKeyValue, TIMEOUT, requestId, "*", properties, null, Context.NONE)) .expectError(com.azure.data.tables.implementation.models.TableServiceErrorException.class) .verify(); } @@ -310,20 +336,20 @@ void updateNonExistentEntity() { @Test void deleteEntity() { // Arrange - String tableName = randomCharOnlyName("test", 10); + String tableName = randomCharOnlyName("test", 20); createTable(tableName); Map properties = new HashMap<>(); - String pkName = randomCharOnlyName("pk", 10); - String rkName = randomCharOnlyName("rk", 10); - properties.put(PARTITION_KEY, pkName); - properties.put(ROW_KEY, rkName); + String partitionKeyValue = randomCharOnlyName("partitionKey", 20); + String rowKeyValue = randomCharOnlyName("rowKey", 20); + properties.put(PARTITION_KEY, partitionKeyValue); + properties.put(ROW_KEY, rowKeyValue); int expectedStatusCode = 204; String requestId = testResourceNamer.randomUuid(); - insertNoEtag(tableName, properties); + insertNoETag(tableName, properties); // Act & Assert - StepVerifier.create(azureTable.getTables().deleteEntityWithResponseAsync(tableName, pkName, - rkName, "*", 500, requestId, null, Context.NONE)) + StepVerifier.create(azureTable.getTables().deleteEntityWithResponseAsync(tableName, partitionKeyValue, + rowKeyValue, "*", TIMEOUT, requestId, null, Context.NONE)) .assertNext(response -> { Assertions.assertEquals(expectedStatusCode, response.getStatusCode()); }) @@ -334,15 +360,15 @@ void deleteEntity() { @Test void deleteNonExistentEntity() { // Arrange - String tableName = randomCharOnlyName("test", 10); + String tableName = randomCharOnlyName("test", 20); createTable(tableName); - String pkName = randomCharOnlyName("pk", 10); - String rkName = randomCharOnlyName("rk", 10); + String partitionKeyValue = randomCharOnlyName("partitionKey", 20); + String rowKeyValue = randomCharOnlyName("rowKey", 20); String requestId = testResourceNamer.randomUuid(); // Act & Assert - StepVerifier.create(azureTable.getTables().deleteEntityWithResponseAsync(tableName, pkName, - rkName, "*", 500, requestId, null, Context.NONE)) + StepVerifier.create(azureTable.getTables().deleteEntityWithResponseAsync(tableName, partitionKeyValue, + rowKeyValue, "*", TIMEOUT, requestId, null, Context.NONE)) .expectError(com.azure.data.tables.implementation.models.TableServiceErrorException.class) .verify(); } @@ -352,29 +378,29 @@ void queryEntity() { // Arrange String requestId = testResourceNamer.randomUuid(); QueryOptions queryOptions = new QueryOptions().setFormat(OdataMetadataFormat.APPLICATION_JSON_ODATA_FULLMETADATA); - String tableName = randomCharOnlyName("test", 10); + String tableName = randomCharOnlyName("test", 20); createTable(tableName); - Map propertiesA = new HashMap<>(); - String pkNameA = randomCharOnlyName("pkA", 10); - String rkNameA = randomCharOnlyName("rkA", 10); - propertiesA.put(PARTITION_KEY, pkNameA); - propertiesA.put(ROW_KEY, rkNameA); - insertNoEtag(tableName, propertiesA); - Map propertiesB = new HashMap<>(); - String pkNameB = randomCharOnlyName("pkB", 10); - String rkNameB = randomCharOnlyName("rkB", 10); - propertiesB.put(PARTITION_KEY, pkNameB); - propertiesB.put(ROW_KEY, rkNameB); - insertNoEtag(tableName, propertiesB); + //insert entity A + Map entityA = new HashMap<>(); + String partitionKeyEntityA = randomCharOnlyName("partitionKeyA", 20); + entityA.put(PARTITION_KEY, partitionKeyEntityA); + entityA.put(ROW_KEY, randomCharOnlyName("rowKeyA", 20)); + insertNoETag(tableName, entityA); + //insert entity B + Map entityB = new HashMap<>(); + String partitionKeyEntityB = randomCharOnlyName("partitionKeyB", 20); + entityB.put(PARTITION_KEY, partitionKeyEntityB); + entityB.put(ROW_KEY, randomCharOnlyName("rowKeyB", 20)); + insertNoETag(tableName, entityB); int expectedStatusCode = 200; // Act & Assert - StepVerifier.create(azureTable.getTables().queryEntitiesWithResponseAsync(tableName, null, + StepVerifier.create(azureTable.getTables().queryEntitiesWithResponseAsync(tableName, TIMEOUT, requestId, null, null, queryOptions, Context.NONE)) .assertNext(response -> { Assertions.assertEquals(expectedStatusCode, response.getStatusCode()); - Assertions.assertEquals(true, response.getValue().getValue().get(0).containsValue(pkNameA)); - Assertions.assertEquals(true, response.getValue().getValue().get(1).containsValue(pkNameB)); + Assertions.assertEquals(true, response.getValue().getValue().get(0).containsValue(partitionKeyEntityA)); + Assertions.assertEquals(true, response.getValue().getValue().get(1).containsValue(partitionKeyEntityB)); }) .expectComplete() @@ -384,33 +410,35 @@ void queryEntity() { @Test void queryEntityWithSelect() { // Arrange - String ap = "additionalProperty"; String requestId = testResourceNamer.randomUuid(); QueryOptions queryOptions = new QueryOptions().setFormat(OdataMetadataFormat.APPLICATION_JSON_ODATA_FULLMETADATA); - String tableName = randomCharOnlyName("test", 10); + String tableName = randomCharOnlyName("test", 20); createTable(tableName); - Map propertiesA = new HashMap<>(); - String apNameA = randomCharOnlyName("apA", 10); - propertiesA.put(PARTITION_KEY, randomCharOnlyName("pkA", 10)); - propertiesA.put(ROW_KEY, randomCharOnlyName("rkA", 10)); - propertiesA.put(ap, apNameA); - insertNoEtag(tableName, propertiesA); - Map propertiesB = new HashMap<>(); - String apNameB = randomCharOnlyName("apA", 10); - propertiesB.put(PARTITION_KEY, randomCharOnlyName("pkB", 10)); - propertiesB.put(ROW_KEY, randomCharOnlyName("rkB", 10)); - propertiesB.put(ap, apNameB); - insertNoEtag(tableName, propertiesB); + //insert entity A + Map entityA = new HashMap<>(); + String partitionKeyEntityA = randomCharOnlyName("partitionKeyA", 20); + String rowKeyEntityA = randomCharOnlyName("rowKeyA", 20); + entityA.put(PARTITION_KEY, partitionKeyEntityA); + entityA.put(ROW_KEY, rowKeyEntityA); + insertNoETag(tableName, entityA); + //insert entity B + Map entityB = new HashMap<>(); + String partitionKeyEntityB = randomCharOnlyName("partitionKeyB", 20); + String rowKeyEntityB = randomCharOnlyName("rowKeyB", 20); + entityB.put(PARTITION_KEY, partitionKeyEntityB); + entityB.put(ROW_KEY, rowKeyEntityB ); + insertNoETag(tableName, entityB); int expectedStatusCode = 200; - queryOptions.setSelect(ap); + queryOptions.setSelect(ROW_KEY); // Act & Assert - StepVerifier.create(azureTable.getTables().queryEntitiesWithResponseAsync(tableName, null, + StepVerifier.create(azureTable.getTables().queryEntitiesWithResponseAsync(tableName, TIMEOUT, requestId, null, null, queryOptions, Context.NONE)) .assertNext(response -> { + System.out.println(response); Assertions.assertEquals(expectedStatusCode, response.getStatusCode()); - Assertions.assertEquals(true, response.getValue().getValue().get(0).containsValue(apNameA)); - Assertions.assertEquals(true, response.getValue().getValue().get(1).containsValue(apNameB)); + Assertions.assertEquals(true, response.getValue().getValue().get(0).containsValue(rowKeyEntityA)); + Assertions.assertEquals(true, response.getValue().getValue().get(1).containsValue(rowKeyEntityB)); }) .expectComplete() @@ -420,55 +448,67 @@ void queryEntityWithSelect() { @Test void queryEntityWithFilter() { // Arrange - String ap = "additionalProperty"; String requestId = testResourceNamer.randomUuid(); QueryOptions queryOptions = new QueryOptions().setFormat(OdataMetadataFormat.APPLICATION_JSON_ODATA_FULLMETADATA); - String tableName = randomCharOnlyName("test", 10); + String tableName = randomCharOnlyName("test", 20); + createTable(tableName); + Map entityA = new HashMap<>(); + String partitionKeyEntityA = randomCharOnlyName("partitionKeyA", 20); + entityA.put(PARTITION_KEY, partitionKeyEntityA); + entityA.put(ROW_KEY, randomCharOnlyName("rowKeyA", 20)); + insertNoETag(tableName, entityA); + int expectedStatusCode = 200; + queryOptions.setSelect(PARTITION_KEY + "eq" + partitionKeyEntityA); + + // Act & Assert + StepVerifier.create(azureTable.getTables().queryEntitiesWithResponseAsync(tableName, TIMEOUT, + requestId, null, null, queryOptions, Context.NONE)) + .assertNext(response -> { + Assertions.assertEquals(expectedStatusCode, response.getStatusCode()); + + }) + .expectComplete() + .verify(); + } + + @Test + void queryEntityWithTop() { + // Arrange + String requestId = testResourceNamer.randomUuid(); + QueryOptions queryOptions = new QueryOptions().setFormat(OdataMetadataFormat.APPLICATION_JSON_ODATA_FULLMETADATA); + String tableName = randomCharOnlyName("test", 20); createTable(tableName); - Map propertiesA = new HashMap<>(); - String apNameA = randomCharOnlyName("apA", 10); - propertiesA.put(PARTITION_KEY, randomCharOnlyName("pkA", 10)); - propertiesA.put(ROW_KEY, randomCharOnlyName("rkA", 10)); - propertiesA.put(ap, apNameA); - insertNoEtag(tableName, propertiesA); - Map propertiesB = new HashMap<>(); - String apNameB = randomCharOnlyName("apA", 10); - propertiesB.put(PARTITION_KEY, randomCharOnlyName("pkB", 10)); - propertiesB.put(ROW_KEY, randomCharOnlyName("rkB", 10)); - propertiesB.put(ap, apNameB); - insertNoEtag(tableName, propertiesB); int expectedStatusCode = 200; - queryOptions.setFilter(ap + " eq " + apNameA); + queryOptions.setTop(0); // Act & Assert - StepVerifier.create(azureTable.getTables().queryEntitiesWithResponseAsync(tableName, null, + StepVerifier.create(azureTable.getTables().queryEntitiesWithResponseAsync(tableName, TIMEOUT, requestId, null, null, queryOptions, Context.NONE)) .assertNext(response -> { Assertions.assertEquals(expectedStatusCode, response.getStatusCode()); - Assertions.assertEquals(true, response.getValue().getValue().get(0).containsValue(apNameA)); - // Assertions.assertEquals(false, response.getValue().getValue().get(1).containsValue(apNameB)); }) .expectComplete() .verify(); } + @Test void queryEntitiesWithPartitionAndRowKey() { // Arrange QueryOptions queryOptions = new QueryOptions().setFormat(OdataMetadataFormat.APPLICATION_JSON_ODATA_FULLMETADATA); - String tableName = randomCharOnlyName("test", 10); + String tableName = randomCharOnlyName("test", 20); createTable(tableName); Map properties = new HashMap<>(); - String pkName = randomCharOnlyName("pk", 10); - String rkName = randomCharOnlyName("rk", 10); - properties.put(PARTITION_KEY, pkName); - properties.put(ROW_KEY, rkName); - insertNoEtag(tableName, properties); + String partitionKeyValue = randomCharOnlyName("partitionKey", 20); + String rowKeyValue = randomCharOnlyName("rowKey", 20); + properties.put(PARTITION_KEY, partitionKeyValue); + properties.put(ROW_KEY, rowKeyValue); + insertNoETag(tableName, properties); // Act & Assert - StepVerifier.create(azureTable.getTables().queryEntitiesWithPartitionAndRowKeyWithResponseAsync(tableName, pkName, - rkName, 1000, UUID.randomUUID().toString(), queryOptions, Context.NONE)) + StepVerifier.create(azureTable.getTables().queryEntitiesWithPartitionAndRowKeyWithResponseAsync(tableName, partitionKeyValue, + rowKeyValue, TIMEOUT, UUID.randomUUID().toString(), queryOptions, Context.NONE)) .assertNext(response -> { Assertions.assertEquals(200, response.getStatusCode()); }) diff --git a/sdk/tables/azure-data-tables/swagger/README.md b/sdk/tables/azure-data-tables/swagger/README.md index 64462257e8de..52334f296e41 100644 --- a/sdk/tables/azure-data-tables/swagger/README.md +++ b/sdk/tables/azure-data-tables/swagger/README.md @@ -4,7 +4,7 @@ ### Setup ```ps -Fork and clone https://github.com/Azure/autorest.java +ForowKey and clone https://github.com/Azure/autorest.java git checkout v4 git submodule update --init --recursive mvn package -Dlocal @@ -15,7 +15,7 @@ npm install -g autorest ### Generation ```ps cd -autorest --java --use=C:/work/autorest.java +autorest --java --use=C:/worowKey/autorest.java ``` ### Code generation settings From f13cca62df7e45a2c50b3d4cd359be7f9f57ce8f Mon Sep 17 00:00:00 2001 From: Eleanor Boyd Date: Tue, 30 Jun 2020 11:26:11 -0400 Subject: [PATCH 13/33] reformat --- .../data/tables/TablesSharedKeyCredential.java | 3 +-- .../com/azure/data/tables/AzureTableImplTest.java | 14 +++++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredential.java b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredential.java index 640f0729f8b9..c5287404a5a2 100644 --- a/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredential.java +++ b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredential.java @@ -54,10 +54,9 @@ public String generateAuthorizationHeader(URL requestURL, Map he private String buildStringToSign(URL requestURL, Map headers) { String dateHeader = headers.containsKey("x-ms-date") ? "" : this.getStandardHeaderValue(headers, "Date"); - String s = String.join("\n", + return String.join("\n", dateHeader, //date this.getCanonicalizedResource(requestURL)); //Canonicalized resource - return s; } /** diff --git a/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java b/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java index 55563e14bb39..58b63896ea20 100644 --- a/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java +++ b/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java @@ -8,11 +8,15 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; import com.azure.core.http.policy.*; +import com.azure.core.test.TestBase; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.data.tables.implementation.AzureTableImpl; import com.azure.data.tables.implementation.AzureTableImplBuilder; -import com.azure.data.tables.implementation.models.*; +import com.azure.data.tables.implementation.models.OdataMetadataFormat; +import com.azure.data.tables.implementation.models.QueryOptions; +import com.azure.data.tables.implementation.models.ResponseFormat; +import com.azure.data.tables.implementation.models.TableProperties; import com.azure.storage.common.implementation.connectionstring.StorageAuthenticationSettings; import com.azure.storage.common.implementation.connectionstring.StorageConnectionString; import org.junit.jupiter.api.Assertions; @@ -20,7 +24,7 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; import reactor.test.StepVerifier; -import com.azure.core.test.TestBase; + import java.util.*; /** @@ -64,7 +68,7 @@ protected void beforeTest() { .httpClient(httpClientToUse) .policies(policies.toArray(new HttpPipelinePolicy[0])) .build(); - azureTable = new AzureTableImplBuilder() + azureTable = new AzureTableImplBuilder() .pipeline(pipeline) .version("2019-02-02") .url(storageConnectionString.getTableEndpoint().getPrimaryUri()) @@ -99,7 +103,7 @@ void insertNoETag(String tableName, Map properties) { String requestId = testResourceNamer.randomUuid(); azureTable.getTables().insertEntityWithResponseAsync(tableName, TIMEOUT, - requestId, ResponseFormat.RETURN_CONTENT, properties, null, Context.NONE).log().block(); + requestId, ResponseFormat.RETURN_CONTENT, properties, null, Context.NONE).log().block(); } String randomCharOnlyName(String prefix, int length) { @@ -426,7 +430,7 @@ void queryEntityWithSelect() { String partitionKeyEntityB = randomCharOnlyName("partitionKeyB", 20); String rowKeyEntityB = randomCharOnlyName("rowKeyB", 20); entityB.put(PARTITION_KEY, partitionKeyEntityB); - entityB.put(ROW_KEY, rowKeyEntityB ); + entityB.put(ROW_KEY, rowKeyEntityB); insertNoETag(tableName, entityB); int expectedStatusCode = 200; queryOptions.setSelect(ROW_KEY); From d4c187aa25bd34061ae38ae9e73e78d48452441d Mon Sep 17 00:00:00 2001 From: Eleanor Boyd Date: Tue, 30 Jun 2020 11:27:12 -0400 Subject: [PATCH 14/33] remove system prints --- .../src/test/java/com/azure/data/tables/AzureTableImplTest.java | 1 - 1 file changed, 1 deletion(-) diff --git a/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java b/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java index 58b63896ea20..1b3e257e8498 100644 --- a/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java +++ b/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java @@ -439,7 +439,6 @@ void queryEntityWithSelect() { StepVerifier.create(azureTable.getTables().queryEntitiesWithResponseAsync(tableName, TIMEOUT, requestId, null, null, queryOptions, Context.NONE)) .assertNext(response -> { - System.out.println(response); Assertions.assertEquals(expectedStatusCode, response.getStatusCode()); Assertions.assertEquals(true, response.getValue().getValue().get(0).containsValue(rowKeyEntityA)); Assertions.assertEquals(true, response.getValue().getValue().get(1).containsValue(rowKeyEntityB)); From 335d6466c22b1a4627c8421ae3dd755fc116d22b Mon Sep 17 00:00:00 2001 From: Eleanor Boyd Date: Tue, 30 Jun 2020 14:09:07 -0400 Subject: [PATCH 15/33] adding playback jsons --- .../session-records/createTable.json | 71 +++++++++ .../createTableDuplicateName.json | 95 ++++++++++++ .../session-records/deleteEntity.json | 117 ++++++++++++++ .../deleteNonExistentEntity.json | 93 +++++++++++ .../deleteNonExistentTable.json | 48 ++++++ .../session-records/deleteTable.json | 71 +++++++++ .../session-records/insertNoEtag.json | 97 ++++++++++++ .../session-records/mergeEntity.json | 119 ++++++++++++++ .../mergeNonExistentEntity.json | 94 ++++++++++++ .../queryEntitiesWithPartitionAndRowKey.json | 120 +++++++++++++++ .../session-records/queryEntity.json | 145 ++++++++++++++++++ .../queryEntityWithFilter.json | 119 ++++++++++++++ .../queryEntityWithSelect.json | 145 ++++++++++++++++++ .../session-records/queryEntityWithTop.json | 93 +++++++++++ .../resources/session-records/queryTable.json | 138 +++++++++++++++++ .../session-records/queryTablewithFilter.json | 138 +++++++++++++++++ .../session-records/queryTablewithTop.json | 139 +++++++++++++++++ .../session-records/updateEntity.json | 119 ++++++++++++++ .../updateNonExistentEntity.json | 94 ++++++++++++ 19 files changed, 2055 insertions(+) create mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/createTable.json create mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/createTableDuplicateName.json create mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/deleteEntity.json create mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/deleteNonExistentEntity.json create mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/deleteNonExistentTable.json create mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/deleteTable.json create mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/insertNoEtag.json create mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/mergeEntity.json create mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/mergeNonExistentEntity.json create mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntitiesWithPartitionAndRowKey.json create mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntity.json create mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntityWithFilter.json create mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntityWithSelect.json create mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntityWithTop.json create mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/queryTable.json create mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/queryTablewithFilter.json create mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/queryTablewithTop.json create mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/updateEntity.json create mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/updateNonExistentEntity.json diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/createTable.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/createTable.json new file mode 100644 index 000000000000..15baea5204e5 --- /dev/null +++ b/sdk/tables/azure-data-tables/src/test/resources/session-records/createTable.json @@ -0,0 +1,71 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "5437f69b-e1b0-4bd0-9126-a05cbc8b751a", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "f81e6aa0-7002-0064-54f2-4ea465000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"testeszhrzmnluonrsdu\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "5437f69b-e1b0-4bd0-9126-a05cbc8b751a", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/Tables('testeszhrzmnluonrsdu')" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "020dead4-ce43-4f67-acb5-c50773d82d23" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "dd939a01-6002-009c-75f2-4ef89b000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"testeszhrzmnluonrsdu\"}]}", + "Date" : "Tue, 30 Jun 2020 15:21:40 GMT", + "x-ms-client-request-id" : "020dead4-ce43-4f67-acb5-c50773d82d23", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('testeszhrzmnluonrsdu')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "6599ac78-0e91-45fb-8f9e-b633aa823be2" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "7871c00a-4002-0040-03f2-4e52c5000000", + "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", + "x-ms-client-request-id" : "6599ac78-0e91-45fb-8f9e-b633aa823be2" + }, + "Exception" : null + } ], + "variables" : [ "5437f69b-e1b0-4bd0-9126-a05cbc8b751a", "6599ac78-0e91-45fb-8f9e-b633aa823be2" ] +} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/createTableDuplicateName.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/createTableDuplicateName.json new file mode 100644 index 000000000000..082fed2fe7d3 --- /dev/null +++ b/sdk/tables/azure-data-tables/src/test/resources/session-records/createTableDuplicateName.json @@ -0,0 +1,95 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "f144cd7d-6238-4467-825b-d1646a66bef6", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "dd9399f3-6002-009c-6cf2-4ef89b000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"testxlkrkwkqgibisiks\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "f144cd7d-6238-4467-825b-d1646a66bef6", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/Tables('testxlkrkwkqgibisiks')" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "bdb27d04-1814-4c0b-8e42-7d6839d5f7aa", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "409", + "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "f81e6a82-7002-0064-3cf2-4ea465000000", + "Body" : "{\"odata.error\":{\"code\":\"TableAlreadyExists\",\"message\":{\"lang\":\"en-US\",\"value\":\"The table specified already exists.\\nRequestId:f81e6a82-7002-0064-3cf2-4ea465000000\\nTime:2020-06-30T15:21:39.9155417Z\"}}}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "bdb27d04-1814-4c0b-8e42-7d6839d5f7aa", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "57523d9f-22c9-4d94-aa60-44d2fca5c663" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "dd9399f5-6002-009c-6df2-4ef89b000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"testxlkrkwkqgibisiks\"}]}", + "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", + "x-ms-client-request-id" : "57523d9f-22c9-4d94-aa60-44d2fca5c663", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('testxlkrkwkqgibisiks')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "b6190095-cd61-4b60-afd9-6bad5edd0b1a" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "f81e6a85-7002-0064-3ef2-4ea465000000", + "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", + "x-ms-client-request-id" : "b6190095-cd61-4b60-afd9-6bad5edd0b1a" + }, + "Exception" : null + } ], + "variables" : [ "f144cd7d-6238-4467-825b-d1646a66bef6", "bdb27d04-1814-4c0b-8e42-7d6839d5f7aa", "b6190095-cd61-4b60-afd9-6bad5edd0b1a" ] +} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/deleteEntity.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/deleteEntity.json new file mode 100644 index 000000000000..8415183d4608 --- /dev/null +++ b/sdk/tables/azure-data-tables/src/test/resources/session-records/deleteEntity.json @@ -0,0 +1,117 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "8079d86a-4058-47ca-b527-0fbacbd7818c", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "dd9399e6-6002-009c-66f2-4ef89b000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"testfktchjrzgypcdbng\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "8079d86a-4058-47ca-b527-0fbacbd7818c", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/Tables('testfktchjrzgypcdbng')" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/testfktchjrzgypcdbng?timeout=5000", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "fe643e48-f42f-4aa0-807a-97a7d0179660", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Tue, 30 Jun 2020 15:21:38 GMT", + "Cache-Control" : "no-cache", + "ETag" : "W/\"datetime'2020-06-30T15%3A21%3A39.6303407Z'\"", + "x-ms-request-id" : "f81e6a70-7002-0064-30f2-4ea465000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#testfktchjrzgypcdbng/@Element\",\"odata.etag\":\"W/\\\"datetime'2020-06-30T15%3A21%3A39.6303407Z'\\\"\",\"PartitionKey\":\"partitionKeyrxkdcvdo\",\"RowKey\":\"rowKeyopbrtellakatrv\",\"Timestamp\":\"2020-06-30T15:21:39.6303407Z\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "fe643e48-f42f-4aa0-807a-97a7d0179660", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/testfktchjrzgypcdbng(PartitionKey='partitionKeyrxkdcvdo',RowKey='rowKeyopbrtellakatrv')" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/testfktchjrzgypcdbng(PartitionKey='partitionKeyrxkdcvdo',RowKey='rowKeyopbrtellakatrv')?timeout=5000", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "6a9f0bba-06a0-4537-b99d-5b5af6a93c48" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "dd9399e8-6002-009c-67f2-4ef89b000000", + "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", + "x-ms-client-request-id" : "6a9f0bba-06a0-4537-b99d-5b5af6a93c48" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "1654fa5a-fedb-4933-8927-ae60f3bfcbf0" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "f81e6a75-7002-0064-34f2-4ea465000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"testfktchjrzgypcdbng\"}]}", + "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", + "x-ms-client-request-id" : "1654fa5a-fedb-4933-8927-ae60f3bfcbf0", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('testfktchjrzgypcdbng')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "10cd3f67-ee44-44bb-8ae6-51641ca1efb3" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "dd9399eb-6002-009c-68f2-4ef89b000000", + "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", + "x-ms-client-request-id" : "10cd3f67-ee44-44bb-8ae6-51641ca1efb3" + }, + "Exception" : null + } ], + "variables" : [ "8079d86a-4058-47ca-b527-0fbacbd7818c", "6a9f0bba-06a0-4537-b99d-5b5af6a93c48", "fe643e48-f42f-4aa0-807a-97a7d0179660", "10cd3f67-ee44-44bb-8ae6-51641ca1efb3" ] +} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/deleteNonExistentEntity.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/deleteNonExistentEntity.json new file mode 100644 index 000000000000..47693b582fef --- /dev/null +++ b/sdk/tables/azure-data-tables/src/test/resources/session-records/deleteNonExistentEntity.json @@ -0,0 +1,93 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "e067c687-238c-4721-bd78-b55edbf5917e", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Tue, 30 Jun 2020 15:21:40 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "7871c020-4002-0040-10f2-4e52c5000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"testqmqjkkxvhaqntglh\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "e067c687-238c-4721-bd78-b55edbf5917e", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/Tables('testqmqjkkxvhaqntglh')" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/testqmqjkkxvhaqntglh(PartitionKey='partitionKeycnfrqgeq',RowKey='rowKeysaqehuaddxjcvw')?timeout=5000", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "06243cce-5e11-410c-9bab-a024d35f4955" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "404", + "x-ms-request-id" : "f81e6ae3-7002-0064-09f2-4ea465000000", + "Body" : "{\"odata.error\":{\"code\":\"ResourceNotFound\",\"message\":{\"lang\":\"en-US\",\"value\":\"The specified resource does not exist.\\nRequestId:f81e6ae3-7002-0064-09f2-4ea465000000\\nTime:2020-06-30T15:21:41.4186025Z\"}}}", + "Date" : "Tue, 30 Jun 2020 15:21:40 GMT", + "x-ms-client-request-id" : "06243cce-5e11-410c-9bab-a024d35f4955", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "27805eb1-4017-4f58-a8b3-e16b5f733a51" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "dd939a47-6002-009c-33f2-4ef89b000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"testqmqjkkxvhaqntglh\"}]}", + "Date" : "Tue, 30 Jun 2020 15:21:41 GMT", + "x-ms-client-request-id" : "27805eb1-4017-4f58-a8b3-e16b5f733a51", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('testqmqjkkxvhaqntglh')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "98be0115-6a9e-406f-88f0-185eb476b203" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "7871c022-4002-0040-11f2-4e52c5000000", + "Date" : "Tue, 30 Jun 2020 15:21:40 GMT", + "x-ms-client-request-id" : "98be0115-6a9e-406f-88f0-185eb476b203" + }, + "Exception" : null + } ], + "variables" : [ "e067c687-238c-4721-bd78-b55edbf5917e", "06243cce-5e11-410c-9bab-a024d35f4955", "98be0115-6a9e-406f-88f0-185eb476b203" ] +} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/deleteNonExistentTable.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/deleteNonExistentTable.json new file mode 100644 index 000000000000..d6f614ca8983 --- /dev/null +++ b/sdk/tables/azure-data-tables/src/test/resources/session-records/deleteNonExistentTable.json @@ -0,0 +1,48 @@ +{ + "networkCallRecords" : [ { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('testygepqeuzwpizpjqk')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "3b9bf4b5-cb3d-4519-8b3a-52514086d2b8" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "404", + "x-ms-request-id" : "f81e6ae0-7002-0064-06f2-4ea465000000", + "Body" : "{\"odata.error\":{\"code\":\"ResourceNotFound\",\"message\":{\"lang\":\"en-US\",\"value\":\"The specified resource does not exist.\\nRequestId:f81e6ae0-7002-0064-06f2-4ea465000000\\nTime:2020-06-30T15:21:41.3025206Z\"}}}", + "Date" : "Tue, 30 Jun 2020 15:21:40 GMT", + "x-ms-client-request-id" : "3b9bf4b5-cb3d-4519-8b3a-52514086d2b8", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "93d5263f-8931-4a4c-bd7a-edada97b2556" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "dd939a42-6002-009c-2ef2-4ef89b000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[]}", + "Date" : "Tue, 30 Jun 2020 15:21:41 GMT", + "x-ms-client-request-id" : "93d5263f-8931-4a4c-bd7a-edada97b2556", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ "3b9bf4b5-cb3d-4519-8b3a-52514086d2b8" ] +} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/deleteTable.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/deleteTable.json new file mode 100644 index 000000000000..28f596d761b3 --- /dev/null +++ b/sdk/tables/azure-data-tables/src/test/resources/session-records/deleteTable.json @@ -0,0 +1,71 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "2b9eacd5-2f2e-4f99-a958-39a691b5d53f", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "f81e6a78-7002-0064-37f2-4ea465000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"testrqmzwvgiibbpxbjw\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "2b9eacd5-2f2e-4f99-a958-39a691b5d53f", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/Tables('testrqmzwvgiibbpxbjw')" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('testrqmzwvgiibbpxbjw')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "3159875c-8664-431a-b38c-13db7ae90827" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "dd9399ec-6002-009c-69f2-4ef89b000000", + "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", + "x-ms-client-request-id" : "3159875c-8664-431a-b38c-13db7ae90827" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "e7f5945b-d937-4e40-b199-da44d017a796" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "f81e6a81-7002-0064-3bf2-4ea465000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[]}", + "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", + "x-ms-client-request-id" : "e7f5945b-d937-4e40-b199-da44d017a796", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ "2b9eacd5-2f2e-4f99-a958-39a691b5d53f", "3159875c-8664-431a-b38c-13db7ae90827" ] +} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/insertNoEtag.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/insertNoEtag.json new file mode 100644 index 000000000000..317935d44194 --- /dev/null +++ b/sdk/tables/azure-data-tables/src/test/resources/session-records/insertNoEtag.json @@ -0,0 +1,97 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "c1bd0540-6732-44fc-8227-288d6ac5b0ce", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "7871c016-4002-0040-0af2-4e52c5000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"testkzypmilczquzckqs\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "c1bd0540-6732-44fc-8227-288d6ac5b0ce", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/Tables('testkzypmilczquzckqs')" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/testkzypmilczquzckqs?timeout=5000", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "049d3c67-1fbd-4958-8d50-f9e852ed244d", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Tue, 30 Jun 2020 15:21:40 GMT", + "Cache-Control" : "no-cache", + "ETag" : "W/\"datetime'2020-06-30T15%3A21%3A40.8241827Z'\"", + "x-ms-request-id" : "f81e6ac9-7002-0064-77f2-4ea465000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#testkzypmilczquzckqs/@Element\",\"odata.etag\":\"W/\\\"datetime'2020-06-30T15%3A21%3A40.8241827Z'\\\"\",\"PartitionKey\":\"partitionKeyuatahatv\",\"RowKey\":\"rowKeypeosnxbvjmbcrg\",\"Timestamp\":\"2020-06-30T15:21:40.8241827Z\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "049d3c67-1fbd-4958-8d50-f9e852ed244d", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/testkzypmilczquzckqs(PartitionKey='partitionKeyuatahatv',RowKey='rowKeypeosnxbvjmbcrg')" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "f832e8cf-a0ad-490b-bf85-1c0547e4888c" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "dd939a28-6002-009c-18f2-4ef89b000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"testkzypmilczquzckqs\"}]}", + "Date" : "Tue, 30 Jun 2020 15:21:40 GMT", + "x-ms-client-request-id" : "f832e8cf-a0ad-490b-bf85-1c0547e4888c", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('testkzypmilczquzckqs')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "716efbea-e61b-4f42-96f1-1accfdced88f" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "7871c018-4002-0040-0bf2-4e52c5000000", + "Date" : "Tue, 30 Jun 2020 15:21:40 GMT", + "x-ms-client-request-id" : "716efbea-e61b-4f42-96f1-1accfdced88f" + }, + "Exception" : null + } ], + "variables" : [ "c1bd0540-6732-44fc-8227-288d6ac5b0ce", "049d3c67-1fbd-4958-8d50-f9e852ed244d", "716efbea-e61b-4f42-96f1-1accfdced88f" ] +} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/mergeEntity.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/mergeEntity.json new file mode 100644 index 000000000000..cf5ead8ef46c --- /dev/null +++ b/sdk/tables/azure-data-tables/src/test/resources/session-records/mergeEntity.json @@ -0,0 +1,119 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "bbca0946-7a3d-4030-852d-f6a69f5e6b16", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "f81e6aa7-7002-0064-5af2-4ea465000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"testkgmycpvdeispzzoi\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "bbca0946-7a3d-4030-852d-f6a69f5e6b16", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/Tables('testkgmycpvdeispzzoi')" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/testkgmycpvdeispzzoi?timeout=5000", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "24cd9b36-e1d1-413c-9957-82b2092afa61", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Tue, 30 Jun 2020 15:21:40 GMT", + "Cache-Control" : "no-cache", + "ETag" : "W/\"datetime'2020-06-30T15%3A21%3A40.4577739Z'\"", + "x-ms-request-id" : "dd939a08-6002-009c-7cf2-4ef89b000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#testkgmycpvdeispzzoi/@Element\",\"odata.etag\":\"W/\\\"datetime'2020-06-30T15%3A21%3A40.4577739Z'\\\"\",\"PartitionKey\":\"partitionKeytfjpmptd\",\"RowKey\":\"rowKeynzjzmhtiorwwxc\",\"Timestamp\":\"2020-06-30T15:21:40.4577739Z\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "24cd9b36-e1d1-413c-9957-82b2092afa61", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/testkgmycpvdeispzzoi(PartitionKey='partitionKeytfjpmptd',RowKey='rowKeynzjzmhtiorwwxc')" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.table.core.windows.net/testkgmycpvdeispzzoi(PartitionKey='partitionKeytfjpmptd',RowKey='rowKeynzjzmhtiorwwxc')?timeout=5000", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "7df00b09-038b-471a-84f2-23b559508806", + "Content-Type" : "application/json" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "ETag" : "W/\"datetime'2020-06-30T15%3A21%3A40.4942574Z'\"", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "7871c00b-4002-0040-04f2-4e52c5000000", + "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", + "x-ms-client-request-id" : "7df00b09-038b-471a-84f2-23b559508806" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "9179fcf5-396f-4ae6-8ab4-152675c1d9b9" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "f81e6ab0-7002-0064-62f2-4ea465000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"testkgmycpvdeispzzoi\"}]}", + "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", + "x-ms-client-request-id" : "9179fcf5-396f-4ae6-8ab4-152675c1d9b9", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('testkgmycpvdeispzzoi')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "6006572e-781b-4d5b-938d-917e77279b5e" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "dd939a16-6002-009c-07f2-4ef89b000000", + "Date" : "Tue, 30 Jun 2020 15:21:40 GMT", + "x-ms-client-request-id" : "6006572e-781b-4d5b-938d-917e77279b5e" + }, + "Exception" : null + } ], + "variables" : [ "bbca0946-7a3d-4030-852d-f6a69f5e6b16", "7df00b09-038b-471a-84f2-23b559508806", "24cd9b36-e1d1-413c-9957-82b2092afa61", "6006572e-781b-4d5b-938d-917e77279b5e" ] +} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/mergeNonExistentEntity.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/mergeNonExistentEntity.json new file mode 100644 index 000000000000..e1c1a8f86ab6 --- /dev/null +++ b/sdk/tables/azure-data-tables/src/test/resources/session-records/mergeNonExistentEntity.json @@ -0,0 +1,94 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "b571dc28-7958-4ec9-8058-544b5b1dccb5", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "dd9399e0-6002-009c-63f2-4ef89b000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"testjwoxmfzjxzhnrdgv\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "b571dc28-7958-4ec9-8058-544b5b1dccb5", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/Tables('testjwoxmfzjxzhnrdgv')" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.table.core.windows.net/testjwoxmfzjxzhnrdgv(PartitionKey='partitionKeyxjyscozh',RowKey='rowKeyudbwngdtspgeoa')?timeout=5000", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "303e1c33-cc7e-403a-9981-a3b2ab16a5c1", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "404", + "x-ms-request-id" : "f81e6a63-7002-0064-26f2-4ea465000000", + "Body" : "{\"odata.error\":{\"code\":\"ResourceNotFound\",\"message\":{\"lang\":\"en-US\",\"value\":\"The specified resource does not exist.\\nRequestId:f81e6a63-7002-0064-26f2-4ea465000000\\nTime:2020-06-30T15:21:39.4892428Z\"}}}", + "Date" : "Tue, 30 Jun 2020 15:21:38 GMT", + "x-ms-client-request-id" : "303e1c33-cc7e-403a-9981-a3b2ab16a5c1", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "c728e3ba-4188-40d4-9b85-a55a8e3f4c6a" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "dd9399e2-6002-009c-64f2-4ef89b000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"testjwoxmfzjxzhnrdgv\"}]}", + "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", + "x-ms-client-request-id" : "c728e3ba-4188-40d4-9b85-a55a8e3f4c6a", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('testjwoxmfzjxzhnrdgv')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "ac3e9ac0-9c10-4ab2-a548-e2d8de3e5ce7" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "f81e6a68-7002-0064-2af2-4ea465000000", + "Date" : "Tue, 30 Jun 2020 15:21:38 GMT", + "x-ms-client-request-id" : "ac3e9ac0-9c10-4ab2-a548-e2d8de3e5ce7" + }, + "Exception" : null + } ], + "variables" : [ "b571dc28-7958-4ec9-8058-544b5b1dccb5", "303e1c33-cc7e-403a-9981-a3b2ab16a5c1", "ac3e9ac0-9c10-4ab2-a548-e2d8de3e5ce7" ] +} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntitiesWithPartitionAndRowKey.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntitiesWithPartitionAndRowKey.json new file mode 100644 index 000000000000..43c56e91948d --- /dev/null +++ b/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntitiesWithPartitionAndRowKey.json @@ -0,0 +1,120 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "cb250844-6d64-42f2-9328-510c1fbfe645", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Tue, 30 Jun 2020 15:21:40 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "dd939a32-6002-009c-21f2-4ef89b000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"testuggnftptjovuvqnk\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "cb250844-6d64-42f2-9328-510c1fbfe645", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/Tables('testuggnftptjovuvqnk')" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/testuggnftptjovuvqnk?timeout=5000", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "94d8bac3-b45b-45d8-95f2-ee00254517a1", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Tue, 30 Jun 2020 15:21:40 GMT", + "Cache-Control" : "no-cache", + "ETag" : "W/\"datetime'2020-06-30T15%3A21%3A41.1234429Z'\"", + "x-ms-request-id" : "7871c01a-4002-0040-0df2-4e52c5000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#testuggnftptjovuvqnk/@Element\",\"odata.etag\":\"W/\\\"datetime'2020-06-30T15%3A21%3A41.1234429Z'\\\"\",\"PartitionKey\":\"partitionKeyjyjiyghm\",\"RowKey\":\"rowKeylinamqijseceja\",\"Timestamp\":\"2020-06-30T15:21:41.1234429Z\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "94d8bac3-b45b-45d8-95f2-ee00254517a1", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/testuggnftptjovuvqnk(PartitionKey='partitionKeyjyjiyghm',RowKey='rowKeylinamqijseceja')" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/testuggnftptjovuvqnk(PartitionKey='partitionKeyjyjiyghm',RowKey='rowKeylinamqijseceja')?timeout=5000&$format=application/json%3Bodata%3Dfullmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "23a5ee33-28a1-4bc1-80b3-c289ca57865e" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Tue, 30 Jun 2020 15:21:40 GMT", + "Cache-Control" : "no-cache", + "ETag" : "W/\"datetime'2020-06-30T15%3A21%3A41.1234429Z'\"", + "x-ms-request-id" : "f81e6ada-7002-0064-04f2-4ea465000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#testuggnftptjovuvqnk/@Element\",\"odata.type\":\"telboytrial.testuggnftptjovuvqnk\",\"odata.id\":\"https://telboytrial.table.core.windows.net/testuggnftptjovuvqnk(PartitionKey='partitionKeyjyjiyghm',RowKey='rowKeylinamqijseceja')\",\"odata.etag\":\"W/\\\"datetime'2020-06-30T15%3A21%3A41.1234429Z'\\\"\",\"odata.editLink\":\"testuggnftptjovuvqnk(PartitionKey='partitionKeyjyjiyghm',RowKey='rowKeylinamqijseceja')\",\"PartitionKey\":\"partitionKeyjyjiyghm\",\"RowKey\":\"rowKeylinamqijseceja\",\"Timestamp@odata.type\":\"Edm.DateTime\",\"Timestamp\":\"2020-06-30T15:21:41.1234429Z\"}", + "x-ms-client-request-id" : "23a5ee33-28a1-4bc1-80b3-c289ca57865e", + "Content-Type" : "application/json;odata=fullmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "70e5368d-fe24-4645-a723-1a2f52808d29" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "dd939a3a-6002-009c-28f2-4ef89b000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"testuggnftptjovuvqnk\"}]}", + "Date" : "Tue, 30 Jun 2020 15:21:40 GMT", + "x-ms-client-request-id" : "70e5368d-fe24-4645-a723-1a2f52808d29", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('testuggnftptjovuvqnk')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "6b491e8b-9b1a-4fdd-aa01-e9f98083d659" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "7871c01c-4002-0040-0ef2-4e52c5000000", + "Date" : "Tue, 30 Jun 2020 15:21:40 GMT", + "x-ms-client-request-id" : "6b491e8b-9b1a-4fdd-aa01-e9f98083d659" + }, + "Exception" : null + } ], + "variables" : [ "cb250844-6d64-42f2-9328-510c1fbfe645", "94d8bac3-b45b-45d8-95f2-ee00254517a1", "6b491e8b-9b1a-4fdd-aa01-e9f98083d659" ] +} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntity.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntity.json new file mode 100644 index 000000000000..754292673692 --- /dev/null +++ b/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntity.json @@ -0,0 +1,145 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "17460e58-df53-425d-93ae-782c33fb27de", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Tue, 30 Jun 2020 15:21:37 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "f81e6a2b-7002-0064-7ef2-4ea465000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"testekinbhdozbtfzsid\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "17460e58-df53-425d-93ae-782c33fb27de", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/Tables('testekinbhdozbtfzsid')" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/testekinbhdozbtfzsid?timeout=5000", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "a38d0042-0dfe-497d-9b68-e8bf8ca22c1e", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Tue, 30 Jun 2020 15:21:38 GMT", + "Cache-Control" : "no-cache", + "ETag" : "W/\"datetime'2020-06-30T15%3A21%3A38.6214799Z'\"", + "x-ms-request-id" : "dd93999e-6002-009c-33f2-4ef89b000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#testekinbhdozbtfzsid/@Element\",\"odata.etag\":\"W/\\\"datetime'2020-06-30T15%3A21%3A38.6214799Z'\\\"\",\"PartitionKey\":\"partitionKeyAvsomide\",\"RowKey\":\"rowKeyAyxobcngkuwggr\",\"Timestamp\":\"2020-06-30T15:21:38.6214799Z\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "a38d0042-0dfe-497d-9b68-e8bf8ca22c1e", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/testekinbhdozbtfzsid(PartitionKey='partitionKeyAvsomide',RowKey='rowKeyAyxobcngkuwggr')" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/testekinbhdozbtfzsid?timeout=5000", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "8505e17a-d9ba-4312-a1ff-ca8884c8dd6f", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Tue, 30 Jun 2020 15:21:37 GMT", + "Cache-Control" : "no-cache", + "ETag" : "W/\"datetime'2020-06-30T15%3A21%3A38.6566536Z'\"", + "x-ms-request-id" : "f81e6a2f-7002-0064-01f2-4ea465000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#testekinbhdozbtfzsid/@Element\",\"odata.etag\":\"W/\\\"datetime'2020-06-30T15%3A21%3A38.6566536Z'\\\"\",\"PartitionKey\":\"partitionKeyBzfhknxd\",\"RowKey\":\"rowKeyBznxlvckywxthl\",\"Timestamp\":\"2020-06-30T15:21:38.6566536Z\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "8505e17a-d9ba-4312-a1ff-ca8884c8dd6f", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/testekinbhdozbtfzsid(PartitionKey='partitionKeyBzfhknxd',RowKey='rowKeyBznxlvckywxthl')" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/testekinbhdozbtfzsid()?timeout=5000&$format=application/json%3Bodata%3Dfullmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "633e4104-0fb1-4fd6-8ca2-b533b96eef1b" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "dd9399a5-6002-009c-37f2-4ef89b000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#testekinbhdozbtfzsid\",\"value\":[{\"odata.type\":\"telboytrial.testekinbhdozbtfzsid\",\"odata.id\":\"https://telboytrial.table.core.windows.net/testekinbhdozbtfzsid(PartitionKey='partitionKeyAvsomide',RowKey='rowKeyAyxobcngkuwggr')\",\"odata.etag\":\"W/\\\"datetime'2020-06-30T15%3A21%3A38.6214799Z'\\\"\",\"odata.editLink\":\"testekinbhdozbtfzsid(PartitionKey='partitionKeyAvsomide',RowKey='rowKeyAyxobcngkuwggr')\",\"PartitionKey\":\"partitionKeyAvsomide\",\"RowKey\":\"rowKeyAyxobcngkuwggr\",\"Timestamp@odata.type\":\"Edm.DateTime\",\"Timestamp\":\"2020-06-30T15:21:38.6214799Z\"},{\"odata.type\":\"telboytrial.testekinbhdozbtfzsid\",\"odata.id\":\"https://telboytrial.table.core.windows.net/testekinbhdozbtfzsid(PartitionKey='partitionKeyBzfhknxd',RowKey='rowKeyBznxlvckywxthl')\",\"odata.etag\":\"W/\\\"datetime'2020-06-30T15%3A21%3A38.6566536Z'\\\"\",\"odata.editLink\":\"testekinbhdozbtfzsid(PartitionKey='partitionKeyBzfhknxd',RowKey='rowKeyBznxlvckywxthl')\",\"PartitionKey\":\"partitionKeyBzfhknxd\",\"RowKey\":\"rowKeyBznxlvckywxthl\",\"Timestamp@odata.type\":\"Edm.DateTime\",\"Timestamp\":\"2020-06-30T15:21:38.6566536Z\"}]}", + "Date" : "Tue, 30 Jun 2020 15:21:38 GMT", + "x-ms-client-request-id" : "633e4104-0fb1-4fd6-8ca2-b533b96eef1b", + "Content-Type" : "application/json;odata=fullmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "244b2c30-dbfe-4b02-b0e0-d9931e3bea83" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "f81e6a38-7002-0064-06f2-4ea465000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"testekinbhdozbtfzsid\"}]}", + "Date" : "Tue, 30 Jun 2020 15:21:38 GMT", + "x-ms-client-request-id" : "244b2c30-dbfe-4b02-b0e0-d9931e3bea83", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('testekinbhdozbtfzsid')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "009de9fd-51b6-40d3-9db3-d90be56b0ec8" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "dd9399a8-6002-009c-39f2-4ef89b000000", + "Date" : "Tue, 30 Jun 2020 15:21:38 GMT", + "x-ms-client-request-id" : "009de9fd-51b6-40d3-9db3-d90be56b0ec8" + }, + "Exception" : null + } ], + "variables" : [ "633e4104-0fb1-4fd6-8ca2-b533b96eef1b", "17460e58-df53-425d-93ae-782c33fb27de", "a38d0042-0dfe-497d-9b68-e8bf8ca22c1e", "8505e17a-d9ba-4312-a1ff-ca8884c8dd6f", "009de9fd-51b6-40d3-9db3-d90be56b0ec8" ] +} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntityWithFilter.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntityWithFilter.json new file mode 100644 index 000000000000..03a3750571b1 --- /dev/null +++ b/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntityWithFilter.json @@ -0,0 +1,119 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "7062c289-2f07-4894-8c79-fb0a4d54b453", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Tue, 30 Jun 2020 15:21:37 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "f81e6a1e-7002-0064-77f2-4ea465000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"testqxgsptkutubbqwzz\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "7062c289-2f07-4894-8c79-fb0a4d54b453", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/Tables('testqxgsptkutubbqwzz')" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/testqxgsptkutubbqwzz?timeout=5000", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "e1f9f334-b7b8-48ba-935b-c781d576919e", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Tue, 30 Jun 2020 15:21:37 GMT", + "Cache-Control" : "no-cache", + "ETag" : "W/\"datetime'2020-06-30T15%3A21%3A38.1963293Z'\"", + "x-ms-request-id" : "f81e6a25-7002-0064-7af2-4ea465000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#testqxgsptkutubbqwzz/@Element\",\"odata.etag\":\"W/\\\"datetime'2020-06-30T15%3A21%3A38.1963293Z'\\\"\",\"PartitionKey\":\"partitionKeyAczlzjyx\",\"RowKey\":\"rowKeyAcgwbtcvihpuul\",\"Timestamp\":\"2020-06-30T15:21:38.1963293Z\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "e1f9f334-b7b8-48ba-935b-c781d576919e", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/testqxgsptkutubbqwzz(PartitionKey='partitionKeyAczlzjyx',RowKey='rowKeyAcgwbtcvihpuul')" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/testqxgsptkutubbqwzz()?timeout=5000&$format=application/json%3Bodata%3Dfullmetadata&$select=PartitionKeyeqpartitionKeyAczlzjyx", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "83f1c6b9-1aa4-4b2d-8a8b-06cafd3fbe80" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "f81e6a29-7002-0064-7cf2-4ea465000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#testqxgsptkutubbqwzz&$select=PartitionKeyeqpartitionKeyAczlzjyx\",\"value\":[{\"odata.type\":\"telboytrial.testqxgsptkutubbqwzz\",\"odata.id\":\"https://telboytrial.table.core.windows.net/testqxgsptkutubbqwzz(PartitionKey='partitionKeyAczlzjyx',RowKey='rowKeyAcgwbtcvihpuul')\",\"odata.etag\":\"W/\\\"datetime'2020-06-30T15%3A21%3A38.1963293Z'\\\"\",\"odata.editLink\":\"testqxgsptkutubbqwzz(PartitionKey='partitionKeyAczlzjyx',RowKey='rowKeyAcgwbtcvihpuul')\",\"PartitionKeyeqpartitionKeyAczlzjyx\":null}]}", + "Date" : "Tue, 30 Jun 2020 15:21:37 GMT", + "x-ms-client-request-id" : "83f1c6b9-1aa4-4b2d-8a8b-06cafd3fbe80", + "Content-Type" : "application/json;odata=fullmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "af11f9a2-f872-415d-992d-c4ec94d045f1" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "f81e6a2a-7002-0064-7df2-4ea465000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"testqxgsptkutubbqwzz\"}]}", + "Date" : "Tue, 30 Jun 2020 15:21:37 GMT", + "x-ms-client-request-id" : "af11f9a2-f872-415d-992d-c4ec94d045f1", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('testqxgsptkutubbqwzz')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "4bab6212-c362-4875-89e2-3f2bd3e0c522" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "dd93999c-6002-009c-32f2-4ef89b000000", + "Date" : "Tue, 30 Jun 2020 15:21:38 GMT", + "x-ms-client-request-id" : "4bab6212-c362-4875-89e2-3f2bd3e0c522" + }, + "Exception" : null + } ], + "variables" : [ "83f1c6b9-1aa4-4b2d-8a8b-06cafd3fbe80", "7062c289-2f07-4894-8c79-fb0a4d54b453", "e1f9f334-b7b8-48ba-935b-c781d576919e", "4bab6212-c362-4875-89e2-3f2bd3e0c522" ] +} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntityWithSelect.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntityWithSelect.json new file mode 100644 index 000000000000..7960fc11cc2f --- /dev/null +++ b/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntityWithSelect.json @@ -0,0 +1,145 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "0c2db2c9-efdd-4781-9540-5bbf3700f063", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Tue, 30 Jun 2020 15:21:38 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "f81e6a40-7002-0064-0cf2-4ea465000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"testsueuobepkuwpyepu\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "0c2db2c9-efdd-4781-9540-5bbf3700f063", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/Tables('testsueuobepkuwpyepu')" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/testsueuobepkuwpyepu?timeout=5000", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "5f1e8a3d-b464-427a-b935-58dda6621b2c", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Tue, 30 Jun 2020 15:21:38 GMT", + "Cache-Control" : "no-cache", + "ETag" : "W/\"datetime'2020-06-30T15%3A21%3A38.8676538Z'\"", + "x-ms-request-id" : "dd9399b4-6002-009c-3ff2-4ef89b000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#testsueuobepkuwpyepu/@Element\",\"odata.etag\":\"W/\\\"datetime'2020-06-30T15%3A21%3A38.8676538Z'\\\"\",\"PartitionKey\":\"partitionKeyAhogytvv\",\"RowKey\":\"rowKeyAkwplvbfdfohjc\",\"Timestamp\":\"2020-06-30T15:21:38.8676538Z\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "5f1e8a3d-b464-427a-b935-58dda6621b2c", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/testsueuobepkuwpyepu(PartitionKey='partitionKeyAhogytvv',RowKey='rowKeyAkwplvbfdfohjc')" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/testsueuobepkuwpyepu?timeout=5000", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "64f85bc3-4862-4d9f-9b2e-43fc11ab2e33", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Tue, 30 Jun 2020 15:21:38 GMT", + "Cache-Control" : "no-cache", + "ETag" : "W/\"datetime'2020-06-30T15%3A21%3A38.8998254Z'\"", + "x-ms-request-id" : "f81e6a4b-7002-0064-12f2-4ea465000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#testsueuobepkuwpyepu/@Element\",\"odata.etag\":\"W/\\\"datetime'2020-06-30T15%3A21%3A38.8998254Z'\\\"\",\"PartitionKey\":\"partitionKeyBphkoxor\",\"RowKey\":\"rowKeyBrsjwoomrgjvkm\",\"Timestamp\":\"2020-06-30T15:21:38.8998254Z\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "64f85bc3-4862-4d9f-9b2e-43fc11ab2e33", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/testsueuobepkuwpyepu(PartitionKey='partitionKeyBphkoxor',RowKey='rowKeyBrsjwoomrgjvkm')" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/testsueuobepkuwpyepu()?timeout=5000&$format=application/json%3Bodata%3Dfullmetadata&$select=RowKey", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "8bf99390-03e6-4512-ac31-433c08741730" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "dd9399bc-6002-009c-44f2-4ef89b000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#testsueuobepkuwpyepu&$select=RowKey\",\"value\":[{\"odata.type\":\"telboytrial.testsueuobepkuwpyepu\",\"odata.id\":\"https://telboytrial.table.core.windows.net/testsueuobepkuwpyepu(PartitionKey='partitionKeyAhogytvv',RowKey='rowKeyAkwplvbfdfohjc')\",\"odata.etag\":\"W/\\\"datetime'2020-06-30T15%3A21%3A38.8676538Z'\\\"\",\"odata.editLink\":\"testsueuobepkuwpyepu(PartitionKey='partitionKeyAhogytvv',RowKey='rowKeyAkwplvbfdfohjc')\",\"RowKey\":\"rowKeyAkwplvbfdfohjc\"},{\"odata.type\":\"telboytrial.testsueuobepkuwpyepu\",\"odata.id\":\"https://telboytrial.table.core.windows.net/testsueuobepkuwpyepu(PartitionKey='partitionKeyBphkoxor',RowKey='rowKeyBrsjwoomrgjvkm')\",\"odata.etag\":\"W/\\\"datetime'2020-06-30T15%3A21%3A38.8998254Z'\\\"\",\"odata.editLink\":\"testsueuobepkuwpyepu(PartitionKey='partitionKeyBphkoxor',RowKey='rowKeyBrsjwoomrgjvkm')\",\"RowKey\":\"rowKeyBrsjwoomrgjvkm\"}]}", + "Date" : "Tue, 30 Jun 2020 15:21:38 GMT", + "x-ms-client-request-id" : "8bf99390-03e6-4512-ac31-433c08741730", + "Content-Type" : "application/json;odata=fullmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "18e89855-de03-4065-9e24-716903d700e3" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "f81e6a4d-7002-0064-14f2-4ea465000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"testsueuobepkuwpyepu\"}]}", + "Date" : "Tue, 30 Jun 2020 15:21:38 GMT", + "x-ms-client-request-id" : "18e89855-de03-4065-9e24-716903d700e3", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('testsueuobepkuwpyepu')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "3aac1600-4ac0-4e1f-b55a-d40ca4961541" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "dd9399c1-6002-009c-49f2-4ef89b000000", + "Date" : "Tue, 30 Jun 2020 15:21:38 GMT", + "x-ms-client-request-id" : "3aac1600-4ac0-4e1f-b55a-d40ca4961541" + }, + "Exception" : null + } ], + "variables" : [ "8bf99390-03e6-4512-ac31-433c08741730", "0c2db2c9-efdd-4781-9540-5bbf3700f063", "5f1e8a3d-b464-427a-b935-58dda6621b2c", "64f85bc3-4862-4d9f-9b2e-43fc11ab2e33", "3aac1600-4ac0-4e1f-b55a-d40ca4961541" ] +} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntityWithTop.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntityWithTop.json new file mode 100644 index 000000000000..18a1ce7dd3bd --- /dev/null +++ b/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntityWithTop.json @@ -0,0 +1,93 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "04a28429-10f6-4126-80ba-8d09aca4c812", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Tue, 30 Jun 2020 15:21:38 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "f81e6a53-7002-0064-18f2-4ea465000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"testmxtjvghrwlkrrjdh\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "04a28429-10f6-4126-80ba-8d09aca4c812", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/Tables('testmxtjvghrwlkrrjdh')" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/testmxtjvghrwlkrrjdh()?timeout=5000&$format=application/json%3Bodata%3Dfullmetadata&$top=0", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "981740a1-f9b2-4ccd-889e-74c715ebb3ae" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "dd9399d0-6002-009c-56f2-4ef89b000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#testmxtjvghrwlkrrjdh\",\"value\":[]}", + "Date" : "Tue, 30 Jun 2020 15:21:38 GMT", + "x-ms-client-request-id" : "981740a1-f9b2-4ccd-889e-74c715ebb3ae", + "Content-Type" : "application/json;odata=fullmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "b89cbe3e-4cb1-4222-99d6-c58ec4e9ac52" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "f81e6a55-7002-0064-19f2-4ea465000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"testmxtjvghrwlkrrjdh\"}]}", + "Date" : "Tue, 30 Jun 2020 15:21:38 GMT", + "x-ms-client-request-id" : "b89cbe3e-4cb1-4222-99d6-c58ec4e9ac52", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('testmxtjvghrwlkrrjdh')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "295e99d9-eee1-4a4a-8bf3-caa19c0c3e04" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "dd9399d8-6002-009c-5df2-4ef89b000000", + "Date" : "Tue, 30 Jun 2020 15:21:38 GMT", + "x-ms-client-request-id" : "295e99d9-eee1-4a4a-8bf3-caa19c0c3e04" + }, + "Exception" : null + } ], + "variables" : [ "981740a1-f9b2-4ccd-889e-74c715ebb3ae", "04a28429-10f6-4126-80ba-8d09aca4c812", "295e99d9-eee1-4a4a-8bf3-caa19c0c3e04" ] +} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/queryTable.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/queryTable.json new file mode 100644 index 000000000000..857a8a577c86 --- /dev/null +++ b/sdk/tables/azure-data-tables/src/test/resources/session-records/queryTable.json @@ -0,0 +1,138 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "c6d00896-20bd-4850-abc6-24ea502cad03", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "7871c010-4002-0040-06f2-4e52c5000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"AtestAbfyvouusdiuyws\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "c6d00896-20bd-4850-abc6-24ea502cad03", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/Tables('AtestAbfyvouusdiuyws')" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "41bec4dc-36ec-488e-af34-57efd0dfda80", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "f81e6abe-7002-0064-6ef2-4ea465000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"BtestBfvlkvxagqsruqg\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "41bec4dc-36ec-488e-af34-57efd0dfda80", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/Tables('BtestBfvlkvxagqsruqg')" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "059c6ad3-01de-485a-84a0-bba66b24ea98" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "dd939a1c-6002-009c-0df2-4ef89b000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"AtestAbfyvouusdiuyws\"},{\"TableName\":\"BtestBfvlkvxagqsruqg\"}]}", + "Date" : "Tue, 30 Jun 2020 15:21:40 GMT", + "x-ms-client-request-id" : "059c6ad3-01de-485a-84a0-bba66b24ea98", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "67b0be68-db4a-4f44-80d2-ecb8e24dcb5f" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "7871c015-4002-0040-09f2-4e52c5000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"AtestAbfyvouusdiuyws\"},{\"TableName\":\"BtestBfvlkvxagqsruqg\"}]}", + "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", + "x-ms-client-request-id" : "67b0be68-db4a-4f44-80d2-ecb8e24dcb5f", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('AtestAbfyvouusdiuyws')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "c573455e-db13-4746-8c39-ebfdfcf8743d" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "f81e6ac5-7002-0064-73f2-4ea465000000", + "Date" : "Tue, 30 Jun 2020 15:21:40 GMT", + "x-ms-client-request-id" : "c573455e-db13-4746-8c39-ebfdfcf8743d" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('BtestBfvlkvxagqsruqg')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "d0e960a0-e967-4b1b-b4cf-67163433f36b" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "dd939a21-6002-009c-12f2-4ef89b000000", + "Date" : "Tue, 30 Jun 2020 15:21:40 GMT", + "x-ms-client-request-id" : "d0e960a0-e967-4b1b-b4cf-67163433f36b" + }, + "Exception" : null + } ], + "variables" : [ "c6d00896-20bd-4850-abc6-24ea502cad03", "41bec4dc-36ec-488e-af34-57efd0dfda80", "059c6ad3-01de-485a-84a0-bba66b24ea98", "c573455e-db13-4746-8c39-ebfdfcf8743d", "d0e960a0-e967-4b1b-b4cf-67163433f36b" ] +} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/queryTablewithFilter.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/queryTablewithFilter.json new file mode 100644 index 000000000000..5521b007c6ac --- /dev/null +++ b/sdk/tables/azure-data-tables/src/test/resources/session-records/queryTablewithFilter.json @@ -0,0 +1,138 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "477e30c8-1abe-4bae-b743-dba6b2569188", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Tue, 30 Jun 2020 15:18:17 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "6ee47065-3002-005a-2ef1-4e331a000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"AtestAnuas\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "477e30c8-1abe-4bae-b743-dba6b2569188", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/Tables('AtestAnuas')" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "d7488934-28e1-44ca-92f0-5a214c0a6408", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Tue, 30 Jun 2020 15:18:17 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "6ee4706d-3002-005a-34f1-4e331a000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"BtestBctzf\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "d7488934-28e1-44ca-92f0-5a214c0a6408", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/Tables('BtestBctzf')" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata&$filter=TableNameeqAtestAnuas", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "758b764f-b537-44ff-a413-5fe6fb78a979" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "500", + "x-ms-request-id" : "6bd6d34a-f002-006a-69f1-4e8dd5000000", + "Body" : "{\"odata.error\":{\"code\":\"InternalError\",\"message\":{\"lang\":\"en-US\",\"value\":\"Server encountered an internal error. Please try again after some time.\\nRequestId:6bd6d34a-f002-006a-69f1-4e8dd5000000\\nTime:2020-06-30T15:18:23.8182034Z\"}}}", + "Date" : "Tue, 30 Jun 2020 15:18:23 GMT", + "x-ms-client-request-id" : "758b764f-b537-44ff-a413-5fe6fb78a979", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "66984cc5-9230-4324-9c39-62e52b442208" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "6bd6d34c-f002-006a-6af1-4e8dd5000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"AtestAnuas\"},{\"TableName\":\"BtestBctzf\"}]}", + "Date" : "Tue, 30 Jun 2020 15:18:23 GMT", + "x-ms-client-request-id" : "66984cc5-9230-4324-9c39-62e52b442208", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('AtestAnuas')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "27bab8cb-6f8b-4028-a3e8-086c3805d6b2" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "c405d3dc-c002-005e-7ef1-4ebe1d000000", + "Date" : "Tue, 30 Jun 2020 15:18:23 GMT", + "x-ms-client-request-id" : "27bab8cb-6f8b-4028-a3e8-086c3805d6b2" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('BtestBctzf')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "b9302467-fb88-4216-9179-3d35fc2c8a34" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "1833fbeb-5002-003e-4df1-4ec282000000", + "Date" : "Tue, 30 Jun 2020 15:18:23 GMT", + "x-ms-client-request-id" : "b9302467-fb88-4216-9179-3d35fc2c8a34" + }, + "Exception" : null + } ], + "variables" : [ "477e30c8-1abe-4bae-b743-dba6b2569188", "d7488934-28e1-44ca-92f0-5a214c0a6408", "758b764f-b537-44ff-a413-5fe6fb78a979", "27bab8cb-6f8b-4028-a3e8-086c3805d6b2", "b9302467-fb88-4216-9179-3d35fc2c8a34" ] +} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/queryTablewithTop.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/queryTablewithTop.json new file mode 100644 index 000000000000..634f5b654315 --- /dev/null +++ b/sdk/tables/azure-data-tables/src/test/resources/session-records/queryTablewithTop.json @@ -0,0 +1,139 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "0d048324-ba35-4459-8272-ce0d26ec9d00", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "dd9399f6-6002-009c-6ef2-4ef89b000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"AtestAitxqzgncwbmmbe\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "0d048324-ba35-4459-8272-ce0d26ec9d00", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/Tables('AtestAitxqzgncwbmmbe')" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "003f2aa3-1837-44f1-9c71-09c3ca29adc9", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "f81e6a8c-7002-0064-43f2-4ea465000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"BtestBfnmxxltfwitwgn\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "003f2aa3-1837-44f1-9c71-09c3ca29adc9", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/Tables('BtestBfnmxxltfwitwgn')" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata&$top=1", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "efc7cc3e-8291-4025-aeff-987dd3942f36" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", + "x-ms-continuation-NextTableName" : "1!52!YnRlc3RiZm5teHhsdGZ3aXR3Z24BMDFkNjRlZjIyNzMxODE4MA--", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "dd9399fb-6002-009c-70f2-4ef89b000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"AtestAitxqzgncwbmmbe\"}]}", + "x-ms-client-request-id" : "efc7cc3e-8291-4025-aeff-987dd3942f36", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "d2c312e5-c632-494d-a135-3f9d5aca08eb" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "f81e6a96-7002-0064-4bf2-4ea465000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"AtestAitxqzgncwbmmbe\"},{\"TableName\":\"BtestBfnmxxltfwitwgn\"}]}", + "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", + "x-ms-client-request-id" : "d2c312e5-c632-494d-a135-3f9d5aca08eb", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('AtestAitxqzgncwbmmbe')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "1d185bb4-4b9f-4ed4-bb99-ac074d2a1768" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "dd9399fc-6002-009c-71f2-4ef89b000000", + "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", + "x-ms-client-request-id" : "1d185bb4-4b9f-4ed4-bb99-ac074d2a1768" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('BtestBfnmxxltfwitwgn')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "43fcaf52-2fd2-49bf-bf2f-f7dd97c352ec" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "7871c004-4002-0040-80f2-4e52c5000000", + "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", + "x-ms-client-request-id" : "43fcaf52-2fd2-49bf-bf2f-f7dd97c352ec" + }, + "Exception" : null + } ], + "variables" : [ "0d048324-ba35-4459-8272-ce0d26ec9d00", "003f2aa3-1837-44f1-9c71-09c3ca29adc9", "efc7cc3e-8291-4025-aeff-987dd3942f36", "1d185bb4-4b9f-4ed4-bb99-ac074d2a1768", "43fcaf52-2fd2-49bf-bf2f-f7dd97c352ec" ] +} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/updateEntity.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/updateEntity.json new file mode 100644 index 000000000000..492ad6b101dc --- /dev/null +++ b/sdk/tables/azure-data-tables/src/test/resources/session-records/updateEntity.json @@ -0,0 +1,119 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "17609dbf-8673-477a-9bc5-b0aef03fa5b9", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Tue, 30 Jun 2020 15:21:38 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "f81e6a58-7002-0064-1cf2-4ea465000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"testijxolgpvwkvgfphw\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "17609dbf-8673-477a-9bc5-b0aef03fa5b9", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/Tables('testijxolgpvwkvgfphw')" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/testijxolgpvwkvgfphw?timeout=5000", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "d2852673-f5e3-4291-9a98-583e28cda3cd", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", + "Cache-Control" : "no-cache", + "ETag" : "W/\"datetime'2020-06-30T15%3A21%3A39.2729391Z'\"", + "x-ms-request-id" : "dd9399db-6002-009c-60f2-4ef89b000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#testijxolgpvwkvgfphw/@Element\",\"odata.etag\":\"W/\\\"datetime'2020-06-30T15%3A21%3A39.2729391Z'\\\"\",\"PartitionKey\":\"partitionKeyumurcyhy\",\"RowKey\":\"rowKeyahyhofvdufantu\",\"Timestamp\":\"2020-06-30T15:21:39.2729391Z\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "d2852673-f5e3-4291-9a98-583e28cda3cd", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/testijxolgpvwkvgfphw(PartitionKey='partitionKeyumurcyhy',RowKey='rowKeyahyhofvdufantu')" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.table.core.windows.net/testijxolgpvwkvgfphw(PartitionKey='partitionKeyumurcyhy',RowKey='rowKeyahyhofvdufantu')?timeout=5000", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "69ae1c26-0d34-4e6e-a105-eadae5d83b6a", + "Content-Type" : "application/json" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "ETag" : "W/\"datetime'2020-06-30T15%3A21%3A39.3154238Z'\"", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "f81e6a5b-7002-0064-1ef2-4ea465000000", + "Date" : "Tue, 30 Jun 2020 15:21:38 GMT", + "x-ms-client-request-id" : "69ae1c26-0d34-4e6e-a105-eadae5d83b6a" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "73074649-aa7e-40df-a47e-7f7f32f408df" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "dd9399df-6002-009c-62f2-4ef89b000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"testijxolgpvwkvgfphw\"}]}", + "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", + "x-ms-client-request-id" : "73074649-aa7e-40df-a47e-7f7f32f408df", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('testijxolgpvwkvgfphw')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "d7fcb15d-8c02-45bc-8836-124607aa349d" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "f81e6a5f-7002-0064-22f2-4ea465000000", + "Date" : "Tue, 30 Jun 2020 15:21:38 GMT", + "x-ms-client-request-id" : "d7fcb15d-8c02-45bc-8836-124607aa349d" + }, + "Exception" : null + } ], + "variables" : [ "17609dbf-8673-477a-9bc5-b0aef03fa5b9", "69ae1c26-0d34-4e6e-a105-eadae5d83b6a", "d2852673-f5e3-4291-9a98-583e28cda3cd", "d7fcb15d-8c02-45bc-8836-124607aa349d" ] +} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/updateNonExistentEntity.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/updateNonExistentEntity.json new file mode 100644 index 000000000000..8a1807c68938 --- /dev/null +++ b/sdk/tables/azure-data-tables/src/test/resources/session-records/updateNonExistentEntity.json @@ -0,0 +1,94 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "b291239a-a4ae-4d0e-9487-94eef9400f40", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Tue, 30 Jun 2020 15:21:40 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "f81e6acf-7002-0064-7cf2-4ea465000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"testclusawuoexlptiey\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "b291239a-a4ae-4d0e-9487-94eef9400f40", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/Tables('testclusawuoexlptiey')" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.table.core.windows.net/testclusawuoexlptiey(PartitionKey='partitionKeywmdlgnpu',RowKey='rowKeydedsxyaifawnbi')?timeout=5000", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "95e5f69a-242d-4e6d-85e6-d66f2cb4e1e8", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "404", + "x-ms-request-id" : "dd939a2d-6002-009c-1df2-4ef89b000000", + "Body" : "{\"odata.error\":{\"code\":\"ResourceNotFound\",\"message\":{\"lang\":\"en-US\",\"value\":\"The specified resource does not exist.\\nRequestId:dd939a2d-6002-009c-1df2-4ef89b000000\\nTime:2020-06-30T15:21:40.9761373Z\"}}}", + "Date" : "Tue, 30 Jun 2020 15:21:40 GMT", + "x-ms-client-request-id" : "95e5f69a-242d-4e6d-85e6-d66f2cb4e1e8", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "94ea0bb5-d8aa-44f4-8cf3-a786b298bd58" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "7871c019-4002-0040-0cf2-4e52c5000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"testclusawuoexlptiey\"}]}", + "Date" : "Tue, 30 Jun 2020 15:21:40 GMT", + "x-ms-client-request-id" : "94ea0bb5-d8aa-44f4-8cf3-a786b298bd58", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('testclusawuoexlptiey')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "7c9d5516-7a63-44c4-8334-91268fd431b5" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "f81e6ad2-7002-0064-7ef2-4ea465000000", + "Date" : "Tue, 30 Jun 2020 15:21:40 GMT", + "x-ms-client-request-id" : "7c9d5516-7a63-44c4-8334-91268fd431b5" + }, + "Exception" : null + } ], + "variables" : [ "b291239a-a4ae-4d0e-9487-94eef9400f40", "95e5f69a-242d-4e6d-85e6-d66f2cb4e1e8", "7c9d5516-7a63-44c4-8334-91268fd431b5" ] +} \ No newline at end of file From 7133df8f93b09eaf4516358afe576aaf4b0cafaa Mon Sep 17 00:00:00 2001 From: Eleanor Boyd Date: Tue, 30 Jun 2020 15:19:14 -0400 Subject: [PATCH 16/33] recent changes --- .../azure/data/tables/AzureTableImplTest.java | 4 +- .../session-records/createTable.json | 71 ------------------- 2 files changed, 2 insertions(+), 73 deletions(-) delete mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/createTable.json diff --git a/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java b/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java index 1b3e257e8498..1d87117b4121 100644 --- a/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java +++ b/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java @@ -40,7 +40,7 @@ public class AzureTableImplTest extends TestBase { protected void beforeTest() { super.beforeTest(); String connectionString = interceptorManager.isPlaybackMode() - ? "DefaultEndpointsProtocol=https;=AccountName=dummyAccount;AccountKey=xyzDummy;EndpointSuffix=core.windows.net" + ? "DefaultEndpointsProtocol=https;AccountName=dummyAccount;AccountKey=xyzDummy==;EndpointSuffix=core.windows.net" : System.getenv("AZURE_TABLES_CONNECTION_STRING"); StorageConnectionString storageConnectionString = StorageConnectionString.create(connectionString, new ClientLogger(AzureTableImplTest.class)); @@ -119,7 +119,7 @@ String randomCharOnlyName(String prefix, int length) { @Test void createTable() { // Arrange - String tableName = randomCharOnlyName("test", 20); + String tableName = "tableA"; // randomCharOnlyName("test", 20); TableProperties tableProperties = new TableProperties().setTableName(tableName); int expectedStatusCode = 201; String requestId = testResourceNamer.randomUuid(); diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/createTable.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/createTable.json deleted file mode 100644 index 15baea5204e5..000000000000 --- a/sdk/tables/azure-data-tables/src/test/resources/session-records/createTable.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "POST", - "Uri" : "https://REDACTED.table.core.windows.net/Tables", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "5437f69b-e1b0-4bd0-9126-a05cbc8b751a", - "Content-Type" : "application/json" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "201", - "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", - "Cache-Control" : "no-cache", - "x-ms-request-id" : "f81e6aa0-7002-0064-54f2-4ea465000000", - "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"testeszhrzmnluonrsdu\"}", - "Preference-Applied" : "return-content", - "x-ms-client-request-id" : "5437f69b-e1b0-4bd0-9126-a05cbc8b751a", - "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", - "Location" : "https://telboytrial.table.core.windows.net/Tables('testeszhrzmnluonrsdu')" - }, - "Exception" : null - }, { - "Method" : "GET", - "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "020dead4-ce43-4f67-acb5-c50773d82d23" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "200", - "x-ms-request-id" : "dd939a01-6002-009c-75f2-4ef89b000000", - "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"testeszhrzmnluonrsdu\"}]}", - "Date" : "Tue, 30 Jun 2020 15:21:40 GMT", - "x-ms-client-request-id" : "020dead4-ce43-4f67-acb5-c50773d82d23", - "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" - }, - "Exception" : null - }, { - "Method" : "DELETE", - "Uri" : "https://REDACTED.table.core.windows.net/Tables('testeszhrzmnluonrsdu')", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "6599ac78-0e91-45fb-8f9e-b633aa823be2" - }, - "Response" : { - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "7871c00a-4002-0040-03f2-4e52c5000000", - "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", - "x-ms-client-request-id" : "6599ac78-0e91-45fb-8f9e-b633aa823be2" - }, - "Exception" : null - } ], - "variables" : [ "5437f69b-e1b0-4bd0-9126-a05cbc8b751a", "6599ac78-0e91-45fb-8f9e-b633aa823be2" ] -} \ No newline at end of file From 228156326b252966c73e54c7a060c00919aedc1c Mon Sep 17 00:00:00 2001 From: Eleanor Boyd Date: Wed, 1 Jul 2020 08:32:58 -0400 Subject: [PATCH 17/33] fix pom --- sdk/tables/azure-data-tables/pom.xml | 8 +- .../azure/data/tables/AzureTableImplTest.java | 6 +- .../createTableDuplicateName.json | 95 ------------ .../session-records/deleteEntity.json | 117 -------------- .../deleteNonExistentEntity.json | 93 ----------- .../deleteNonExistentTable.json | 48 ------ .../session-records/deleteTable.json | 71 --------- .../session-records/insertNoEtag.json | 97 ------------ .../session-records/mergeEntity.json | 119 -------------- .../mergeNonExistentEntity.json | 94 ------------ .../queryEntitiesWithPartitionAndRowKey.json | 120 --------------- .../session-records/queryEntity.json | 145 ------------------ .../queryEntityWithFilter.json | 119 -------------- .../queryEntityWithSelect.json | 145 ------------------ .../session-records/queryEntityWithTop.json | 93 ----------- .../resources/session-records/queryTable.json | 138 ----------------- .../session-records/queryTablewithFilter.json | 138 ----------------- .../session-records/queryTablewithTop.json | 139 ----------------- .../session-records/updateEntity.json | 119 -------------- .../updateNonExistentEntity.json | 94 ------------ 20 files changed, 7 insertions(+), 1991 deletions(-) delete mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/createTableDuplicateName.json delete mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/deleteEntity.json delete mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/deleteNonExistentEntity.json delete mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/deleteNonExistentTable.json delete mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/deleteTable.json delete mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/insertNoEtag.json delete mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/mergeEntity.json delete mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/mergeNonExistentEntity.json delete mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntitiesWithPartitionAndRowKey.json delete mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntity.json delete mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntityWithFilter.json delete mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntityWithSelect.json delete mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntityWithTop.json delete mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/queryTable.json delete mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/queryTablewithFilter.json delete mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/queryTablewithTop.json delete mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/updateEntity.json delete mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/updateNonExistentEntity.json diff --git a/sdk/tables/azure-data-tables/pom.xml b/sdk/tables/azure-data-tables/pom.xml index dff0ee5f8a90..8ad37d736c40 100644 --- a/sdk/tables/azure-data-tables/pom.xml +++ b/sdk/tables/azure-data-tables/pom.xml @@ -50,14 +50,14 @@ Licensed under the MIT License. org.junit.jupiter - junit-jupiter - RELEASE + junit-jupiter + RELEASE test io.projectreactor - reactor-test - 3.3.5.RELEASE + reactor-test + 3.3.5.RELEASE test diff --git a/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java b/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java index 1d87117b4121..8ce11499530b 100644 --- a/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java +++ b/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java @@ -40,7 +40,7 @@ public class AzureTableImplTest extends TestBase { protected void beforeTest() { super.beforeTest(); String connectionString = interceptorManager.isPlaybackMode() - ? "DefaultEndpointsProtocol=https;AccountName=dummyAccount;AccountKey=xyzDummy==;EndpointSuffix=core.windows.net" + ? "DefaultEndpointsProtocol=https;AccountName=dummyAccount;AccountKey=xyzDummy;EndpointSuffix=core.windows.net" : System.getenv("AZURE_TABLES_CONNECTION_STRING"); StorageConnectionString storageConnectionString = StorageConnectionString.create(connectionString, new ClientLogger(AzureTableImplTest.class)); @@ -80,7 +80,7 @@ protected void afterTest() { QueryOptions queryOptions = new QueryOptions() .setFormat(OdataMetadataFormat.APPLICATION_JSON_ODATA_MINIMALMETADATA); - Mono.when(azureTable.getTables().queryWithResponseAsync(UUID.randomUUID().toString(), null, + Mono.when(azureTable.getTables().queryWithResponseAsync(testResourceNamer.randomUuid(), null, queryOptions, Context.NONE).flatMapMany(tablesQueryResponse -> { return Flux.fromIterable(tablesQueryResponse.getValue().getValue()).flatMap(tableResponseProperty -> { return azureTable.getTables().deleteWithResponseAsync(tableResponseProperty.getTableName(), @@ -119,7 +119,7 @@ String randomCharOnlyName(String prefix, int length) { @Test void createTable() { // Arrange - String tableName = "tableA"; // randomCharOnlyName("test", 20); + String tableName = randomCharOnlyName("test", 20); TableProperties tableProperties = new TableProperties().setTableName(tableName); int expectedStatusCode = 201; String requestId = testResourceNamer.randomUuid(); diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/createTableDuplicateName.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/createTableDuplicateName.json deleted file mode 100644 index 082fed2fe7d3..000000000000 --- a/sdk/tables/azure-data-tables/src/test/resources/session-records/createTableDuplicateName.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "POST", - "Uri" : "https://REDACTED.table.core.windows.net/Tables", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "f144cd7d-6238-4467-825b-d1646a66bef6", - "Content-Type" : "application/json" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "201", - "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", - "Cache-Control" : "no-cache", - "x-ms-request-id" : "dd9399f3-6002-009c-6cf2-4ef89b000000", - "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"testxlkrkwkqgibisiks\"}", - "Preference-Applied" : "return-content", - "x-ms-client-request-id" : "f144cd7d-6238-4467-825b-d1646a66bef6", - "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", - "Location" : "https://telboytrial.table.core.windows.net/Tables('testxlkrkwkqgibisiks')" - }, - "Exception" : null - }, { - "Method" : "POST", - "Uri" : "https://REDACTED.table.core.windows.net/Tables", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "bdb27d04-1814-4c0b-8e42-7d6839d5f7aa", - "Content-Type" : "application/json" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "409", - "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", - "Cache-Control" : "no-cache", - "x-ms-request-id" : "f81e6a82-7002-0064-3cf2-4ea465000000", - "Body" : "{\"odata.error\":{\"code\":\"TableAlreadyExists\",\"message\":{\"lang\":\"en-US\",\"value\":\"The table specified already exists.\\nRequestId:f81e6a82-7002-0064-3cf2-4ea465000000\\nTime:2020-06-30T15:21:39.9155417Z\"}}}", - "Preference-Applied" : "return-content", - "x-ms-client-request-id" : "bdb27d04-1814-4c0b-8e42-7d6839d5f7aa", - "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" - }, - "Exception" : null - }, { - "Method" : "GET", - "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "57523d9f-22c9-4d94-aa60-44d2fca5c663" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "200", - "x-ms-request-id" : "dd9399f5-6002-009c-6df2-4ef89b000000", - "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"testxlkrkwkqgibisiks\"}]}", - "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", - "x-ms-client-request-id" : "57523d9f-22c9-4d94-aa60-44d2fca5c663", - "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" - }, - "Exception" : null - }, { - "Method" : "DELETE", - "Uri" : "https://REDACTED.table.core.windows.net/Tables('testxlkrkwkqgibisiks')", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "b6190095-cd61-4b60-afd9-6bad5edd0b1a" - }, - "Response" : { - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "f81e6a85-7002-0064-3ef2-4ea465000000", - "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", - "x-ms-client-request-id" : "b6190095-cd61-4b60-afd9-6bad5edd0b1a" - }, - "Exception" : null - } ], - "variables" : [ "f144cd7d-6238-4467-825b-d1646a66bef6", "bdb27d04-1814-4c0b-8e42-7d6839d5f7aa", "b6190095-cd61-4b60-afd9-6bad5edd0b1a" ] -} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/deleteEntity.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/deleteEntity.json deleted file mode 100644 index 8415183d4608..000000000000 --- a/sdk/tables/azure-data-tables/src/test/resources/session-records/deleteEntity.json +++ /dev/null @@ -1,117 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "POST", - "Uri" : "https://REDACTED.table.core.windows.net/Tables", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "8079d86a-4058-47ca-b527-0fbacbd7818c", - "Content-Type" : "application/json" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "201", - "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", - "Cache-Control" : "no-cache", - "x-ms-request-id" : "dd9399e6-6002-009c-66f2-4ef89b000000", - "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"testfktchjrzgypcdbng\"}", - "Preference-Applied" : "return-content", - "x-ms-client-request-id" : "8079d86a-4058-47ca-b527-0fbacbd7818c", - "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", - "Location" : "https://telboytrial.table.core.windows.net/Tables('testfktchjrzgypcdbng')" - }, - "Exception" : null - }, { - "Method" : "POST", - "Uri" : "https://REDACTED.table.core.windows.net/testfktchjrzgypcdbng?timeout=5000", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "fe643e48-f42f-4aa0-807a-97a7d0179660", - "Content-Type" : "application/json" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "201", - "Date" : "Tue, 30 Jun 2020 15:21:38 GMT", - "Cache-Control" : "no-cache", - "ETag" : "W/\"datetime'2020-06-30T15%3A21%3A39.6303407Z'\"", - "x-ms-request-id" : "f81e6a70-7002-0064-30f2-4ea465000000", - "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#testfktchjrzgypcdbng/@Element\",\"odata.etag\":\"W/\\\"datetime'2020-06-30T15%3A21%3A39.6303407Z'\\\"\",\"PartitionKey\":\"partitionKeyrxkdcvdo\",\"RowKey\":\"rowKeyopbrtellakatrv\",\"Timestamp\":\"2020-06-30T15:21:39.6303407Z\"}", - "Preference-Applied" : "return-content", - "x-ms-client-request-id" : "fe643e48-f42f-4aa0-807a-97a7d0179660", - "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", - "Location" : "https://telboytrial.table.core.windows.net/testfktchjrzgypcdbng(PartitionKey='partitionKeyrxkdcvdo',RowKey='rowKeyopbrtellakatrv')" - }, - "Exception" : null - }, { - "Method" : "DELETE", - "Uri" : "https://REDACTED.table.core.windows.net/testfktchjrzgypcdbng(PartitionKey='partitionKeyrxkdcvdo',RowKey='rowKeyopbrtellakatrv')?timeout=5000", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "6a9f0bba-06a0-4537-b99d-5b5af6a93c48" - }, - "Response" : { - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "dd9399e8-6002-009c-67f2-4ef89b000000", - "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", - "x-ms-client-request-id" : "6a9f0bba-06a0-4537-b99d-5b5af6a93c48" - }, - "Exception" : null - }, { - "Method" : "GET", - "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "1654fa5a-fedb-4933-8927-ae60f3bfcbf0" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "200", - "x-ms-request-id" : "f81e6a75-7002-0064-34f2-4ea465000000", - "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"testfktchjrzgypcdbng\"}]}", - "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", - "x-ms-client-request-id" : "1654fa5a-fedb-4933-8927-ae60f3bfcbf0", - "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" - }, - "Exception" : null - }, { - "Method" : "DELETE", - "Uri" : "https://REDACTED.table.core.windows.net/Tables('testfktchjrzgypcdbng')", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "10cd3f67-ee44-44bb-8ae6-51641ca1efb3" - }, - "Response" : { - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "dd9399eb-6002-009c-68f2-4ef89b000000", - "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", - "x-ms-client-request-id" : "10cd3f67-ee44-44bb-8ae6-51641ca1efb3" - }, - "Exception" : null - } ], - "variables" : [ "8079d86a-4058-47ca-b527-0fbacbd7818c", "6a9f0bba-06a0-4537-b99d-5b5af6a93c48", "fe643e48-f42f-4aa0-807a-97a7d0179660", "10cd3f67-ee44-44bb-8ae6-51641ca1efb3" ] -} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/deleteNonExistentEntity.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/deleteNonExistentEntity.json deleted file mode 100644 index 47693b582fef..000000000000 --- a/sdk/tables/azure-data-tables/src/test/resources/session-records/deleteNonExistentEntity.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "POST", - "Uri" : "https://REDACTED.table.core.windows.net/Tables", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "e067c687-238c-4721-bd78-b55edbf5917e", - "Content-Type" : "application/json" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "201", - "Date" : "Tue, 30 Jun 2020 15:21:40 GMT", - "Cache-Control" : "no-cache", - "x-ms-request-id" : "7871c020-4002-0040-10f2-4e52c5000000", - "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"testqmqjkkxvhaqntglh\"}", - "Preference-Applied" : "return-content", - "x-ms-client-request-id" : "e067c687-238c-4721-bd78-b55edbf5917e", - "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", - "Location" : "https://telboytrial.table.core.windows.net/Tables('testqmqjkkxvhaqntglh')" - }, - "Exception" : null - }, { - "Method" : "DELETE", - "Uri" : "https://REDACTED.table.core.windows.net/testqmqjkkxvhaqntglh(PartitionKey='partitionKeycnfrqgeq',RowKey='rowKeysaqehuaddxjcvw')?timeout=5000", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "06243cce-5e11-410c-9bab-a024d35f4955" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "404", - "x-ms-request-id" : "f81e6ae3-7002-0064-09f2-4ea465000000", - "Body" : "{\"odata.error\":{\"code\":\"ResourceNotFound\",\"message\":{\"lang\":\"en-US\",\"value\":\"The specified resource does not exist.\\nRequestId:f81e6ae3-7002-0064-09f2-4ea465000000\\nTime:2020-06-30T15:21:41.4186025Z\"}}}", - "Date" : "Tue, 30 Jun 2020 15:21:40 GMT", - "x-ms-client-request-id" : "06243cce-5e11-410c-9bab-a024d35f4955", - "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" - }, - "Exception" : null - }, { - "Method" : "GET", - "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "27805eb1-4017-4f58-a8b3-e16b5f733a51" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "200", - "x-ms-request-id" : "dd939a47-6002-009c-33f2-4ef89b000000", - "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"testqmqjkkxvhaqntglh\"}]}", - "Date" : "Tue, 30 Jun 2020 15:21:41 GMT", - "x-ms-client-request-id" : "27805eb1-4017-4f58-a8b3-e16b5f733a51", - "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" - }, - "Exception" : null - }, { - "Method" : "DELETE", - "Uri" : "https://REDACTED.table.core.windows.net/Tables('testqmqjkkxvhaqntglh')", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "98be0115-6a9e-406f-88f0-185eb476b203" - }, - "Response" : { - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "7871c022-4002-0040-11f2-4e52c5000000", - "Date" : "Tue, 30 Jun 2020 15:21:40 GMT", - "x-ms-client-request-id" : "98be0115-6a9e-406f-88f0-185eb476b203" - }, - "Exception" : null - } ], - "variables" : [ "e067c687-238c-4721-bd78-b55edbf5917e", "06243cce-5e11-410c-9bab-a024d35f4955", "98be0115-6a9e-406f-88f0-185eb476b203" ] -} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/deleteNonExistentTable.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/deleteNonExistentTable.json deleted file mode 100644 index d6f614ca8983..000000000000 --- a/sdk/tables/azure-data-tables/src/test/resources/session-records/deleteNonExistentTable.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "DELETE", - "Uri" : "https://REDACTED.table.core.windows.net/Tables('testygepqeuzwpizpjqk')", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "3b9bf4b5-cb3d-4519-8b3a-52514086d2b8" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "404", - "x-ms-request-id" : "f81e6ae0-7002-0064-06f2-4ea465000000", - "Body" : "{\"odata.error\":{\"code\":\"ResourceNotFound\",\"message\":{\"lang\":\"en-US\",\"value\":\"The specified resource does not exist.\\nRequestId:f81e6ae0-7002-0064-06f2-4ea465000000\\nTime:2020-06-30T15:21:41.3025206Z\"}}}", - "Date" : "Tue, 30 Jun 2020 15:21:40 GMT", - "x-ms-client-request-id" : "3b9bf4b5-cb3d-4519-8b3a-52514086d2b8", - "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" - }, - "Exception" : null - }, { - "Method" : "GET", - "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "93d5263f-8931-4a4c-bd7a-edada97b2556" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "200", - "x-ms-request-id" : "dd939a42-6002-009c-2ef2-4ef89b000000", - "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[]}", - "Date" : "Tue, 30 Jun 2020 15:21:41 GMT", - "x-ms-client-request-id" : "93d5263f-8931-4a4c-bd7a-edada97b2556", - "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" - }, - "Exception" : null - } ], - "variables" : [ "3b9bf4b5-cb3d-4519-8b3a-52514086d2b8" ] -} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/deleteTable.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/deleteTable.json deleted file mode 100644 index 28f596d761b3..000000000000 --- a/sdk/tables/azure-data-tables/src/test/resources/session-records/deleteTable.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "POST", - "Uri" : "https://REDACTED.table.core.windows.net/Tables", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "2b9eacd5-2f2e-4f99-a958-39a691b5d53f", - "Content-Type" : "application/json" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "201", - "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", - "Cache-Control" : "no-cache", - "x-ms-request-id" : "f81e6a78-7002-0064-37f2-4ea465000000", - "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"testrqmzwvgiibbpxbjw\"}", - "Preference-Applied" : "return-content", - "x-ms-client-request-id" : "2b9eacd5-2f2e-4f99-a958-39a691b5d53f", - "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", - "Location" : "https://telboytrial.table.core.windows.net/Tables('testrqmzwvgiibbpxbjw')" - }, - "Exception" : null - }, { - "Method" : "DELETE", - "Uri" : "https://REDACTED.table.core.windows.net/Tables('testrqmzwvgiibbpxbjw')", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "3159875c-8664-431a-b38c-13db7ae90827" - }, - "Response" : { - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "dd9399ec-6002-009c-69f2-4ef89b000000", - "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", - "x-ms-client-request-id" : "3159875c-8664-431a-b38c-13db7ae90827" - }, - "Exception" : null - }, { - "Method" : "GET", - "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "e7f5945b-d937-4e40-b199-da44d017a796" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "200", - "x-ms-request-id" : "f81e6a81-7002-0064-3bf2-4ea465000000", - "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[]}", - "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", - "x-ms-client-request-id" : "e7f5945b-d937-4e40-b199-da44d017a796", - "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" - }, - "Exception" : null - } ], - "variables" : [ "2b9eacd5-2f2e-4f99-a958-39a691b5d53f", "3159875c-8664-431a-b38c-13db7ae90827" ] -} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/insertNoEtag.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/insertNoEtag.json deleted file mode 100644 index 317935d44194..000000000000 --- a/sdk/tables/azure-data-tables/src/test/resources/session-records/insertNoEtag.json +++ /dev/null @@ -1,97 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "POST", - "Uri" : "https://REDACTED.table.core.windows.net/Tables", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "c1bd0540-6732-44fc-8227-288d6ac5b0ce", - "Content-Type" : "application/json" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "201", - "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", - "Cache-Control" : "no-cache", - "x-ms-request-id" : "7871c016-4002-0040-0af2-4e52c5000000", - "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"testkzypmilczquzckqs\"}", - "Preference-Applied" : "return-content", - "x-ms-client-request-id" : "c1bd0540-6732-44fc-8227-288d6ac5b0ce", - "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", - "Location" : "https://telboytrial.table.core.windows.net/Tables('testkzypmilczquzckqs')" - }, - "Exception" : null - }, { - "Method" : "POST", - "Uri" : "https://REDACTED.table.core.windows.net/testkzypmilczquzckqs?timeout=5000", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "049d3c67-1fbd-4958-8d50-f9e852ed244d", - "Content-Type" : "application/json" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "201", - "Date" : "Tue, 30 Jun 2020 15:21:40 GMT", - "Cache-Control" : "no-cache", - "ETag" : "W/\"datetime'2020-06-30T15%3A21%3A40.8241827Z'\"", - "x-ms-request-id" : "f81e6ac9-7002-0064-77f2-4ea465000000", - "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#testkzypmilczquzckqs/@Element\",\"odata.etag\":\"W/\\\"datetime'2020-06-30T15%3A21%3A40.8241827Z'\\\"\",\"PartitionKey\":\"partitionKeyuatahatv\",\"RowKey\":\"rowKeypeosnxbvjmbcrg\",\"Timestamp\":\"2020-06-30T15:21:40.8241827Z\"}", - "Preference-Applied" : "return-content", - "x-ms-client-request-id" : "049d3c67-1fbd-4958-8d50-f9e852ed244d", - "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", - "Location" : "https://telboytrial.table.core.windows.net/testkzypmilczquzckqs(PartitionKey='partitionKeyuatahatv',RowKey='rowKeypeosnxbvjmbcrg')" - }, - "Exception" : null - }, { - "Method" : "GET", - "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "f832e8cf-a0ad-490b-bf85-1c0547e4888c" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "200", - "x-ms-request-id" : "dd939a28-6002-009c-18f2-4ef89b000000", - "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"testkzypmilczquzckqs\"}]}", - "Date" : "Tue, 30 Jun 2020 15:21:40 GMT", - "x-ms-client-request-id" : "f832e8cf-a0ad-490b-bf85-1c0547e4888c", - "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" - }, - "Exception" : null - }, { - "Method" : "DELETE", - "Uri" : "https://REDACTED.table.core.windows.net/Tables('testkzypmilczquzckqs')", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "716efbea-e61b-4f42-96f1-1accfdced88f" - }, - "Response" : { - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "7871c018-4002-0040-0bf2-4e52c5000000", - "Date" : "Tue, 30 Jun 2020 15:21:40 GMT", - "x-ms-client-request-id" : "716efbea-e61b-4f42-96f1-1accfdced88f" - }, - "Exception" : null - } ], - "variables" : [ "c1bd0540-6732-44fc-8227-288d6ac5b0ce", "049d3c67-1fbd-4958-8d50-f9e852ed244d", "716efbea-e61b-4f42-96f1-1accfdced88f" ] -} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/mergeEntity.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/mergeEntity.json deleted file mode 100644 index cf5ead8ef46c..000000000000 --- a/sdk/tables/azure-data-tables/src/test/resources/session-records/mergeEntity.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "POST", - "Uri" : "https://REDACTED.table.core.windows.net/Tables", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "bbca0946-7a3d-4030-852d-f6a69f5e6b16", - "Content-Type" : "application/json" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "201", - "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", - "Cache-Control" : "no-cache", - "x-ms-request-id" : "f81e6aa7-7002-0064-5af2-4ea465000000", - "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"testkgmycpvdeispzzoi\"}", - "Preference-Applied" : "return-content", - "x-ms-client-request-id" : "bbca0946-7a3d-4030-852d-f6a69f5e6b16", - "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", - "Location" : "https://telboytrial.table.core.windows.net/Tables('testkgmycpvdeispzzoi')" - }, - "Exception" : null - }, { - "Method" : "POST", - "Uri" : "https://REDACTED.table.core.windows.net/testkgmycpvdeispzzoi?timeout=5000", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "24cd9b36-e1d1-413c-9957-82b2092afa61", - "Content-Type" : "application/json" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "201", - "Date" : "Tue, 30 Jun 2020 15:21:40 GMT", - "Cache-Control" : "no-cache", - "ETag" : "W/\"datetime'2020-06-30T15%3A21%3A40.4577739Z'\"", - "x-ms-request-id" : "dd939a08-6002-009c-7cf2-4ef89b000000", - "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#testkgmycpvdeispzzoi/@Element\",\"odata.etag\":\"W/\\\"datetime'2020-06-30T15%3A21%3A40.4577739Z'\\\"\",\"PartitionKey\":\"partitionKeytfjpmptd\",\"RowKey\":\"rowKeynzjzmhtiorwwxc\",\"Timestamp\":\"2020-06-30T15:21:40.4577739Z\"}", - "Preference-Applied" : "return-content", - "x-ms-client-request-id" : "24cd9b36-e1d1-413c-9957-82b2092afa61", - "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", - "Location" : "https://telboytrial.table.core.windows.net/testkgmycpvdeispzzoi(PartitionKey='partitionKeytfjpmptd',RowKey='rowKeynzjzmhtiorwwxc')" - }, - "Exception" : null - }, { - "Method" : "PATCH", - "Uri" : "https://REDACTED.table.core.windows.net/testkgmycpvdeispzzoi(PartitionKey='partitionKeytfjpmptd',RowKey='rowKeynzjzmhtiorwwxc')?timeout=5000", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "7df00b09-038b-471a-84f2-23b559508806", - "Content-Type" : "application/json" - }, - "Response" : { - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "ETag" : "W/\"datetime'2020-06-30T15%3A21%3A40.4942574Z'\"", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "7871c00b-4002-0040-04f2-4e52c5000000", - "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", - "x-ms-client-request-id" : "7df00b09-038b-471a-84f2-23b559508806" - }, - "Exception" : null - }, { - "Method" : "GET", - "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "9179fcf5-396f-4ae6-8ab4-152675c1d9b9" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "200", - "x-ms-request-id" : "f81e6ab0-7002-0064-62f2-4ea465000000", - "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"testkgmycpvdeispzzoi\"}]}", - "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", - "x-ms-client-request-id" : "9179fcf5-396f-4ae6-8ab4-152675c1d9b9", - "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" - }, - "Exception" : null - }, { - "Method" : "DELETE", - "Uri" : "https://REDACTED.table.core.windows.net/Tables('testkgmycpvdeispzzoi')", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "6006572e-781b-4d5b-938d-917e77279b5e" - }, - "Response" : { - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "dd939a16-6002-009c-07f2-4ef89b000000", - "Date" : "Tue, 30 Jun 2020 15:21:40 GMT", - "x-ms-client-request-id" : "6006572e-781b-4d5b-938d-917e77279b5e" - }, - "Exception" : null - } ], - "variables" : [ "bbca0946-7a3d-4030-852d-f6a69f5e6b16", "7df00b09-038b-471a-84f2-23b559508806", "24cd9b36-e1d1-413c-9957-82b2092afa61", "6006572e-781b-4d5b-938d-917e77279b5e" ] -} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/mergeNonExistentEntity.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/mergeNonExistentEntity.json deleted file mode 100644 index e1c1a8f86ab6..000000000000 --- a/sdk/tables/azure-data-tables/src/test/resources/session-records/mergeNonExistentEntity.json +++ /dev/null @@ -1,94 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "POST", - "Uri" : "https://REDACTED.table.core.windows.net/Tables", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "b571dc28-7958-4ec9-8058-544b5b1dccb5", - "Content-Type" : "application/json" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "201", - "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", - "Cache-Control" : "no-cache", - "x-ms-request-id" : "dd9399e0-6002-009c-63f2-4ef89b000000", - "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"testjwoxmfzjxzhnrdgv\"}", - "Preference-Applied" : "return-content", - "x-ms-client-request-id" : "b571dc28-7958-4ec9-8058-544b5b1dccb5", - "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", - "Location" : "https://telboytrial.table.core.windows.net/Tables('testjwoxmfzjxzhnrdgv')" - }, - "Exception" : null - }, { - "Method" : "PATCH", - "Uri" : "https://REDACTED.table.core.windows.net/testjwoxmfzjxzhnrdgv(PartitionKey='partitionKeyxjyscozh',RowKey='rowKeyudbwngdtspgeoa')?timeout=5000", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "303e1c33-cc7e-403a-9981-a3b2ab16a5c1", - "Content-Type" : "application/json" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "404", - "x-ms-request-id" : "f81e6a63-7002-0064-26f2-4ea465000000", - "Body" : "{\"odata.error\":{\"code\":\"ResourceNotFound\",\"message\":{\"lang\":\"en-US\",\"value\":\"The specified resource does not exist.\\nRequestId:f81e6a63-7002-0064-26f2-4ea465000000\\nTime:2020-06-30T15:21:39.4892428Z\"}}}", - "Date" : "Tue, 30 Jun 2020 15:21:38 GMT", - "x-ms-client-request-id" : "303e1c33-cc7e-403a-9981-a3b2ab16a5c1", - "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" - }, - "Exception" : null - }, { - "Method" : "GET", - "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "c728e3ba-4188-40d4-9b85-a55a8e3f4c6a" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "200", - "x-ms-request-id" : "dd9399e2-6002-009c-64f2-4ef89b000000", - "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"testjwoxmfzjxzhnrdgv\"}]}", - "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", - "x-ms-client-request-id" : "c728e3ba-4188-40d4-9b85-a55a8e3f4c6a", - "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" - }, - "Exception" : null - }, { - "Method" : "DELETE", - "Uri" : "https://REDACTED.table.core.windows.net/Tables('testjwoxmfzjxzhnrdgv')", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "ac3e9ac0-9c10-4ab2-a548-e2d8de3e5ce7" - }, - "Response" : { - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "f81e6a68-7002-0064-2af2-4ea465000000", - "Date" : "Tue, 30 Jun 2020 15:21:38 GMT", - "x-ms-client-request-id" : "ac3e9ac0-9c10-4ab2-a548-e2d8de3e5ce7" - }, - "Exception" : null - } ], - "variables" : [ "b571dc28-7958-4ec9-8058-544b5b1dccb5", "303e1c33-cc7e-403a-9981-a3b2ab16a5c1", "ac3e9ac0-9c10-4ab2-a548-e2d8de3e5ce7" ] -} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntitiesWithPartitionAndRowKey.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntitiesWithPartitionAndRowKey.json deleted file mode 100644 index 43c56e91948d..000000000000 --- a/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntitiesWithPartitionAndRowKey.json +++ /dev/null @@ -1,120 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "POST", - "Uri" : "https://REDACTED.table.core.windows.net/Tables", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "cb250844-6d64-42f2-9328-510c1fbfe645", - "Content-Type" : "application/json" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "201", - "Date" : "Tue, 30 Jun 2020 15:21:40 GMT", - "Cache-Control" : "no-cache", - "x-ms-request-id" : "dd939a32-6002-009c-21f2-4ef89b000000", - "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"testuggnftptjovuvqnk\"}", - "Preference-Applied" : "return-content", - "x-ms-client-request-id" : "cb250844-6d64-42f2-9328-510c1fbfe645", - "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", - "Location" : "https://telboytrial.table.core.windows.net/Tables('testuggnftptjovuvqnk')" - }, - "Exception" : null - }, { - "Method" : "POST", - "Uri" : "https://REDACTED.table.core.windows.net/testuggnftptjovuvqnk?timeout=5000", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "94d8bac3-b45b-45d8-95f2-ee00254517a1", - "Content-Type" : "application/json" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "201", - "Date" : "Tue, 30 Jun 2020 15:21:40 GMT", - "Cache-Control" : "no-cache", - "ETag" : "W/\"datetime'2020-06-30T15%3A21%3A41.1234429Z'\"", - "x-ms-request-id" : "7871c01a-4002-0040-0df2-4e52c5000000", - "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#testuggnftptjovuvqnk/@Element\",\"odata.etag\":\"W/\\\"datetime'2020-06-30T15%3A21%3A41.1234429Z'\\\"\",\"PartitionKey\":\"partitionKeyjyjiyghm\",\"RowKey\":\"rowKeylinamqijseceja\",\"Timestamp\":\"2020-06-30T15:21:41.1234429Z\"}", - "Preference-Applied" : "return-content", - "x-ms-client-request-id" : "94d8bac3-b45b-45d8-95f2-ee00254517a1", - "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", - "Location" : "https://telboytrial.table.core.windows.net/testuggnftptjovuvqnk(PartitionKey='partitionKeyjyjiyghm',RowKey='rowKeylinamqijseceja')" - }, - "Exception" : null - }, { - "Method" : "GET", - "Uri" : "https://REDACTED.table.core.windows.net/testuggnftptjovuvqnk(PartitionKey='partitionKeyjyjiyghm',RowKey='rowKeylinamqijseceja')?timeout=5000&$format=application/json%3Bodata%3Dfullmetadata", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "23a5ee33-28a1-4bc1-80b3-c289ca57865e" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "200", - "Date" : "Tue, 30 Jun 2020 15:21:40 GMT", - "Cache-Control" : "no-cache", - "ETag" : "W/\"datetime'2020-06-30T15%3A21%3A41.1234429Z'\"", - "x-ms-request-id" : "f81e6ada-7002-0064-04f2-4ea465000000", - "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#testuggnftptjovuvqnk/@Element\",\"odata.type\":\"telboytrial.testuggnftptjovuvqnk\",\"odata.id\":\"https://telboytrial.table.core.windows.net/testuggnftptjovuvqnk(PartitionKey='partitionKeyjyjiyghm',RowKey='rowKeylinamqijseceja')\",\"odata.etag\":\"W/\\\"datetime'2020-06-30T15%3A21%3A41.1234429Z'\\\"\",\"odata.editLink\":\"testuggnftptjovuvqnk(PartitionKey='partitionKeyjyjiyghm',RowKey='rowKeylinamqijseceja')\",\"PartitionKey\":\"partitionKeyjyjiyghm\",\"RowKey\":\"rowKeylinamqijseceja\",\"Timestamp@odata.type\":\"Edm.DateTime\",\"Timestamp\":\"2020-06-30T15:21:41.1234429Z\"}", - "x-ms-client-request-id" : "23a5ee33-28a1-4bc1-80b3-c289ca57865e", - "Content-Type" : "application/json;odata=fullmetadata;streaming=true;charset=utf-8" - }, - "Exception" : null - }, { - "Method" : "GET", - "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "70e5368d-fe24-4645-a723-1a2f52808d29" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "200", - "x-ms-request-id" : "dd939a3a-6002-009c-28f2-4ef89b000000", - "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"testuggnftptjovuvqnk\"}]}", - "Date" : "Tue, 30 Jun 2020 15:21:40 GMT", - "x-ms-client-request-id" : "70e5368d-fe24-4645-a723-1a2f52808d29", - "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" - }, - "Exception" : null - }, { - "Method" : "DELETE", - "Uri" : "https://REDACTED.table.core.windows.net/Tables('testuggnftptjovuvqnk')", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "6b491e8b-9b1a-4fdd-aa01-e9f98083d659" - }, - "Response" : { - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "7871c01c-4002-0040-0ef2-4e52c5000000", - "Date" : "Tue, 30 Jun 2020 15:21:40 GMT", - "x-ms-client-request-id" : "6b491e8b-9b1a-4fdd-aa01-e9f98083d659" - }, - "Exception" : null - } ], - "variables" : [ "cb250844-6d64-42f2-9328-510c1fbfe645", "94d8bac3-b45b-45d8-95f2-ee00254517a1", "6b491e8b-9b1a-4fdd-aa01-e9f98083d659" ] -} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntity.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntity.json deleted file mode 100644 index 754292673692..000000000000 --- a/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntity.json +++ /dev/null @@ -1,145 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "POST", - "Uri" : "https://REDACTED.table.core.windows.net/Tables", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "17460e58-df53-425d-93ae-782c33fb27de", - "Content-Type" : "application/json" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "201", - "Date" : "Tue, 30 Jun 2020 15:21:37 GMT", - "Cache-Control" : "no-cache", - "x-ms-request-id" : "f81e6a2b-7002-0064-7ef2-4ea465000000", - "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"testekinbhdozbtfzsid\"}", - "Preference-Applied" : "return-content", - "x-ms-client-request-id" : "17460e58-df53-425d-93ae-782c33fb27de", - "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", - "Location" : "https://telboytrial.table.core.windows.net/Tables('testekinbhdozbtfzsid')" - }, - "Exception" : null - }, { - "Method" : "POST", - "Uri" : "https://REDACTED.table.core.windows.net/testekinbhdozbtfzsid?timeout=5000", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "a38d0042-0dfe-497d-9b68-e8bf8ca22c1e", - "Content-Type" : "application/json" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "201", - "Date" : "Tue, 30 Jun 2020 15:21:38 GMT", - "Cache-Control" : "no-cache", - "ETag" : "W/\"datetime'2020-06-30T15%3A21%3A38.6214799Z'\"", - "x-ms-request-id" : "dd93999e-6002-009c-33f2-4ef89b000000", - "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#testekinbhdozbtfzsid/@Element\",\"odata.etag\":\"W/\\\"datetime'2020-06-30T15%3A21%3A38.6214799Z'\\\"\",\"PartitionKey\":\"partitionKeyAvsomide\",\"RowKey\":\"rowKeyAyxobcngkuwggr\",\"Timestamp\":\"2020-06-30T15:21:38.6214799Z\"}", - "Preference-Applied" : "return-content", - "x-ms-client-request-id" : "a38d0042-0dfe-497d-9b68-e8bf8ca22c1e", - "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", - "Location" : "https://telboytrial.table.core.windows.net/testekinbhdozbtfzsid(PartitionKey='partitionKeyAvsomide',RowKey='rowKeyAyxobcngkuwggr')" - }, - "Exception" : null - }, { - "Method" : "POST", - "Uri" : "https://REDACTED.table.core.windows.net/testekinbhdozbtfzsid?timeout=5000", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "8505e17a-d9ba-4312-a1ff-ca8884c8dd6f", - "Content-Type" : "application/json" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "201", - "Date" : "Tue, 30 Jun 2020 15:21:37 GMT", - "Cache-Control" : "no-cache", - "ETag" : "W/\"datetime'2020-06-30T15%3A21%3A38.6566536Z'\"", - "x-ms-request-id" : "f81e6a2f-7002-0064-01f2-4ea465000000", - "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#testekinbhdozbtfzsid/@Element\",\"odata.etag\":\"W/\\\"datetime'2020-06-30T15%3A21%3A38.6566536Z'\\\"\",\"PartitionKey\":\"partitionKeyBzfhknxd\",\"RowKey\":\"rowKeyBznxlvckywxthl\",\"Timestamp\":\"2020-06-30T15:21:38.6566536Z\"}", - "Preference-Applied" : "return-content", - "x-ms-client-request-id" : "8505e17a-d9ba-4312-a1ff-ca8884c8dd6f", - "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", - "Location" : "https://telboytrial.table.core.windows.net/testekinbhdozbtfzsid(PartitionKey='partitionKeyBzfhknxd',RowKey='rowKeyBznxlvckywxthl')" - }, - "Exception" : null - }, { - "Method" : "GET", - "Uri" : "https://REDACTED.table.core.windows.net/testekinbhdozbtfzsid()?timeout=5000&$format=application/json%3Bodata%3Dfullmetadata", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "633e4104-0fb1-4fd6-8ca2-b533b96eef1b" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "200", - "x-ms-request-id" : "dd9399a5-6002-009c-37f2-4ef89b000000", - "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#testekinbhdozbtfzsid\",\"value\":[{\"odata.type\":\"telboytrial.testekinbhdozbtfzsid\",\"odata.id\":\"https://telboytrial.table.core.windows.net/testekinbhdozbtfzsid(PartitionKey='partitionKeyAvsomide',RowKey='rowKeyAyxobcngkuwggr')\",\"odata.etag\":\"W/\\\"datetime'2020-06-30T15%3A21%3A38.6214799Z'\\\"\",\"odata.editLink\":\"testekinbhdozbtfzsid(PartitionKey='partitionKeyAvsomide',RowKey='rowKeyAyxobcngkuwggr')\",\"PartitionKey\":\"partitionKeyAvsomide\",\"RowKey\":\"rowKeyAyxobcngkuwggr\",\"Timestamp@odata.type\":\"Edm.DateTime\",\"Timestamp\":\"2020-06-30T15:21:38.6214799Z\"},{\"odata.type\":\"telboytrial.testekinbhdozbtfzsid\",\"odata.id\":\"https://telboytrial.table.core.windows.net/testekinbhdozbtfzsid(PartitionKey='partitionKeyBzfhknxd',RowKey='rowKeyBznxlvckywxthl')\",\"odata.etag\":\"W/\\\"datetime'2020-06-30T15%3A21%3A38.6566536Z'\\\"\",\"odata.editLink\":\"testekinbhdozbtfzsid(PartitionKey='partitionKeyBzfhknxd',RowKey='rowKeyBznxlvckywxthl')\",\"PartitionKey\":\"partitionKeyBzfhknxd\",\"RowKey\":\"rowKeyBznxlvckywxthl\",\"Timestamp@odata.type\":\"Edm.DateTime\",\"Timestamp\":\"2020-06-30T15:21:38.6566536Z\"}]}", - "Date" : "Tue, 30 Jun 2020 15:21:38 GMT", - "x-ms-client-request-id" : "633e4104-0fb1-4fd6-8ca2-b533b96eef1b", - "Content-Type" : "application/json;odata=fullmetadata;streaming=true;charset=utf-8" - }, - "Exception" : null - }, { - "Method" : "GET", - "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "244b2c30-dbfe-4b02-b0e0-d9931e3bea83" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "200", - "x-ms-request-id" : "f81e6a38-7002-0064-06f2-4ea465000000", - "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"testekinbhdozbtfzsid\"}]}", - "Date" : "Tue, 30 Jun 2020 15:21:38 GMT", - "x-ms-client-request-id" : "244b2c30-dbfe-4b02-b0e0-d9931e3bea83", - "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" - }, - "Exception" : null - }, { - "Method" : "DELETE", - "Uri" : "https://REDACTED.table.core.windows.net/Tables('testekinbhdozbtfzsid')", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "009de9fd-51b6-40d3-9db3-d90be56b0ec8" - }, - "Response" : { - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "dd9399a8-6002-009c-39f2-4ef89b000000", - "Date" : "Tue, 30 Jun 2020 15:21:38 GMT", - "x-ms-client-request-id" : "009de9fd-51b6-40d3-9db3-d90be56b0ec8" - }, - "Exception" : null - } ], - "variables" : [ "633e4104-0fb1-4fd6-8ca2-b533b96eef1b", "17460e58-df53-425d-93ae-782c33fb27de", "a38d0042-0dfe-497d-9b68-e8bf8ca22c1e", "8505e17a-d9ba-4312-a1ff-ca8884c8dd6f", "009de9fd-51b6-40d3-9db3-d90be56b0ec8" ] -} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntityWithFilter.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntityWithFilter.json deleted file mode 100644 index 03a3750571b1..000000000000 --- a/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntityWithFilter.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "POST", - "Uri" : "https://REDACTED.table.core.windows.net/Tables", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "7062c289-2f07-4894-8c79-fb0a4d54b453", - "Content-Type" : "application/json" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "201", - "Date" : "Tue, 30 Jun 2020 15:21:37 GMT", - "Cache-Control" : "no-cache", - "x-ms-request-id" : "f81e6a1e-7002-0064-77f2-4ea465000000", - "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"testqxgsptkutubbqwzz\"}", - "Preference-Applied" : "return-content", - "x-ms-client-request-id" : "7062c289-2f07-4894-8c79-fb0a4d54b453", - "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", - "Location" : "https://telboytrial.table.core.windows.net/Tables('testqxgsptkutubbqwzz')" - }, - "Exception" : null - }, { - "Method" : "POST", - "Uri" : "https://REDACTED.table.core.windows.net/testqxgsptkutubbqwzz?timeout=5000", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "e1f9f334-b7b8-48ba-935b-c781d576919e", - "Content-Type" : "application/json" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "201", - "Date" : "Tue, 30 Jun 2020 15:21:37 GMT", - "Cache-Control" : "no-cache", - "ETag" : "W/\"datetime'2020-06-30T15%3A21%3A38.1963293Z'\"", - "x-ms-request-id" : "f81e6a25-7002-0064-7af2-4ea465000000", - "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#testqxgsptkutubbqwzz/@Element\",\"odata.etag\":\"W/\\\"datetime'2020-06-30T15%3A21%3A38.1963293Z'\\\"\",\"PartitionKey\":\"partitionKeyAczlzjyx\",\"RowKey\":\"rowKeyAcgwbtcvihpuul\",\"Timestamp\":\"2020-06-30T15:21:38.1963293Z\"}", - "Preference-Applied" : "return-content", - "x-ms-client-request-id" : "e1f9f334-b7b8-48ba-935b-c781d576919e", - "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", - "Location" : "https://telboytrial.table.core.windows.net/testqxgsptkutubbqwzz(PartitionKey='partitionKeyAczlzjyx',RowKey='rowKeyAcgwbtcvihpuul')" - }, - "Exception" : null - }, { - "Method" : "GET", - "Uri" : "https://REDACTED.table.core.windows.net/testqxgsptkutubbqwzz()?timeout=5000&$format=application/json%3Bodata%3Dfullmetadata&$select=PartitionKeyeqpartitionKeyAczlzjyx", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "83f1c6b9-1aa4-4b2d-8a8b-06cafd3fbe80" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "200", - "x-ms-request-id" : "f81e6a29-7002-0064-7cf2-4ea465000000", - "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#testqxgsptkutubbqwzz&$select=PartitionKeyeqpartitionKeyAczlzjyx\",\"value\":[{\"odata.type\":\"telboytrial.testqxgsptkutubbqwzz\",\"odata.id\":\"https://telboytrial.table.core.windows.net/testqxgsptkutubbqwzz(PartitionKey='partitionKeyAczlzjyx',RowKey='rowKeyAcgwbtcvihpuul')\",\"odata.etag\":\"W/\\\"datetime'2020-06-30T15%3A21%3A38.1963293Z'\\\"\",\"odata.editLink\":\"testqxgsptkutubbqwzz(PartitionKey='partitionKeyAczlzjyx',RowKey='rowKeyAcgwbtcvihpuul')\",\"PartitionKeyeqpartitionKeyAczlzjyx\":null}]}", - "Date" : "Tue, 30 Jun 2020 15:21:37 GMT", - "x-ms-client-request-id" : "83f1c6b9-1aa4-4b2d-8a8b-06cafd3fbe80", - "Content-Type" : "application/json;odata=fullmetadata;streaming=true;charset=utf-8" - }, - "Exception" : null - }, { - "Method" : "GET", - "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "af11f9a2-f872-415d-992d-c4ec94d045f1" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "200", - "x-ms-request-id" : "f81e6a2a-7002-0064-7df2-4ea465000000", - "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"testqxgsptkutubbqwzz\"}]}", - "Date" : "Tue, 30 Jun 2020 15:21:37 GMT", - "x-ms-client-request-id" : "af11f9a2-f872-415d-992d-c4ec94d045f1", - "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" - }, - "Exception" : null - }, { - "Method" : "DELETE", - "Uri" : "https://REDACTED.table.core.windows.net/Tables('testqxgsptkutubbqwzz')", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "4bab6212-c362-4875-89e2-3f2bd3e0c522" - }, - "Response" : { - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "dd93999c-6002-009c-32f2-4ef89b000000", - "Date" : "Tue, 30 Jun 2020 15:21:38 GMT", - "x-ms-client-request-id" : "4bab6212-c362-4875-89e2-3f2bd3e0c522" - }, - "Exception" : null - } ], - "variables" : [ "83f1c6b9-1aa4-4b2d-8a8b-06cafd3fbe80", "7062c289-2f07-4894-8c79-fb0a4d54b453", "e1f9f334-b7b8-48ba-935b-c781d576919e", "4bab6212-c362-4875-89e2-3f2bd3e0c522" ] -} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntityWithSelect.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntityWithSelect.json deleted file mode 100644 index 7960fc11cc2f..000000000000 --- a/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntityWithSelect.json +++ /dev/null @@ -1,145 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "POST", - "Uri" : "https://REDACTED.table.core.windows.net/Tables", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "0c2db2c9-efdd-4781-9540-5bbf3700f063", - "Content-Type" : "application/json" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "201", - "Date" : "Tue, 30 Jun 2020 15:21:38 GMT", - "Cache-Control" : "no-cache", - "x-ms-request-id" : "f81e6a40-7002-0064-0cf2-4ea465000000", - "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"testsueuobepkuwpyepu\"}", - "Preference-Applied" : "return-content", - "x-ms-client-request-id" : "0c2db2c9-efdd-4781-9540-5bbf3700f063", - "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", - "Location" : "https://telboytrial.table.core.windows.net/Tables('testsueuobepkuwpyepu')" - }, - "Exception" : null - }, { - "Method" : "POST", - "Uri" : "https://REDACTED.table.core.windows.net/testsueuobepkuwpyepu?timeout=5000", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "5f1e8a3d-b464-427a-b935-58dda6621b2c", - "Content-Type" : "application/json" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "201", - "Date" : "Tue, 30 Jun 2020 15:21:38 GMT", - "Cache-Control" : "no-cache", - "ETag" : "W/\"datetime'2020-06-30T15%3A21%3A38.8676538Z'\"", - "x-ms-request-id" : "dd9399b4-6002-009c-3ff2-4ef89b000000", - "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#testsueuobepkuwpyepu/@Element\",\"odata.etag\":\"W/\\\"datetime'2020-06-30T15%3A21%3A38.8676538Z'\\\"\",\"PartitionKey\":\"partitionKeyAhogytvv\",\"RowKey\":\"rowKeyAkwplvbfdfohjc\",\"Timestamp\":\"2020-06-30T15:21:38.8676538Z\"}", - "Preference-Applied" : "return-content", - "x-ms-client-request-id" : "5f1e8a3d-b464-427a-b935-58dda6621b2c", - "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", - "Location" : "https://telboytrial.table.core.windows.net/testsueuobepkuwpyepu(PartitionKey='partitionKeyAhogytvv',RowKey='rowKeyAkwplvbfdfohjc')" - }, - "Exception" : null - }, { - "Method" : "POST", - "Uri" : "https://REDACTED.table.core.windows.net/testsueuobepkuwpyepu?timeout=5000", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "64f85bc3-4862-4d9f-9b2e-43fc11ab2e33", - "Content-Type" : "application/json" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "201", - "Date" : "Tue, 30 Jun 2020 15:21:38 GMT", - "Cache-Control" : "no-cache", - "ETag" : "W/\"datetime'2020-06-30T15%3A21%3A38.8998254Z'\"", - "x-ms-request-id" : "f81e6a4b-7002-0064-12f2-4ea465000000", - "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#testsueuobepkuwpyepu/@Element\",\"odata.etag\":\"W/\\\"datetime'2020-06-30T15%3A21%3A38.8998254Z'\\\"\",\"PartitionKey\":\"partitionKeyBphkoxor\",\"RowKey\":\"rowKeyBrsjwoomrgjvkm\",\"Timestamp\":\"2020-06-30T15:21:38.8998254Z\"}", - "Preference-Applied" : "return-content", - "x-ms-client-request-id" : "64f85bc3-4862-4d9f-9b2e-43fc11ab2e33", - "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", - "Location" : "https://telboytrial.table.core.windows.net/testsueuobepkuwpyepu(PartitionKey='partitionKeyBphkoxor',RowKey='rowKeyBrsjwoomrgjvkm')" - }, - "Exception" : null - }, { - "Method" : "GET", - "Uri" : "https://REDACTED.table.core.windows.net/testsueuobepkuwpyepu()?timeout=5000&$format=application/json%3Bodata%3Dfullmetadata&$select=RowKey", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "8bf99390-03e6-4512-ac31-433c08741730" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "200", - "x-ms-request-id" : "dd9399bc-6002-009c-44f2-4ef89b000000", - "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#testsueuobepkuwpyepu&$select=RowKey\",\"value\":[{\"odata.type\":\"telboytrial.testsueuobepkuwpyepu\",\"odata.id\":\"https://telboytrial.table.core.windows.net/testsueuobepkuwpyepu(PartitionKey='partitionKeyAhogytvv',RowKey='rowKeyAkwplvbfdfohjc')\",\"odata.etag\":\"W/\\\"datetime'2020-06-30T15%3A21%3A38.8676538Z'\\\"\",\"odata.editLink\":\"testsueuobepkuwpyepu(PartitionKey='partitionKeyAhogytvv',RowKey='rowKeyAkwplvbfdfohjc')\",\"RowKey\":\"rowKeyAkwplvbfdfohjc\"},{\"odata.type\":\"telboytrial.testsueuobepkuwpyepu\",\"odata.id\":\"https://telboytrial.table.core.windows.net/testsueuobepkuwpyepu(PartitionKey='partitionKeyBphkoxor',RowKey='rowKeyBrsjwoomrgjvkm')\",\"odata.etag\":\"W/\\\"datetime'2020-06-30T15%3A21%3A38.8998254Z'\\\"\",\"odata.editLink\":\"testsueuobepkuwpyepu(PartitionKey='partitionKeyBphkoxor',RowKey='rowKeyBrsjwoomrgjvkm')\",\"RowKey\":\"rowKeyBrsjwoomrgjvkm\"}]}", - "Date" : "Tue, 30 Jun 2020 15:21:38 GMT", - "x-ms-client-request-id" : "8bf99390-03e6-4512-ac31-433c08741730", - "Content-Type" : "application/json;odata=fullmetadata;streaming=true;charset=utf-8" - }, - "Exception" : null - }, { - "Method" : "GET", - "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "18e89855-de03-4065-9e24-716903d700e3" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "200", - "x-ms-request-id" : "f81e6a4d-7002-0064-14f2-4ea465000000", - "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"testsueuobepkuwpyepu\"}]}", - "Date" : "Tue, 30 Jun 2020 15:21:38 GMT", - "x-ms-client-request-id" : "18e89855-de03-4065-9e24-716903d700e3", - "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" - }, - "Exception" : null - }, { - "Method" : "DELETE", - "Uri" : "https://REDACTED.table.core.windows.net/Tables('testsueuobepkuwpyepu')", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "3aac1600-4ac0-4e1f-b55a-d40ca4961541" - }, - "Response" : { - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "dd9399c1-6002-009c-49f2-4ef89b000000", - "Date" : "Tue, 30 Jun 2020 15:21:38 GMT", - "x-ms-client-request-id" : "3aac1600-4ac0-4e1f-b55a-d40ca4961541" - }, - "Exception" : null - } ], - "variables" : [ "8bf99390-03e6-4512-ac31-433c08741730", "0c2db2c9-efdd-4781-9540-5bbf3700f063", "5f1e8a3d-b464-427a-b935-58dda6621b2c", "64f85bc3-4862-4d9f-9b2e-43fc11ab2e33", "3aac1600-4ac0-4e1f-b55a-d40ca4961541" ] -} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntityWithTop.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntityWithTop.json deleted file mode 100644 index 18a1ce7dd3bd..000000000000 --- a/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntityWithTop.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "POST", - "Uri" : "https://REDACTED.table.core.windows.net/Tables", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "04a28429-10f6-4126-80ba-8d09aca4c812", - "Content-Type" : "application/json" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "201", - "Date" : "Tue, 30 Jun 2020 15:21:38 GMT", - "Cache-Control" : "no-cache", - "x-ms-request-id" : "f81e6a53-7002-0064-18f2-4ea465000000", - "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"testmxtjvghrwlkrrjdh\"}", - "Preference-Applied" : "return-content", - "x-ms-client-request-id" : "04a28429-10f6-4126-80ba-8d09aca4c812", - "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", - "Location" : "https://telboytrial.table.core.windows.net/Tables('testmxtjvghrwlkrrjdh')" - }, - "Exception" : null - }, { - "Method" : "GET", - "Uri" : "https://REDACTED.table.core.windows.net/testmxtjvghrwlkrrjdh()?timeout=5000&$format=application/json%3Bodata%3Dfullmetadata&$top=0", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "981740a1-f9b2-4ccd-889e-74c715ebb3ae" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "200", - "x-ms-request-id" : "dd9399d0-6002-009c-56f2-4ef89b000000", - "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#testmxtjvghrwlkrrjdh\",\"value\":[]}", - "Date" : "Tue, 30 Jun 2020 15:21:38 GMT", - "x-ms-client-request-id" : "981740a1-f9b2-4ccd-889e-74c715ebb3ae", - "Content-Type" : "application/json;odata=fullmetadata;streaming=true;charset=utf-8" - }, - "Exception" : null - }, { - "Method" : "GET", - "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "b89cbe3e-4cb1-4222-99d6-c58ec4e9ac52" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "200", - "x-ms-request-id" : "f81e6a55-7002-0064-19f2-4ea465000000", - "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"testmxtjvghrwlkrrjdh\"}]}", - "Date" : "Tue, 30 Jun 2020 15:21:38 GMT", - "x-ms-client-request-id" : "b89cbe3e-4cb1-4222-99d6-c58ec4e9ac52", - "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" - }, - "Exception" : null - }, { - "Method" : "DELETE", - "Uri" : "https://REDACTED.table.core.windows.net/Tables('testmxtjvghrwlkrrjdh')", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "295e99d9-eee1-4a4a-8bf3-caa19c0c3e04" - }, - "Response" : { - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "dd9399d8-6002-009c-5df2-4ef89b000000", - "Date" : "Tue, 30 Jun 2020 15:21:38 GMT", - "x-ms-client-request-id" : "295e99d9-eee1-4a4a-8bf3-caa19c0c3e04" - }, - "Exception" : null - } ], - "variables" : [ "981740a1-f9b2-4ccd-889e-74c715ebb3ae", "04a28429-10f6-4126-80ba-8d09aca4c812", "295e99d9-eee1-4a4a-8bf3-caa19c0c3e04" ] -} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/queryTable.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/queryTable.json deleted file mode 100644 index 857a8a577c86..000000000000 --- a/sdk/tables/azure-data-tables/src/test/resources/session-records/queryTable.json +++ /dev/null @@ -1,138 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "POST", - "Uri" : "https://REDACTED.table.core.windows.net/Tables", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "c6d00896-20bd-4850-abc6-24ea502cad03", - "Content-Type" : "application/json" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "201", - "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", - "Cache-Control" : "no-cache", - "x-ms-request-id" : "7871c010-4002-0040-06f2-4e52c5000000", - "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"AtestAbfyvouusdiuyws\"}", - "Preference-Applied" : "return-content", - "x-ms-client-request-id" : "c6d00896-20bd-4850-abc6-24ea502cad03", - "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", - "Location" : "https://telboytrial.table.core.windows.net/Tables('AtestAbfyvouusdiuyws')" - }, - "Exception" : null - }, { - "Method" : "POST", - "Uri" : "https://REDACTED.table.core.windows.net/Tables", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "41bec4dc-36ec-488e-af34-57efd0dfda80", - "Content-Type" : "application/json" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "201", - "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", - "Cache-Control" : "no-cache", - "x-ms-request-id" : "f81e6abe-7002-0064-6ef2-4ea465000000", - "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"BtestBfvlkvxagqsruqg\"}", - "Preference-Applied" : "return-content", - "x-ms-client-request-id" : "41bec4dc-36ec-488e-af34-57efd0dfda80", - "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", - "Location" : "https://telboytrial.table.core.windows.net/Tables('BtestBfvlkvxagqsruqg')" - }, - "Exception" : null - }, { - "Method" : "GET", - "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "059c6ad3-01de-485a-84a0-bba66b24ea98" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "200", - "x-ms-request-id" : "dd939a1c-6002-009c-0df2-4ef89b000000", - "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"AtestAbfyvouusdiuyws\"},{\"TableName\":\"BtestBfvlkvxagqsruqg\"}]}", - "Date" : "Tue, 30 Jun 2020 15:21:40 GMT", - "x-ms-client-request-id" : "059c6ad3-01de-485a-84a0-bba66b24ea98", - "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" - }, - "Exception" : null - }, { - "Method" : "GET", - "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "67b0be68-db4a-4f44-80d2-ecb8e24dcb5f" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "200", - "x-ms-request-id" : "7871c015-4002-0040-09f2-4e52c5000000", - "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"AtestAbfyvouusdiuyws\"},{\"TableName\":\"BtestBfvlkvxagqsruqg\"}]}", - "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", - "x-ms-client-request-id" : "67b0be68-db4a-4f44-80d2-ecb8e24dcb5f", - "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" - }, - "Exception" : null - }, { - "Method" : "DELETE", - "Uri" : "https://REDACTED.table.core.windows.net/Tables('AtestAbfyvouusdiuyws')", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "c573455e-db13-4746-8c39-ebfdfcf8743d" - }, - "Response" : { - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "f81e6ac5-7002-0064-73f2-4ea465000000", - "Date" : "Tue, 30 Jun 2020 15:21:40 GMT", - "x-ms-client-request-id" : "c573455e-db13-4746-8c39-ebfdfcf8743d" - }, - "Exception" : null - }, { - "Method" : "DELETE", - "Uri" : "https://REDACTED.table.core.windows.net/Tables('BtestBfvlkvxagqsruqg')", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "d0e960a0-e967-4b1b-b4cf-67163433f36b" - }, - "Response" : { - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "dd939a21-6002-009c-12f2-4ef89b000000", - "Date" : "Tue, 30 Jun 2020 15:21:40 GMT", - "x-ms-client-request-id" : "d0e960a0-e967-4b1b-b4cf-67163433f36b" - }, - "Exception" : null - } ], - "variables" : [ "c6d00896-20bd-4850-abc6-24ea502cad03", "41bec4dc-36ec-488e-af34-57efd0dfda80", "059c6ad3-01de-485a-84a0-bba66b24ea98", "c573455e-db13-4746-8c39-ebfdfcf8743d", "d0e960a0-e967-4b1b-b4cf-67163433f36b" ] -} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/queryTablewithFilter.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/queryTablewithFilter.json deleted file mode 100644 index 5521b007c6ac..000000000000 --- a/sdk/tables/azure-data-tables/src/test/resources/session-records/queryTablewithFilter.json +++ /dev/null @@ -1,138 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "POST", - "Uri" : "https://REDACTED.table.core.windows.net/Tables", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "477e30c8-1abe-4bae-b743-dba6b2569188", - "Content-Type" : "application/json" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "201", - "Date" : "Tue, 30 Jun 2020 15:18:17 GMT", - "Cache-Control" : "no-cache", - "x-ms-request-id" : "6ee47065-3002-005a-2ef1-4e331a000000", - "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"AtestAnuas\"}", - "Preference-Applied" : "return-content", - "x-ms-client-request-id" : "477e30c8-1abe-4bae-b743-dba6b2569188", - "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", - "Location" : "https://telboytrial.table.core.windows.net/Tables('AtestAnuas')" - }, - "Exception" : null - }, { - "Method" : "POST", - "Uri" : "https://REDACTED.table.core.windows.net/Tables", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "d7488934-28e1-44ca-92f0-5a214c0a6408", - "Content-Type" : "application/json" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "201", - "Date" : "Tue, 30 Jun 2020 15:18:17 GMT", - "Cache-Control" : "no-cache", - "x-ms-request-id" : "6ee4706d-3002-005a-34f1-4e331a000000", - "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"BtestBctzf\"}", - "Preference-Applied" : "return-content", - "x-ms-client-request-id" : "d7488934-28e1-44ca-92f0-5a214c0a6408", - "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", - "Location" : "https://telboytrial.table.core.windows.net/Tables('BtestBctzf')" - }, - "Exception" : null - }, { - "Method" : "GET", - "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata&$filter=TableNameeqAtestAnuas", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "758b764f-b537-44ff-a413-5fe6fb78a979" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "500", - "x-ms-request-id" : "6bd6d34a-f002-006a-69f1-4e8dd5000000", - "Body" : "{\"odata.error\":{\"code\":\"InternalError\",\"message\":{\"lang\":\"en-US\",\"value\":\"Server encountered an internal error. Please try again after some time.\\nRequestId:6bd6d34a-f002-006a-69f1-4e8dd5000000\\nTime:2020-06-30T15:18:23.8182034Z\"}}}", - "Date" : "Tue, 30 Jun 2020 15:18:23 GMT", - "x-ms-client-request-id" : "758b764f-b537-44ff-a413-5fe6fb78a979", - "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" - }, - "Exception" : null - }, { - "Method" : "GET", - "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "66984cc5-9230-4324-9c39-62e52b442208" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "200", - "x-ms-request-id" : "6bd6d34c-f002-006a-6af1-4e8dd5000000", - "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"AtestAnuas\"},{\"TableName\":\"BtestBctzf\"}]}", - "Date" : "Tue, 30 Jun 2020 15:18:23 GMT", - "x-ms-client-request-id" : "66984cc5-9230-4324-9c39-62e52b442208", - "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" - }, - "Exception" : null - }, { - "Method" : "DELETE", - "Uri" : "https://REDACTED.table.core.windows.net/Tables('AtestAnuas')", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "27bab8cb-6f8b-4028-a3e8-086c3805d6b2" - }, - "Response" : { - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "c405d3dc-c002-005e-7ef1-4ebe1d000000", - "Date" : "Tue, 30 Jun 2020 15:18:23 GMT", - "x-ms-client-request-id" : "27bab8cb-6f8b-4028-a3e8-086c3805d6b2" - }, - "Exception" : null - }, { - "Method" : "DELETE", - "Uri" : "https://REDACTED.table.core.windows.net/Tables('BtestBctzf')", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "b9302467-fb88-4216-9179-3d35fc2c8a34" - }, - "Response" : { - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "1833fbeb-5002-003e-4df1-4ec282000000", - "Date" : "Tue, 30 Jun 2020 15:18:23 GMT", - "x-ms-client-request-id" : "b9302467-fb88-4216-9179-3d35fc2c8a34" - }, - "Exception" : null - } ], - "variables" : [ "477e30c8-1abe-4bae-b743-dba6b2569188", "d7488934-28e1-44ca-92f0-5a214c0a6408", "758b764f-b537-44ff-a413-5fe6fb78a979", "27bab8cb-6f8b-4028-a3e8-086c3805d6b2", "b9302467-fb88-4216-9179-3d35fc2c8a34" ] -} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/queryTablewithTop.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/queryTablewithTop.json deleted file mode 100644 index 634f5b654315..000000000000 --- a/sdk/tables/azure-data-tables/src/test/resources/session-records/queryTablewithTop.json +++ /dev/null @@ -1,139 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "POST", - "Uri" : "https://REDACTED.table.core.windows.net/Tables", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "0d048324-ba35-4459-8272-ce0d26ec9d00", - "Content-Type" : "application/json" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "201", - "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", - "Cache-Control" : "no-cache", - "x-ms-request-id" : "dd9399f6-6002-009c-6ef2-4ef89b000000", - "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"AtestAitxqzgncwbmmbe\"}", - "Preference-Applied" : "return-content", - "x-ms-client-request-id" : "0d048324-ba35-4459-8272-ce0d26ec9d00", - "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", - "Location" : "https://telboytrial.table.core.windows.net/Tables('AtestAitxqzgncwbmmbe')" - }, - "Exception" : null - }, { - "Method" : "POST", - "Uri" : "https://REDACTED.table.core.windows.net/Tables", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "003f2aa3-1837-44f1-9c71-09c3ca29adc9", - "Content-Type" : "application/json" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "201", - "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", - "Cache-Control" : "no-cache", - "x-ms-request-id" : "f81e6a8c-7002-0064-43f2-4ea465000000", - "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"BtestBfnmxxltfwitwgn\"}", - "Preference-Applied" : "return-content", - "x-ms-client-request-id" : "003f2aa3-1837-44f1-9c71-09c3ca29adc9", - "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", - "Location" : "https://telboytrial.table.core.windows.net/Tables('BtestBfnmxxltfwitwgn')" - }, - "Exception" : null - }, { - "Method" : "GET", - "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata&$top=1", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "efc7cc3e-8291-4025-aeff-987dd3942f36" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "200", - "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", - "x-ms-continuation-NextTableName" : "1!52!YnRlc3RiZm5teHhsdGZ3aXR3Z24BMDFkNjRlZjIyNzMxODE4MA--", - "Cache-Control" : "no-cache", - "x-ms-request-id" : "dd9399fb-6002-009c-70f2-4ef89b000000", - "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"AtestAitxqzgncwbmmbe\"}]}", - "x-ms-client-request-id" : "efc7cc3e-8291-4025-aeff-987dd3942f36", - "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" - }, - "Exception" : null - }, { - "Method" : "GET", - "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "d2c312e5-c632-494d-a135-3f9d5aca08eb" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "200", - "x-ms-request-id" : "f81e6a96-7002-0064-4bf2-4ea465000000", - "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"AtestAitxqzgncwbmmbe\"},{\"TableName\":\"BtestBfnmxxltfwitwgn\"}]}", - "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", - "x-ms-client-request-id" : "d2c312e5-c632-494d-a135-3f9d5aca08eb", - "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" - }, - "Exception" : null - }, { - "Method" : "DELETE", - "Uri" : "https://REDACTED.table.core.windows.net/Tables('AtestAitxqzgncwbmmbe')", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "1d185bb4-4b9f-4ed4-bb99-ac074d2a1768" - }, - "Response" : { - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "dd9399fc-6002-009c-71f2-4ef89b000000", - "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", - "x-ms-client-request-id" : "1d185bb4-4b9f-4ed4-bb99-ac074d2a1768" - }, - "Exception" : null - }, { - "Method" : "DELETE", - "Uri" : "https://REDACTED.table.core.windows.net/Tables('BtestBfnmxxltfwitwgn')", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "43fcaf52-2fd2-49bf-bf2f-f7dd97c352ec" - }, - "Response" : { - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "7871c004-4002-0040-80f2-4e52c5000000", - "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", - "x-ms-client-request-id" : "43fcaf52-2fd2-49bf-bf2f-f7dd97c352ec" - }, - "Exception" : null - } ], - "variables" : [ "0d048324-ba35-4459-8272-ce0d26ec9d00", "003f2aa3-1837-44f1-9c71-09c3ca29adc9", "efc7cc3e-8291-4025-aeff-987dd3942f36", "1d185bb4-4b9f-4ed4-bb99-ac074d2a1768", "43fcaf52-2fd2-49bf-bf2f-f7dd97c352ec" ] -} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/updateEntity.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/updateEntity.json deleted file mode 100644 index 492ad6b101dc..000000000000 --- a/sdk/tables/azure-data-tables/src/test/resources/session-records/updateEntity.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "POST", - "Uri" : "https://REDACTED.table.core.windows.net/Tables", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "17609dbf-8673-477a-9bc5-b0aef03fa5b9", - "Content-Type" : "application/json" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "201", - "Date" : "Tue, 30 Jun 2020 15:21:38 GMT", - "Cache-Control" : "no-cache", - "x-ms-request-id" : "f81e6a58-7002-0064-1cf2-4ea465000000", - "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"testijxolgpvwkvgfphw\"}", - "Preference-Applied" : "return-content", - "x-ms-client-request-id" : "17609dbf-8673-477a-9bc5-b0aef03fa5b9", - "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", - "Location" : "https://telboytrial.table.core.windows.net/Tables('testijxolgpvwkvgfphw')" - }, - "Exception" : null - }, { - "Method" : "POST", - "Uri" : "https://REDACTED.table.core.windows.net/testijxolgpvwkvgfphw?timeout=5000", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "d2852673-f5e3-4291-9a98-583e28cda3cd", - "Content-Type" : "application/json" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "201", - "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", - "Cache-Control" : "no-cache", - "ETag" : "W/\"datetime'2020-06-30T15%3A21%3A39.2729391Z'\"", - "x-ms-request-id" : "dd9399db-6002-009c-60f2-4ef89b000000", - "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#testijxolgpvwkvgfphw/@Element\",\"odata.etag\":\"W/\\\"datetime'2020-06-30T15%3A21%3A39.2729391Z'\\\"\",\"PartitionKey\":\"partitionKeyumurcyhy\",\"RowKey\":\"rowKeyahyhofvdufantu\",\"Timestamp\":\"2020-06-30T15:21:39.2729391Z\"}", - "Preference-Applied" : "return-content", - "x-ms-client-request-id" : "d2852673-f5e3-4291-9a98-583e28cda3cd", - "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", - "Location" : "https://telboytrial.table.core.windows.net/testijxolgpvwkvgfphw(PartitionKey='partitionKeyumurcyhy',RowKey='rowKeyahyhofvdufantu')" - }, - "Exception" : null - }, { - "Method" : "PUT", - "Uri" : "https://REDACTED.table.core.windows.net/testijxolgpvwkvgfphw(PartitionKey='partitionKeyumurcyhy',RowKey='rowKeyahyhofvdufantu')?timeout=5000", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "69ae1c26-0d34-4e6e-a105-eadae5d83b6a", - "Content-Type" : "application/json" - }, - "Response" : { - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "ETag" : "W/\"datetime'2020-06-30T15%3A21%3A39.3154238Z'\"", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "f81e6a5b-7002-0064-1ef2-4ea465000000", - "Date" : "Tue, 30 Jun 2020 15:21:38 GMT", - "x-ms-client-request-id" : "69ae1c26-0d34-4e6e-a105-eadae5d83b6a" - }, - "Exception" : null - }, { - "Method" : "GET", - "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "73074649-aa7e-40df-a47e-7f7f32f408df" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "200", - "x-ms-request-id" : "dd9399df-6002-009c-62f2-4ef89b000000", - "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"testijxolgpvwkvgfphw\"}]}", - "Date" : "Tue, 30 Jun 2020 15:21:39 GMT", - "x-ms-client-request-id" : "73074649-aa7e-40df-a47e-7f7f32f408df", - "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" - }, - "Exception" : null - }, { - "Method" : "DELETE", - "Uri" : "https://REDACTED.table.core.windows.net/Tables('testijxolgpvwkvgfphw')", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "d7fcb15d-8c02-45bc-8836-124607aa349d" - }, - "Response" : { - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "f81e6a5f-7002-0064-22f2-4ea465000000", - "Date" : "Tue, 30 Jun 2020 15:21:38 GMT", - "x-ms-client-request-id" : "d7fcb15d-8c02-45bc-8836-124607aa349d" - }, - "Exception" : null - } ], - "variables" : [ "17609dbf-8673-477a-9bc5-b0aef03fa5b9", "69ae1c26-0d34-4e6e-a105-eadae5d83b6a", "d2852673-f5e3-4291-9a98-583e28cda3cd", "d7fcb15d-8c02-45bc-8836-124607aa349d" ] -} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/updateNonExistentEntity.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/updateNonExistentEntity.json deleted file mode 100644 index 8a1807c68938..000000000000 --- a/sdk/tables/azure-data-tables/src/test/resources/session-records/updateNonExistentEntity.json +++ /dev/null @@ -1,94 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "POST", - "Uri" : "https://REDACTED.table.core.windows.net/Tables", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "b291239a-a4ae-4d0e-9487-94eef9400f40", - "Content-Type" : "application/json" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "201", - "Date" : "Tue, 30 Jun 2020 15:21:40 GMT", - "Cache-Control" : "no-cache", - "x-ms-request-id" : "f81e6acf-7002-0064-7cf2-4ea465000000", - "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"testclusawuoexlptiey\"}", - "Preference-Applied" : "return-content", - "x-ms-client-request-id" : "b291239a-a4ae-4d0e-9487-94eef9400f40", - "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", - "Location" : "https://telboytrial.table.core.windows.net/Tables('testclusawuoexlptiey')" - }, - "Exception" : null - }, { - "Method" : "PUT", - "Uri" : "https://REDACTED.table.core.windows.net/testclusawuoexlptiey(PartitionKey='partitionKeywmdlgnpu',RowKey='rowKeydedsxyaifawnbi')?timeout=5000", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "95e5f69a-242d-4e6d-85e6-d66f2cb4e1e8", - "Content-Type" : "application/json" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "404", - "x-ms-request-id" : "dd939a2d-6002-009c-1df2-4ef89b000000", - "Body" : "{\"odata.error\":{\"code\":\"ResourceNotFound\",\"message\":{\"lang\":\"en-US\",\"value\":\"The specified resource does not exist.\\nRequestId:dd939a2d-6002-009c-1df2-4ef89b000000\\nTime:2020-06-30T15:21:40.9761373Z\"}}}", - "Date" : "Tue, 30 Jun 2020 15:21:40 GMT", - "x-ms-client-request-id" : "95e5f69a-242d-4e6d-85e6-d66f2cb4e1e8", - "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" - }, - "Exception" : null - }, { - "Method" : "GET", - "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "94ea0bb5-d8aa-44f4-8cf3-a786b298bd58" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "StatusCode" : "200", - "x-ms-request-id" : "7871c019-4002-0040-0cf2-4e52c5000000", - "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"testclusawuoexlptiey\"}]}", - "Date" : "Tue, 30 Jun 2020 15:21:40 GMT", - "x-ms-client-request-id" : "94ea0bb5-d8aa-44f4-8cf3-a786b298bd58", - "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" - }, - "Exception" : null - }, { - "Method" : "DELETE", - "Uri" : "https://REDACTED.table.core.windows.net/Tables('testclusawuoexlptiey')", - "Headers" : { - "x-ms-version" : "2019-02-02", - "x-ms-client-request-id" : "7c9d5516-7a63-44c4-8334-91268fd431b5" - }, - "Response" : { - "x-ms-version" : "2019-02-02", - "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", - "Cache-Control" : "no-cache", - "X-Content-Type-Options" : "nosniff", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "204", - "x-ms-request-id" : "f81e6ad2-7002-0064-7ef2-4ea465000000", - "Date" : "Tue, 30 Jun 2020 15:21:40 GMT", - "x-ms-client-request-id" : "7c9d5516-7a63-44c4-8334-91268fd431b5" - }, - "Exception" : null - } ], - "variables" : [ "b291239a-a4ae-4d0e-9487-94eef9400f40", "95e5f69a-242d-4e6d-85e6-d66f2cb4e1e8", "7c9d5516-7a63-44c4-8334-91268fd431b5" ] -} \ No newline at end of file From ba399fec3d59a5f153eaa686f55ee19b12669afb Mon Sep 17 00:00:00 2001 From: Eleanor Boyd Date: Wed, 1 Jul 2020 08:53:59 -0400 Subject: [PATCH 18/33] playback mode --- .../azure/data/tables/AzureTableImplTest.java | 121 ++++++++------- .../session-records/createTable.json | 71 +++++++++ .../createTableDuplicateName.json | 95 ++++++++++++ .../session-records/deleteEntity.json | 117 ++++++++++++++ .../deleteNonExistentEntity.json | 93 +++++++++++ .../deleteNonExistentTable.json | 48 ++++++ .../session-records/deleteTable.json | 71 +++++++++ .../session-records/insertNoEtag.json | 97 ++++++++++++ .../session-records/mergeEntity.json | 119 ++++++++++++++ .../mergeNonExistentEntity.json | 94 ++++++++++++ .../queryEntitiesWithPartitionAndRowKey.json | 120 +++++++++++++++ .../session-records/queryEntity.json | 145 ++++++++++++++++++ .../queryEntityWithFilter.json | 119 ++++++++++++++ .../queryEntityWithSelect.json | 145 ++++++++++++++++++ .../session-records/queryEntityWithTop.json | 93 +++++++++++ .../resources/session-records/queryTable.json | 138 +++++++++++++++++ .../session-records/queryTablewithTop.json | 139 +++++++++++++++++ .../session-records/updateEntity.json | 119 ++++++++++++++ .../updateNonExistentEntity.json | 94 ++++++++++++ 19 files changed, 1977 insertions(+), 61 deletions(-) create mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/createTable.json create mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/createTableDuplicateName.json create mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/deleteEntity.json create mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/deleteNonExistentEntity.json create mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/deleteNonExistentTable.json create mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/deleteTable.json create mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/insertNoEtag.json create mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/mergeEntity.json create mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/mergeNonExistentEntity.json create mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntitiesWithPartitionAndRowKey.json create mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntity.json create mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntityWithFilter.json create mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntityWithSelect.json create mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntityWithTop.json create mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/queryTable.json create mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/queryTablewithTop.json create mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/updateEntity.json create mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/updateNonExistentEntity.json diff --git a/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java b/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java index 8ce11499530b..0637f60e939d 100644 --- a/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java +++ b/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java @@ -7,7 +7,13 @@ import com.azure.core.http.HttpHeaders; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.policy.*; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersPolicy; +import com.azure.core.http.policy.HttpLogDetailLevel; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.RetryPolicy; import com.azure.core.test.TestBase; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; @@ -19,13 +25,16 @@ import com.azure.data.tables.implementation.models.TableProperties; import com.azure.storage.common.implementation.connectionstring.StorageAuthenticationSettings; import com.azure.storage.common.implementation.connectionstring.StorageConnectionString; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; import reactor.test.StepVerifier; -import java.util.*; /** * This class tests the Autorest code for the Tables track 2 SDK @@ -106,20 +115,10 @@ void insertNoETag(String tableName, Map properties) { requestId, ResponseFormat.RETURN_CONTENT, properties, null, Context.NONE).log().block(); } - String randomCharOnlyName(String prefix, int length) { - Random rnd = new Random(); - String result = prefix; - while (result.length() < length) { - char c = (char) (rnd.nextInt(26) + 'a'); - result += c; - } - return result; - } - @Test void createTable() { // Arrange - String tableName = randomCharOnlyName("test", 20); + String tableName = testResourceNamer.randomName("test", 20); TableProperties tableProperties = new TableProperties().setTableName(tableName); int expectedStatusCode = 201; String requestId = testResourceNamer.randomUuid(); @@ -137,7 +136,7 @@ void createTable() { @Test void createTableDuplicateName() { // Arrange - String tableName = randomCharOnlyName("test", 20); + String tableName = testResourceNamer.randomName("test", 20); TableProperties tableProperties = new TableProperties().setTableName(tableName); createTable(tableName); String requestId = testResourceNamer.randomUuid(); @@ -152,7 +151,7 @@ void createTableDuplicateName() { @Test void deleteTable() { // Arrange - String tableName = randomCharOnlyName("test", 20); + String tableName = testResourceNamer.randomName("test", 20); createTable(tableName); int expectedStatusCode = 204; String requestId = testResourceNamer.randomUuid(); @@ -170,7 +169,7 @@ void deleteTable() { @Test void deleteNonExistentTable() { // Arrange - String tableName = randomCharOnlyName("test", 20); + String tableName = testResourceNamer.randomName("test", 20); String requestId = testResourceNamer.randomUuid(); // Act & Assert @@ -185,8 +184,8 @@ void queryTable() { // Arrange QueryOptions queryOptions = new QueryOptions() .setFormat(OdataMetadataFormat.APPLICATION_JSON_ODATA_MINIMALMETADATA); - String tableA = randomCharOnlyName("AtestA", 20); - String tableB = randomCharOnlyName("BtestB", 20); + String tableA = testResourceNamer.randomName("AtestA", 20); + String tableB = testResourceNamer.randomName("BtestB", 20); createTable(tableA); createTable(tableB); int expectedStatusCode = 200; @@ -209,8 +208,8 @@ void queryTablewithTop() { // Arrange QueryOptions queryOptions = new QueryOptions() .setFormat(OdataMetadataFormat.APPLICATION_JSON_ODATA_MINIMALMETADATA); - String tableA = randomCharOnlyName("AtestA", 20); - String tableB = randomCharOnlyName("BtestB", 20); + String tableA = testResourceNamer.randomName("AtestA", 20); + String tableB = testResourceNamer.randomName("BtestB", 20); createTable(tableA); createTable(tableB); int expectedStatusCode = 200; @@ -233,11 +232,11 @@ void queryTablewithTop() { @Test void insertNoEtag() { // Arrange - String tableName = randomCharOnlyName("test", 20); + String tableName = testResourceNamer.randomName("test", 20); createTable(tableName); Map properties = new HashMap<>(); - String partitionKeyValue = randomCharOnlyName("partitionKey", 20); - String rowKeyValue = randomCharOnlyName("rowKey", 20); + String partitionKeyValue = testResourceNamer.randomName("partitionKey", 20); + String rowKeyValue = testResourceNamer.randomName("rowKey", 20); properties.put(PARTITION_KEY, partitionKeyValue); properties.put(ROW_KEY, rowKeyValue); int expectedStatusCode = 201; @@ -256,17 +255,17 @@ void insertNoEtag() { @Test void mergeEntity() { // Arrange - String tableName = randomCharOnlyName("test", 20); + String tableName = testResourceNamer.randomName("test", 20); createTable(tableName); Map properties = new HashMap<>(); - String partitionKeyValue = randomCharOnlyName("partitionKey", 20); - String rowKeyValue = randomCharOnlyName("rowKey", 20); + String partitionKeyValue = testResourceNamer.randomName("partitionKey", 20); + String rowKeyValue = testResourceNamer.randomName("rowKey", 20); properties.put(PARTITION_KEY, partitionKeyValue); properties.put(ROW_KEY, rowKeyValue); int expectedStatusCode = 204; String requestId = testResourceNamer.randomUuid(); insertNoETag(tableName, properties); - properties.put("extraProperty", randomCharOnlyName("extraProperty", 16)); + properties.put("extraProperty", testResourceNamer.randomName("extraProperty", 16)); // Act & Assert StepVerifier.create(azureTable.getTables().mergeEntityWithResponseAsync(tableName, partitionKeyValue, @@ -281,11 +280,11 @@ void mergeEntity() { @Test void mergeNonExistentEntity() { // Arrange - String tableName = randomCharOnlyName("test", 20); + String tableName = testResourceNamer.randomName("test", 20); createTable(tableName); Map properties = new HashMap<>(); - String partitionKeyValue = randomCharOnlyName("partitionKey", 20); - String rowKeyValue = randomCharOnlyName("rowKey", 20); + String partitionKeyValue = testResourceNamer.randomName("partitionKey", 20); + String rowKeyValue = testResourceNamer.randomName("rowKey", 20); String requestId = testResourceNamer.randomUuid(); // Act & Assert @@ -298,17 +297,17 @@ void mergeNonExistentEntity() { @Test void updateEntity() { // Arrange - String tableName = randomCharOnlyName("test", 20); + String tableName = testResourceNamer.randomName("test", 20); createTable(tableName); Map properties = new HashMap<>(); - String partitionKeyValue = randomCharOnlyName("partitionKey", 20); - String rowKeyValue = randomCharOnlyName("rowKey", 20); + String partitionKeyValue = testResourceNamer.randomName("partitionKey", 20); + String rowKeyValue = testResourceNamer.randomName("rowKey", 20); properties.put(PARTITION_KEY, partitionKeyValue); properties.put(ROW_KEY, rowKeyValue); int expectedStatusCode = 204; String requestId = testResourceNamer.randomUuid(); insertNoETag(tableName, properties); - properties.put("extraProperty", randomCharOnlyName("extraProperty", 16)); + properties.put("extraProperty", testResourceNamer.randomName("extraProperty", 16)); // Act & Assert StepVerifier.create(azureTable.getTables().updateEntityWithResponseAsync(tableName, partitionKeyValue, @@ -323,11 +322,11 @@ void updateEntity() { @Test void updateNonExistentEntity() { // Arrange - String tableName = randomCharOnlyName("test", 20); + String tableName = testResourceNamer.randomName("test", 20); createTable(tableName); Map properties = new HashMap<>(); - String partitionKeyValue = randomCharOnlyName("partitionKey", 20); - String rowKeyValue = randomCharOnlyName("rowKey", 20); + String partitionKeyValue = testResourceNamer.randomName("partitionKey", 20); + String rowKeyValue = testResourceNamer.randomName("rowKey", 20); String requestId = testResourceNamer.randomUuid(); // Act & Assert @@ -340,11 +339,11 @@ void updateNonExistentEntity() { @Test void deleteEntity() { // Arrange - String tableName = randomCharOnlyName("test", 20); + String tableName = testResourceNamer.randomName("test", 20); createTable(tableName); Map properties = new HashMap<>(); - String partitionKeyValue = randomCharOnlyName("partitionKey", 20); - String rowKeyValue = randomCharOnlyName("rowKey", 20); + String partitionKeyValue = testResourceNamer.randomName("partitionKey", 20); + String rowKeyValue = testResourceNamer.randomName("rowKey", 20); properties.put(PARTITION_KEY, partitionKeyValue); properties.put(ROW_KEY, rowKeyValue); int expectedStatusCode = 204; @@ -364,10 +363,10 @@ void deleteEntity() { @Test void deleteNonExistentEntity() { // Arrange - String tableName = randomCharOnlyName("test", 20); + String tableName = testResourceNamer.randomName("test", 20); createTable(tableName); - String partitionKeyValue = randomCharOnlyName("partitionKey", 20); - String rowKeyValue = randomCharOnlyName("rowKey", 20); + String partitionKeyValue = testResourceNamer.randomName("partitionKey", 20); + String rowKeyValue = testResourceNamer.randomName("rowKey", 20); String requestId = testResourceNamer.randomUuid(); // Act & Assert @@ -382,19 +381,19 @@ void queryEntity() { // Arrange String requestId = testResourceNamer.randomUuid(); QueryOptions queryOptions = new QueryOptions().setFormat(OdataMetadataFormat.APPLICATION_JSON_ODATA_FULLMETADATA); - String tableName = randomCharOnlyName("test", 20); + String tableName = testResourceNamer.randomName("test", 20); createTable(tableName); //insert entity A Map entityA = new HashMap<>(); - String partitionKeyEntityA = randomCharOnlyName("partitionKeyA", 20); + String partitionKeyEntityA = testResourceNamer.randomName("partitionKeyA", 20); entityA.put(PARTITION_KEY, partitionKeyEntityA); - entityA.put(ROW_KEY, randomCharOnlyName("rowKeyA", 20)); + entityA.put(ROW_KEY, testResourceNamer.randomName("rowKeyA", 20)); insertNoETag(tableName, entityA); //insert entity B Map entityB = new HashMap<>(); - String partitionKeyEntityB = randomCharOnlyName("partitionKeyB", 20); + String partitionKeyEntityB = testResourceNamer.randomName("partitionKeyB", 20); entityB.put(PARTITION_KEY, partitionKeyEntityB); - entityB.put(ROW_KEY, randomCharOnlyName("rowKeyB", 20)); + entityB.put(ROW_KEY, testResourceNamer.randomName("rowKeyB", 20)); insertNoETag(tableName, entityB); int expectedStatusCode = 200; @@ -416,19 +415,19 @@ void queryEntityWithSelect() { // Arrange String requestId = testResourceNamer.randomUuid(); QueryOptions queryOptions = new QueryOptions().setFormat(OdataMetadataFormat.APPLICATION_JSON_ODATA_FULLMETADATA); - String tableName = randomCharOnlyName("test", 20); + String tableName = testResourceNamer.randomName("test", 20); createTable(tableName); //insert entity A Map entityA = new HashMap<>(); - String partitionKeyEntityA = randomCharOnlyName("partitionKeyA", 20); - String rowKeyEntityA = randomCharOnlyName("rowKeyA", 20); + String partitionKeyEntityA = testResourceNamer.randomName("partitionKeyA", 20); + String rowKeyEntityA = testResourceNamer.randomName("rowKeyA", 20); entityA.put(PARTITION_KEY, partitionKeyEntityA); entityA.put(ROW_KEY, rowKeyEntityA); insertNoETag(tableName, entityA); //insert entity B Map entityB = new HashMap<>(); - String partitionKeyEntityB = randomCharOnlyName("partitionKeyB", 20); - String rowKeyEntityB = randomCharOnlyName("rowKeyB", 20); + String partitionKeyEntityB = testResourceNamer.randomName("partitionKeyB", 20); + String rowKeyEntityB = testResourceNamer.randomName("rowKeyB", 20); entityB.put(PARTITION_KEY, partitionKeyEntityB); entityB.put(ROW_KEY, rowKeyEntityB); insertNoETag(tableName, entityB); @@ -453,12 +452,12 @@ void queryEntityWithFilter() { // Arrange String requestId = testResourceNamer.randomUuid(); QueryOptions queryOptions = new QueryOptions().setFormat(OdataMetadataFormat.APPLICATION_JSON_ODATA_FULLMETADATA); - String tableName = randomCharOnlyName("test", 20); + String tableName = testResourceNamer.randomName("test", 20); createTable(tableName); Map entityA = new HashMap<>(); - String partitionKeyEntityA = randomCharOnlyName("partitionKeyA", 20); + String partitionKeyEntityA = testResourceNamer.randomName("partitionKeyA", 20); entityA.put(PARTITION_KEY, partitionKeyEntityA); - entityA.put(ROW_KEY, randomCharOnlyName("rowKeyA", 20)); + entityA.put(ROW_KEY, testResourceNamer.randomName("rowKeyA", 20)); insertNoETag(tableName, entityA); int expectedStatusCode = 200; queryOptions.setSelect(PARTITION_KEY + "eq" + partitionKeyEntityA); @@ -479,7 +478,7 @@ void queryEntityWithTop() { // Arrange String requestId = testResourceNamer.randomUuid(); QueryOptions queryOptions = new QueryOptions().setFormat(OdataMetadataFormat.APPLICATION_JSON_ODATA_FULLMETADATA); - String tableName = randomCharOnlyName("test", 20); + String tableName = testResourceNamer.randomName("test", 20); createTable(tableName); int expectedStatusCode = 200; queryOptions.setTop(0); @@ -500,18 +499,18 @@ void queryEntityWithTop() { void queryEntitiesWithPartitionAndRowKey() { // Arrange QueryOptions queryOptions = new QueryOptions().setFormat(OdataMetadataFormat.APPLICATION_JSON_ODATA_FULLMETADATA); - String tableName = randomCharOnlyName("test", 20); + String tableName = testResourceNamer.randomName("test", 20); createTable(tableName); Map properties = new HashMap<>(); - String partitionKeyValue = randomCharOnlyName("partitionKey", 20); - String rowKeyValue = randomCharOnlyName("rowKey", 20); + String partitionKeyValue = testResourceNamer.randomName("partitionKey", 20); + String rowKeyValue = testResourceNamer.randomName("rowKey", 20); properties.put(PARTITION_KEY, partitionKeyValue); properties.put(ROW_KEY, rowKeyValue); insertNoETag(tableName, properties); // Act & Assert StepVerifier.create(azureTable.getTables().queryEntitiesWithPartitionAndRowKeyWithResponseAsync(tableName, partitionKeyValue, - rowKeyValue, TIMEOUT, UUID.randomUUID().toString(), queryOptions, Context.NONE)) + rowKeyValue, TIMEOUT, testResourceNamer.randomUuid(), queryOptions, Context.NONE)) .assertNext(response -> { Assertions.assertEquals(200, response.getStatusCode()); }) diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/createTable.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/createTable.json new file mode 100644 index 000000000000..0d5bbc89624a --- /dev/null +++ b/sdk/tables/azure-data-tables/src/test/resources/session-records/createTable.json @@ -0,0 +1,71 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "a9d78bb2-d164-4813-a68a-21b1d869f95a", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Wed, 01 Jul 2020 12:52:39 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "a7b4297d-9002-00a7-1ba6-4fbd3f000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"test76690b6b34\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "a9d78bb2-d164-4813-a68a-21b1d869f95a", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/Tables('test76690b6b34')" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "5c690d2f-1bed-4a8a-b3d5-bd2e16abb60b" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "ad30c2d1-f002-0018-17a6-4f8a9a000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"test76690b6b34\"}]}", + "Date" : "Wed, 01 Jul 2020 12:52:39 GMT", + "x-ms-client-request-id" : "5c690d2f-1bed-4a8a-b3d5-bd2e16abb60b", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('test76690b6b34')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "5e96da64-2fbc-4c80-97e0-2a9bc5d027d2" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "093a81a1-5002-005c-2fa6-4f00a5000000", + "Date" : "Wed, 01 Jul 2020 12:52:40 GMT", + "x-ms-client-request-id" : "5e96da64-2fbc-4c80-97e0-2a9bc5d027d2" + }, + "Exception" : null + } ], + "variables" : [ "test76690b6b34", "a9d78bb2-d164-4813-a68a-21b1d869f95a", "5c690d2f-1bed-4a8a-b3d5-bd2e16abb60b", "5e96da64-2fbc-4c80-97e0-2a9bc5d027d2" ] +} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/createTableDuplicateName.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/createTableDuplicateName.json new file mode 100644 index 000000000000..45f7ff918c26 --- /dev/null +++ b/sdk/tables/azure-data-tables/src/test/resources/session-records/createTableDuplicateName.json @@ -0,0 +1,95 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "409a82ad-e287-44d1-a690-5bd4ef967ed6", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Wed, 01 Jul 2020 12:52:39 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "ad30c29a-f002-0018-67a6-4f8a9a000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"test58120f3142\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "409a82ad-e287-44d1-a690-5bd4ef967ed6", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/Tables('test58120f3142')" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "fd6fdf4f-e5d8-4103-8701-57186d499031", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "409", + "Date" : "Wed, 01 Jul 2020 12:52:39 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "a7b42973-9002-00a7-13a6-4fbd3f000000", + "Body" : "{\"odata.error\":{\"code\":\"TableAlreadyExists\",\"message\":{\"lang\":\"en-US\",\"value\":\"The table specified already exists.\\nRequestId:a7b42973-9002-00a7-13a6-4fbd3f000000\\nTime:2020-07-01T12:52:40.2918342Z\"}}}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "fd6fdf4f-e5d8-4103-8701-57186d499031", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "e65b82b8-5f45-45f5-8782-599e35dce293" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "ad30c2ab-f002-0018-74a6-4f8a9a000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"test58120f3142\"}]}", + "Date" : "Wed, 01 Jul 2020 12:52:39 GMT", + "x-ms-client-request-id" : "e65b82b8-5f45-45f5-8782-599e35dce293", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('test58120f3142')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "2556776e-fbcd-4604-8e29-7704e4d660b8" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "a7b42976-9002-00a7-15a6-4fbd3f000000", + "Date" : "Wed, 01 Jul 2020 12:52:39 GMT", + "x-ms-client-request-id" : "2556776e-fbcd-4604-8e29-7704e4d660b8" + }, + "Exception" : null + } ], + "variables" : [ "test58120f3142", "409a82ad-e287-44d1-a690-5bd4ef967ed6", "fd6fdf4f-e5d8-4103-8701-57186d499031", "e65b82b8-5f45-45f5-8782-599e35dce293", "2556776e-fbcd-4604-8e29-7704e4d660b8" ] +} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/deleteEntity.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/deleteEntity.json new file mode 100644 index 000000000000..a25b9a7b1b4d --- /dev/null +++ b/sdk/tables/azure-data-tables/src/test/resources/session-records/deleteEntity.json @@ -0,0 +1,117 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "faafc5c0-590f-40a3-97f4-ebcfb9000c96", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Wed, 01 Jul 2020 12:52:39 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "ad30c273-f002-0018-42a6-4f8a9a000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"test245874b810\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "faafc5c0-590f-40a3-97f4-ebcfb9000c96", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/Tables('test245874b810')" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/test245874b810?timeout=5000", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "624270cf-d95d-4534-90e7-557fc3aa5072", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Wed, 01 Jul 2020 12:52:39 GMT", + "Cache-Control" : "no-cache", + "ETag" : "W/\"datetime'2020-07-01T12%3A52%3A39.957606Z'\"", + "x-ms-request-id" : "a7b42962-9002-00a7-06a6-4fbd3f000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#test245874b810/@Element\",\"odata.etag\":\"W/\\\"datetime'2020-07-01T12%3A52%3A39.957606Z'\\\"\",\"PartitionKey\":\"partitionkey59485f\",\"RowKey\":\"rowkey62777e872\",\"Timestamp\":\"2020-07-01T12:52:39.957606Z\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "624270cf-d95d-4534-90e7-557fc3aa5072", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/test245874b810(PartitionKey='partitionkey59485f',RowKey='rowkey62777e872')" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/test245874b810(PartitionKey='partitionkey59485f',RowKey='rowkey62777e872')?timeout=5000", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "ccd134fc-ef83-422d-837e-29fc76d2e714" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "ad30c27f-f002-0018-4da6-4f8a9a000000", + "Date" : "Wed, 01 Jul 2020 12:52:39 GMT", + "x-ms-client-request-id" : "ccd134fc-ef83-422d-837e-29fc76d2e714" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "c141cf5a-fea3-4063-986a-e678ebd1ef73" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "a7b42967-9002-00a7-09a6-4fbd3f000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"test245874b810\"}]}", + "Date" : "Wed, 01 Jul 2020 12:52:39 GMT", + "x-ms-client-request-id" : "c141cf5a-fea3-4063-986a-e678ebd1ef73", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('test245874b810')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "a03fed8f-d134-459d-a034-ecc1500936f2" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "ad30c286-f002-0018-54a6-4f8a9a000000", + "Date" : "Wed, 01 Jul 2020 12:52:39 GMT", + "x-ms-client-request-id" : "a03fed8f-d134-459d-a034-ecc1500936f2" + }, + "Exception" : null + } ], + "variables" : [ "test245874b810", "faafc5c0-590f-40a3-97f4-ebcfb9000c96", "partitionkey59485f", "rowkey62777e872", "ccd134fc-ef83-422d-837e-29fc76d2e714", "624270cf-d95d-4534-90e7-557fc3aa5072", "c141cf5a-fea3-4063-986a-e678ebd1ef73", "a03fed8f-d134-459d-a034-ecc1500936f2" ] +} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/deleteNonExistentEntity.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/deleteNonExistentEntity.json new file mode 100644 index 000000000000..32ae91b9bf69 --- /dev/null +++ b/sdk/tables/azure-data-tables/src/test/resources/session-records/deleteNonExistentEntity.json @@ -0,0 +1,93 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "8464dcea-160a-4522-be14-d2e36b9c63ea", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Wed, 01 Jul 2020 12:52:41 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "093a81b5-5002-005c-3ea6-4f00a5000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"test89907b301b\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "8464dcea-160a-4522-be14-d2e36b9c63ea", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/Tables('test89907b301b')" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/test89907b301b(PartitionKey='partitionkey208848',RowKey='rowkey218589688')?timeout=5000", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "7f7ff35f-5d51-460e-aeb1-51f3c8274fd2" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "404", + "x-ms-request-id" : "a7b4299e-9002-00a7-36a6-4fbd3f000000", + "Body" : "{\"odata.error\":{\"code\":\"ResourceNotFound\",\"message\":{\"lang\":\"en-US\",\"value\":\"The specified resource does not exist.\\nRequestId:a7b4299e-9002-00a7-36a6-4fbd3f000000\\nTime:2020-07-01T12:52:41.7468206Z\"}}}", + "Date" : "Wed, 01 Jul 2020 12:52:41 GMT", + "x-ms-client-request-id" : "7f7ff35f-5d51-460e-aeb1-51f3c8274fd2", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "384b2804-235c-494b-987c-670eb9bdf5d7" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "ad30c31e-f002-0018-5ea6-4f8a9a000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"test89907b301b\"}]}", + "Date" : "Wed, 01 Jul 2020 12:52:40 GMT", + "x-ms-client-request-id" : "384b2804-235c-494b-987c-670eb9bdf5d7", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('test89907b301b')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "6ec93e40-fd7b-4493-9a7d-550630d5c052" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "093a81b7-5002-005c-3fa6-4f00a5000000", + "Date" : "Wed, 01 Jul 2020 12:52:41 GMT", + "x-ms-client-request-id" : "6ec93e40-fd7b-4493-9a7d-550630d5c052" + }, + "Exception" : null + } ], + "variables" : [ "test89907b301b", "8464dcea-160a-4522-be14-d2e36b9c63ea", "partitionkey208848", "rowkey218589688", "7f7ff35f-5d51-460e-aeb1-51f3c8274fd2", "384b2804-235c-494b-987c-670eb9bdf5d7", "6ec93e40-fd7b-4493-9a7d-550630d5c052" ] +} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/deleteNonExistentTable.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/deleteNonExistentTable.json new file mode 100644 index 000000000000..f04c87092323 --- /dev/null +++ b/sdk/tables/azure-data-tables/src/test/resources/session-records/deleteNonExistentTable.json @@ -0,0 +1,48 @@ +{ + "networkCallRecords" : [ { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('test881632ce78')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "61e7d1cd-7f37-4a62-a9d4-e969489a4706" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "404", + "x-ms-request-id" : "a7b4299c-9002-00a7-34a6-4fbd3f000000", + "Body" : "{\"odata.error\":{\"code\":\"ResourceNotFound\",\"message\":{\"lang\":\"en-US\",\"value\":\"The specified resource does not exist.\\nRequestId:a7b4299c-9002-00a7-34a6-4fbd3f000000\\nTime:2020-07-01T12:52:41.6397487Z\"}}}", + "Date" : "Wed, 01 Jul 2020 12:52:40 GMT", + "x-ms-client-request-id" : "61e7d1cd-7f37-4a62-a9d4-e969489a4706", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "b1fd53e4-f5db-4f26-ada1-717078c65c32" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "ad30c318-f002-0018-58a6-4f8a9a000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[]}", + "Date" : "Wed, 01 Jul 2020 12:52:40 GMT", + "x-ms-client-request-id" : "b1fd53e4-f5db-4f26-ada1-717078c65c32", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ "test881632ce78", "61e7d1cd-7f37-4a62-a9d4-e969489a4706", "b1fd53e4-f5db-4f26-ada1-717078c65c32" ] +} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/deleteTable.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/deleteTable.json new file mode 100644 index 000000000000..d0a1c67478c8 --- /dev/null +++ b/sdk/tables/azure-data-tables/src/test/resources/session-records/deleteTable.json @@ -0,0 +1,71 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "e8dd6513-984c-4aca-b603-f2f2104b2e58", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Wed, 01 Jul 2020 12:52:39 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "a7b42970-9002-00a7-11a6-4fbd3f000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"test824812e297\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "e8dd6513-984c-4aca-b603-f2f2104b2e58", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/Tables('test824812e297')" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('test824812e297')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "2e02dc7f-2073-43e9-b115-d01fe9b5f2bd" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "ad30c28c-f002-0018-5aa6-4f8a9a000000", + "Date" : "Wed, 01 Jul 2020 12:52:39 GMT", + "x-ms-client-request-id" : "2e02dc7f-2073-43e9-b115-d01fe9b5f2bd" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "821a9e14-e040-4a42-a02f-edf44001f228" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "a7b42972-9002-00a7-12a6-4fbd3f000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[]}", + "Date" : "Wed, 01 Jul 2020 12:52:39 GMT", + "x-ms-client-request-id" : "821a9e14-e040-4a42-a02f-edf44001f228", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ "test824812e297", "e8dd6513-984c-4aca-b603-f2f2104b2e58", "2e02dc7f-2073-43e9-b115-d01fe9b5f2bd", "821a9e14-e040-4a42-a02f-edf44001f228" ] +} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/insertNoEtag.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/insertNoEtag.json new file mode 100644 index 000000000000..48c931e6931b --- /dev/null +++ b/sdk/tables/azure-data-tables/src/test/resources/session-records/insertNoEtag.json @@ -0,0 +1,97 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "b96e625c-77ad-4e5c-82cc-01cbaff22837", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Wed, 01 Jul 2020 12:52:41 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "093a81a8-5002-005c-34a6-4f00a5000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"test709465a8ae\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "b96e625c-77ad-4e5c-82cc-01cbaff22837", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/Tables('test709465a8ae')" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/test709465a8ae?timeout=5000", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "ff21f7df-3ce1-4000-a360-16a92b215bd6", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Wed, 01 Jul 2020 12:52:40 GMT", + "Cache-Control" : "no-cache", + "ETag" : "W/\"datetime'2020-07-01T12%3A52%3A41.1924458Z'\"", + "x-ms-request-id" : "a7b42990-9002-00a7-2ba6-4fbd3f000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#test709465a8ae/@Element\",\"odata.etag\":\"W/\\\"datetime'2020-07-01T12%3A52%3A41.1924458Z'\\\"\",\"PartitionKey\":\"partitionkey580821\",\"RowKey\":\"rowkey8284822cb\",\"Timestamp\":\"2020-07-01T12:52:41.1924458Z\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "ff21f7df-3ce1-4000-a360-16a92b215bd6", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/test709465a8ae(PartitionKey='partitionkey580821',RowKey='rowkey8284822cb')" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "df767a68-a3a3-40fc-b397-216f6056e6ee" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "ad30c2f8-f002-0018-3ba6-4f8a9a000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"test709465a8ae\"}]}", + "Date" : "Wed, 01 Jul 2020 12:52:40 GMT", + "x-ms-client-request-id" : "df767a68-a3a3-40fc-b397-216f6056e6ee", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('test709465a8ae')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "3fd87f61-cc43-4d33-9236-4cd79bbd6a44" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "093a81ac-5002-005c-37a6-4f00a5000000", + "Date" : "Wed, 01 Jul 2020 12:52:41 GMT", + "x-ms-client-request-id" : "3fd87f61-cc43-4d33-9236-4cd79bbd6a44" + }, + "Exception" : null + } ], + "variables" : [ "test709465a8ae", "b96e625c-77ad-4e5c-82cc-01cbaff22837", "partitionkey580821", "rowkey8284822cb", "ff21f7df-3ce1-4000-a360-16a92b215bd6", "df767a68-a3a3-40fc-b397-216f6056e6ee", "3fd87f61-cc43-4d33-9236-4cd79bbd6a44" ] +} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/mergeEntity.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/mergeEntity.json new file mode 100644 index 000000000000..7d06bcf3c62e --- /dev/null +++ b/sdk/tables/azure-data-tables/src/test/resources/session-records/mergeEntity.json @@ -0,0 +1,119 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "71e298e5-c839-4528-9059-c7f806d29fa3", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Wed, 01 Jul 2020 12:52:40 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "a7b42984-9002-00a7-21a6-4fbd3f000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"test745290e4fc\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "71e298e5-c839-4528-9059-c7f806d29fa3", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/Tables('test745290e4fc')" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/test745290e4fc?timeout=5000", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "12a068f7-4fe0-4d2b-a5c7-af9280c2f7cf", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Wed, 01 Jul 2020 12:52:40 GMT", + "Cache-Control" : "no-cache", + "ETag" : "W/\"datetime'2020-07-01T12%3A52%3A40.8214991Z'\"", + "x-ms-request-id" : "ad30c2d7-f002-0018-1da6-4f8a9a000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#test745290e4fc/@Element\",\"odata.etag\":\"W/\\\"datetime'2020-07-01T12%3A52%3A40.8214991Z'\\\"\",\"PartitionKey\":\"partitionkey47248f\",\"RowKey\":\"rowkey009805dad\",\"Timestamp\":\"2020-07-01T12:52:40.8214991Z\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "12a068f7-4fe0-4d2b-a5c7-af9280c2f7cf", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/test745290e4fc(PartitionKey='partitionkey47248f',RowKey='rowkey009805dad')" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.table.core.windows.net/test745290e4fc(PartitionKey='partitionkey47248f',RowKey='rowkey009805dad')?timeout=5000", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "0049a02f-1e93-4b0a-a7e1-8f886878baa1", + "Content-Type" : "application/json" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "ETag" : "W/\"datetime'2020-07-01T12%3A52%3A40.8629359Z'\"", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "093a81a3-5002-005c-31a6-4f00a5000000", + "Date" : "Wed, 01 Jul 2020 12:52:40 GMT", + "x-ms-client-request-id" : "0049a02f-1e93-4b0a-a7e1-8f886878baa1" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "8b78b847-eb4b-4476-82f3-b43dc21281ee" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "a7b42988-9002-00a7-24a6-4fbd3f000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"test745290e4fc\"}]}", + "Date" : "Wed, 01 Jul 2020 12:52:40 GMT", + "x-ms-client-request-id" : "8b78b847-eb4b-4476-82f3-b43dc21281ee", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('test745290e4fc')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "9f5787b2-5335-48d3-8cdf-cc5fd77d4d38" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "ad30c2dd-f002-0018-22a6-4f8a9a000000", + "Date" : "Wed, 01 Jul 2020 12:52:40 GMT", + "x-ms-client-request-id" : "9f5787b2-5335-48d3-8cdf-cc5fd77d4d38" + }, + "Exception" : null + } ], + "variables" : [ "test745290e4fc", "71e298e5-c839-4528-9059-c7f806d29fa3", "partitionkey47248f", "rowkey009805dad", "0049a02f-1e93-4b0a-a7e1-8f886878baa1", "12a068f7-4fe0-4d2b-a5c7-af9280c2f7cf", "dd2a873956ce4f0e", "8b78b847-eb4b-4476-82f3-b43dc21281ee", "9f5787b2-5335-48d3-8cdf-cc5fd77d4d38" ] +} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/mergeNonExistentEntity.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/mergeNonExistentEntity.json new file mode 100644 index 000000000000..c77796323013 --- /dev/null +++ b/sdk/tables/azure-data-tables/src/test/resources/session-records/mergeNonExistentEntity.json @@ -0,0 +1,94 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "301b8e99-69ca-4c62-a03e-6206aed65304", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Wed, 01 Jul 2020 12:52:38 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "ad30c261-f002-0018-32a6-4f8a9a000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"test64434b87bf\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "301b8e99-69ca-4c62-a03e-6206aed65304", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/Tables('test64434b87bf')" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.table.core.windows.net/test64434b87bf(PartitionKey='partitionkey223364',RowKey='rowkey2745830d2')?timeout=5000", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "e5e62ece-8996-4f2d-abd4-437c45a80aad", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "404", + "x-ms-request-id" : "a7b42955-9002-00a7-7aa6-4fbd3f000000", + "Body" : "{\"odata.error\":{\"code\":\"ResourceNotFound\",\"message\":{\"lang\":\"en-US\",\"value\":\"The specified resource does not exist.\\nRequestId:a7b42955-9002-00a7-7aa6-4fbd3f000000\\nTime:2020-07-01T12:52:39.8135080Z\"}}}", + "Date" : "Wed, 01 Jul 2020 12:52:39 GMT", + "x-ms-client-request-id" : "e5e62ece-8996-4f2d-abd4-437c45a80aad", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "591ca6f1-7768-447a-8d32-800669d83f0b" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "ad30c26b-f002-0018-3ba6-4f8a9a000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"test64434b87bf\"}]}", + "Date" : "Wed, 01 Jul 2020 12:52:39 GMT", + "x-ms-client-request-id" : "591ca6f1-7768-447a-8d32-800669d83f0b", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('test64434b87bf')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "cdf4d28d-1808-4511-8016-3c0ab4f39d59" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "a7b4295c-9002-00a7-80a6-4fbd3f000000", + "Date" : "Wed, 01 Jul 2020 12:52:39 GMT", + "x-ms-client-request-id" : "cdf4d28d-1808-4511-8016-3c0ab4f39d59" + }, + "Exception" : null + } ], + "variables" : [ "test64434b87bf", "301b8e99-69ca-4c62-a03e-6206aed65304", "partitionkey223364", "rowkey2745830d2", "e5e62ece-8996-4f2d-abd4-437c45a80aad", "591ca6f1-7768-447a-8d32-800669d83f0b", "cdf4d28d-1808-4511-8016-3c0ab4f39d59" ] +} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntitiesWithPartitionAndRowKey.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntitiesWithPartitionAndRowKey.json new file mode 100644 index 000000000000..899365e47b0b --- /dev/null +++ b/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntitiesWithPartitionAndRowKey.json @@ -0,0 +1,120 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "32944c6a-6cc0-4205-ada4-e8cb6d089087", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Wed, 01 Jul 2020 12:52:40 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "ad30c30a-f002-0018-4ba6-4f8a9a000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"test15500468dc\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "32944c6a-6cc0-4205-ada4-e8cb6d089087", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/Tables('test15500468dc')" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/test15500468dc?timeout=5000", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "b1ff3069-6dd1-490b-b946-2cf3d7e6dd91", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Wed, 01 Jul 2020 12:52:41 GMT", + "Cache-Control" : "no-cache", + "ETag" : "W/\"datetime'2020-07-01T12%3A52%3A41.4917242Z'\"", + "x-ms-request-id" : "093a81b1-5002-005c-3ca6-4f00a5000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#test15500468dc/@Element\",\"odata.etag\":\"W/\\\"datetime'2020-07-01T12%3A52%3A41.4917242Z'\\\"\",\"PartitionKey\":\"partitionkey919688\",\"RowKey\":\"rowkey745419b2d\",\"Timestamp\":\"2020-07-01T12:52:41.4917242Z\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "b1ff3069-6dd1-490b-b946-2cf3d7e6dd91", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/test15500468dc(PartitionKey='partitionkey919688',RowKey='rowkey745419b2d')" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/test15500468dc(PartitionKey='partitionkey919688',RowKey='rowkey745419b2d')?timeout=5000&$format=application/json%3Bodata%3Dfullmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "97019a59-d27d-4d13-b68b-3317a67fe8e0" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Wed, 01 Jul 2020 12:52:40 GMT", + "Cache-Control" : "no-cache", + "ETag" : "W/\"datetime'2020-07-01T12%3A52%3A41.4917242Z'\"", + "x-ms-request-id" : "a7b4299a-9002-00a7-33a6-4fbd3f000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#test15500468dc/@Element\",\"odata.type\":\"telboytrial.test15500468dc\",\"odata.id\":\"https://telboytrial.table.core.windows.net/test15500468dc(PartitionKey='partitionkey919688',RowKey='rowkey745419b2d')\",\"odata.etag\":\"W/\\\"datetime'2020-07-01T12%3A52%3A41.4917242Z'\\\"\",\"odata.editLink\":\"test15500468dc(PartitionKey='partitionkey919688',RowKey='rowkey745419b2d')\",\"PartitionKey\":\"partitionkey919688\",\"RowKey\":\"rowkey745419b2d\",\"Timestamp@odata.type\":\"Edm.DateTime\",\"Timestamp\":\"2020-07-01T12:52:41.4917242Z\"}", + "x-ms-client-request-id" : "97019a59-d27d-4d13-b68b-3317a67fe8e0", + "Content-Type" : "application/json;odata=fullmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "0fc71aea-dec3-4afb-9180-f1007e031de5" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "ad30c312-f002-0018-52a6-4f8a9a000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"test15500468dc\"}]}", + "Date" : "Wed, 01 Jul 2020 12:52:40 GMT", + "x-ms-client-request-id" : "0fc71aea-dec3-4afb-9180-f1007e031de5", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('test15500468dc')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "91e1e3f0-735a-4a55-9d48-43b394164315" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "093a81b4-5002-005c-3da6-4f00a5000000", + "Date" : "Wed, 01 Jul 2020 12:52:41 GMT", + "x-ms-client-request-id" : "91e1e3f0-735a-4a55-9d48-43b394164315" + }, + "Exception" : null + } ], + "variables" : [ "test15500468dc", "32944c6a-6cc0-4205-ada4-e8cb6d089087", "partitionkey919688", "rowkey745419b2d", "b1ff3069-6dd1-490b-b946-2cf3d7e6dd91", "97019a59-d27d-4d13-b68b-3317a67fe8e0", "0fc71aea-dec3-4afb-9180-f1007e031de5", "91e1e3f0-735a-4a55-9d48-43b394164315" ] +} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntity.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntity.json new file mode 100644 index 000000000000..fa3d704d7dc9 --- /dev/null +++ b/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntity.json @@ -0,0 +1,145 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "feaa79a2-f371-43cd-82da-16db350de78e", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Wed, 01 Jul 2020 12:52:38 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "a7b42905-9002-00a7-33a6-4fbd3f000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"test39546bcdb2\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "feaa79a2-f371-43cd-82da-16db350de78e", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/Tables('test39546bcdb2')" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/test39546bcdb2?timeout=5000", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "425426f6-366e-4d3b-bcb1-76e3e4c049c5", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Wed, 01 Jul 2020 12:52:38 GMT", + "Cache-Control" : "no-cache", + "ETag" : "W/\"datetime'2020-07-01T12%3A52%3A38.9901948Z'\"", + "x-ms-request-id" : "ad30c21e-f002-0018-77a6-4f8a9a000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#test39546bcdb2/@Element\",\"odata.etag\":\"W/\\\"datetime'2020-07-01T12%3A52%3A38.9901948Z'\\\"\",\"PartitionKey\":\"partitionkeya18693a\",\"RowKey\":\"rowkeya648351502\",\"Timestamp\":\"2020-07-01T12:52:38.9901948Z\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "425426f6-366e-4d3b-bcb1-76e3e4c049c5", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/test39546bcdb2(PartitionKey='partitionkeya18693a',RowKey='rowkeya648351502')" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/test39546bcdb2?timeout=5000", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "8ea2563b-487a-42b2-947c-74e7ea6844e3", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Wed, 01 Jul 2020 12:52:38 GMT", + "Cache-Control" : "no-cache", + "ETag" : "W/\"datetime'2020-07-01T12%3A52%3A39.0259727Z'\"", + "x-ms-request-id" : "a7b4290b-9002-00a7-38a6-4fbd3f000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#test39546bcdb2/@Element\",\"odata.etag\":\"W/\\\"datetime'2020-07-01T12%3A52%3A39.0259727Z'\\\"\",\"PartitionKey\":\"partitionkeyb950639\",\"RowKey\":\"rowkeyb2421336ba\",\"Timestamp\":\"2020-07-01T12:52:39.0259727Z\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "8ea2563b-487a-42b2-947c-74e7ea6844e3", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/test39546bcdb2(PartitionKey='partitionkeyb950639',RowKey='rowkeyb2421336ba')" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/test39546bcdb2()?timeout=5000&$format=application/json%3Bodata%3Dfullmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "d3c82523-db05-42a3-8132-bafca143a596" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "ad30c227-f002-0018-7da6-4f8a9a000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#test39546bcdb2\",\"value\":[{\"odata.type\":\"telboytrial.test39546bcdb2\",\"odata.id\":\"https://telboytrial.table.core.windows.net/test39546bcdb2(PartitionKey='partitionkeya18693a',RowKey='rowkeya648351502')\",\"odata.etag\":\"W/\\\"datetime'2020-07-01T12%3A52%3A38.9901948Z'\\\"\",\"odata.editLink\":\"test39546bcdb2(PartitionKey='partitionkeya18693a',RowKey='rowkeya648351502')\",\"PartitionKey\":\"partitionkeya18693a\",\"RowKey\":\"rowkeya648351502\",\"Timestamp@odata.type\":\"Edm.DateTime\",\"Timestamp\":\"2020-07-01T12:52:38.9901948Z\"},{\"odata.type\":\"telboytrial.test39546bcdb2\",\"odata.id\":\"https://telboytrial.table.core.windows.net/test39546bcdb2(PartitionKey='partitionkeyb950639',RowKey='rowkeyb2421336ba')\",\"odata.etag\":\"W/\\\"datetime'2020-07-01T12%3A52%3A39.0259727Z'\\\"\",\"odata.editLink\":\"test39546bcdb2(PartitionKey='partitionkeyb950639',RowKey='rowkeyb2421336ba')\",\"PartitionKey\":\"partitionkeyb950639\",\"RowKey\":\"rowkeyb2421336ba\",\"Timestamp@odata.type\":\"Edm.DateTime\",\"Timestamp\":\"2020-07-01T12:52:39.0259727Z\"}]}", + "Date" : "Wed, 01 Jul 2020 12:52:38 GMT", + "x-ms-client-request-id" : "d3c82523-db05-42a3-8132-bafca143a596", + "Content-Type" : "application/json;odata=fullmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "360ce089-b9d9-46de-a719-c6ab14840f76" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "a7b42919-9002-00a7-44a6-4fbd3f000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"test39546bcdb2\"}]}", + "Date" : "Wed, 01 Jul 2020 12:52:38 GMT", + "x-ms-client-request-id" : "360ce089-b9d9-46de-a719-c6ab14840f76", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('test39546bcdb2')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "5b5d25d6-101f-43b2-95fa-3a969e922205" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "ad30c231-f002-0018-05a6-4f8a9a000000", + "Date" : "Wed, 01 Jul 2020 12:52:38 GMT", + "x-ms-client-request-id" : "5b5d25d6-101f-43b2-95fa-3a969e922205" + }, + "Exception" : null + } ], + "variables" : [ "d3c82523-db05-42a3-8132-bafca143a596", "test39546bcdb2", "feaa79a2-f371-43cd-82da-16db350de78e", "partitionkeya18693a", "rowkeya648351502", "425426f6-366e-4d3b-bcb1-76e3e4c049c5", "partitionkeyb950639", "rowkeyb2421336ba", "8ea2563b-487a-42b2-947c-74e7ea6844e3", "360ce089-b9d9-46de-a719-c6ab14840f76", "5b5d25d6-101f-43b2-95fa-3a969e922205" ] +} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntityWithFilter.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntityWithFilter.json new file mode 100644 index 000000000000..70f032f32508 --- /dev/null +++ b/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntityWithFilter.json @@ -0,0 +1,119 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "fa5f279a-f9de-43a9-ab5e-f6e670bc5a81", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Wed, 01 Jul 2020 12:52:37 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "a7b428e4-9002-00a7-18a6-4fbd3f000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"test16410dc76b\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "fa5f279a-f9de-43a9-ab5e-f6e670bc5a81", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/Tables('test16410dc76b')" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/test16410dc76b?timeout=5000", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "99facfde-f2f2-439d-af41-eb234ad456a1", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Wed, 01 Jul 2020 12:52:37 GMT", + "Cache-Control" : "no-cache", + "ETag" : "W/\"datetime'2020-07-01T12%3A52%3A38.5556524Z'\"", + "x-ms-request-id" : "a7b428f4-9002-00a7-22a6-4fbd3f000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#test16410dc76b/@Element\",\"odata.etag\":\"W/\\\"datetime'2020-07-01T12%3A52%3A38.5556524Z'\\\"\",\"PartitionKey\":\"partitionkeya52522a\",\"RowKey\":\"rowkeya5870843ae\",\"Timestamp\":\"2020-07-01T12:52:38.5556524Z\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "99facfde-f2f2-439d-af41-eb234ad456a1", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/test16410dc76b(PartitionKey='partitionkeya52522a',RowKey='rowkeya5870843ae')" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/test16410dc76b()?timeout=5000&$format=application/json%3Bodata%3Dfullmetadata&$select=PartitionKeyeqpartitionkeya52522a", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "64b80104-3a4c-400d-ba72-c49075f2e2ca" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "a7b428f7-9002-00a7-25a6-4fbd3f000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#test16410dc76b&$select=PartitionKeyeqpartitionkeya52522a\",\"value\":[{\"odata.type\":\"telboytrial.test16410dc76b\",\"odata.id\":\"https://telboytrial.table.core.windows.net/test16410dc76b(PartitionKey='partitionkeya52522a',RowKey='rowkeya5870843ae')\",\"odata.etag\":\"W/\\\"datetime'2020-07-01T12%3A52%3A38.5556524Z'\\\"\",\"odata.editLink\":\"test16410dc76b(PartitionKey='partitionkeya52522a',RowKey='rowkeya5870843ae')\",\"PartitionKeyeqpartitionkeya52522a\":null}]}", + "Date" : "Wed, 01 Jul 2020 12:52:37 GMT", + "x-ms-client-request-id" : "64b80104-3a4c-400d-ba72-c49075f2e2ca", + "Content-Type" : "application/json;odata=fullmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "dac0dce8-b1ff-4ea8-a704-59f98ffc2812" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "a7b428fa-9002-00a7-28a6-4fbd3f000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"test16410dc76b\"}]}", + "Date" : "Wed, 01 Jul 2020 12:52:37 GMT", + "x-ms-client-request-id" : "dac0dce8-b1ff-4ea8-a704-59f98ffc2812", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('test16410dc76b')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "569436a7-afa3-448e-b73f-a9f02221d11d" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "ad30c214-f002-0018-6ea6-4f8a9a000000", + "Date" : "Wed, 01 Jul 2020 12:52:38 GMT", + "x-ms-client-request-id" : "569436a7-afa3-448e-b73f-a9f02221d11d" + }, + "Exception" : null + } ], + "variables" : [ "64b80104-3a4c-400d-ba72-c49075f2e2ca", "test16410dc76b", "fa5f279a-f9de-43a9-ab5e-f6e670bc5a81", "partitionkeya52522a", "rowkeya5870843ae", "99facfde-f2f2-439d-af41-eb234ad456a1", "dac0dce8-b1ff-4ea8-a704-59f98ffc2812", "569436a7-afa3-448e-b73f-a9f02221d11d" ] +} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntityWithSelect.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntityWithSelect.json new file mode 100644 index 000000000000..bdfed955aca6 --- /dev/null +++ b/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntityWithSelect.json @@ -0,0 +1,145 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "20f2e3e7-8c5b-404e-a83d-d5261fdc7fd1", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Wed, 01 Jul 2020 12:52:38 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "a7b4291f-9002-00a7-4aa6-4fbd3f000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"test804717a76b\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "20f2e3e7-8c5b-404e-a83d-d5261fdc7fd1", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/Tables('test804717a76b')" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/test804717a76b?timeout=5000", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "2e55ea16-a416-4391-93fc-785127f6a336", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Wed, 01 Jul 2020 12:52:38 GMT", + "Cache-Control" : "no-cache", + "ETag" : "W/\"datetime'2020-07-01T12%3A52%3A39.2383714Z'\"", + "x-ms-request-id" : "ad30c237-f002-0018-0ba6-4f8a9a000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#test804717a76b/@Element\",\"odata.etag\":\"W/\\\"datetime'2020-07-01T12%3A52%3A39.2383714Z'\\\"\",\"PartitionKey\":\"partitionkeya938347\",\"RowKey\":\"rowkeya839234295\",\"Timestamp\":\"2020-07-01T12:52:39.2383714Z\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "2e55ea16-a416-4391-93fc-785127f6a336", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/test804717a76b(PartitionKey='partitionkeya938347',RowKey='rowkeya839234295')" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/test804717a76b?timeout=5000", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "65f5dce9-21be-4462-bd3f-6736343767a5", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Wed, 01 Jul 2020 12:52:38 GMT", + "Cache-Control" : "no-cache", + "ETag" : "W/\"datetime'2020-07-01T12%3A52%3A39.280146Z'\"", + "x-ms-request-id" : "a7b4292b-9002-00a7-55a6-4fbd3f000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#test804717a76b/@Element\",\"odata.etag\":\"W/\\\"datetime'2020-07-01T12%3A52%3A39.280146Z'\\\"\",\"PartitionKey\":\"partitionkeyb202403\",\"RowKey\":\"rowkeyb00625d7c9\",\"Timestamp\":\"2020-07-01T12:52:39.280146Z\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "65f5dce9-21be-4462-bd3f-6736343767a5", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/test804717a76b(PartitionKey='partitionkeyb202403',RowKey='rowkeyb00625d7c9')" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/test804717a76b()?timeout=5000&$format=application/json%3Bodata%3Dfullmetadata&$select=RowKey", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "4bc9fc6b-09cf-494e-b91c-c1959b93f02b" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "ad30c23f-f002-0018-12a6-4f8a9a000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#test804717a76b&$select=RowKey\",\"value\":[{\"odata.type\":\"telboytrial.test804717a76b\",\"odata.id\":\"https://telboytrial.table.core.windows.net/test804717a76b(PartitionKey='partitionkeya938347',RowKey='rowkeya839234295')\",\"odata.etag\":\"W/\\\"datetime'2020-07-01T12%3A52%3A39.2383714Z'\\\"\",\"odata.editLink\":\"test804717a76b(PartitionKey='partitionkeya938347',RowKey='rowkeya839234295')\",\"RowKey\":\"rowkeya839234295\"},{\"odata.type\":\"telboytrial.test804717a76b\",\"odata.id\":\"https://telboytrial.table.core.windows.net/test804717a76b(PartitionKey='partitionkeyb202403',RowKey='rowkeyb00625d7c9')\",\"odata.etag\":\"W/\\\"datetime'2020-07-01T12%3A52%3A39.280146Z'\\\"\",\"odata.editLink\":\"test804717a76b(PartitionKey='partitionkeyb202403',RowKey='rowkeyb00625d7c9')\",\"RowKey\":\"rowkeyb00625d7c9\"}]}", + "Date" : "Wed, 01 Jul 2020 12:52:38 GMT", + "x-ms-client-request-id" : "4bc9fc6b-09cf-494e-b91c-c1959b93f02b", + "Content-Type" : "application/json;odata=fullmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "e94f1b63-444b-422e-b5a0-2f153347edc1" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "a7b42931-9002-00a7-5ba6-4fbd3f000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"test804717a76b\"}]}", + "Date" : "Wed, 01 Jul 2020 12:52:38 GMT", + "x-ms-client-request-id" : "e94f1b63-444b-422e-b5a0-2f153347edc1", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('test804717a76b')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "a0f62d48-3844-4ae0-94ef-964d36d30034" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "ad30c243-f002-0018-16a6-4f8a9a000000", + "Date" : "Wed, 01 Jul 2020 12:52:38 GMT", + "x-ms-client-request-id" : "a0f62d48-3844-4ae0-94ef-964d36d30034" + }, + "Exception" : null + } ], + "variables" : [ "4bc9fc6b-09cf-494e-b91c-c1959b93f02b", "test804717a76b", "20f2e3e7-8c5b-404e-a83d-d5261fdc7fd1", "partitionkeya938347", "rowkeya839234295", "2e55ea16-a416-4391-93fc-785127f6a336", "partitionkeyb202403", "rowkeyb00625d7c9", "65f5dce9-21be-4462-bd3f-6736343767a5", "e94f1b63-444b-422e-b5a0-2f153347edc1", "a0f62d48-3844-4ae0-94ef-964d36d30034" ] +} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntityWithTop.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntityWithTop.json new file mode 100644 index 000000000000..9ec2f5951763 --- /dev/null +++ b/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntityWithTop.json @@ -0,0 +1,93 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "bdc0fab6-7a19-4191-93ea-1892ef601015", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Wed, 01 Jul 2020 12:52:38 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "a7b42938-9002-00a7-61a6-4fbd3f000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"test14071c6635\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "bdc0fab6-7a19-4191-93ea-1892ef601015", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/Tables('test14071c6635')" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/test14071c6635()?timeout=5000&$format=application/json%3Bodata%3Dfullmetadata&$top=0", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "5721d6ef-c1e8-4729-8f7e-ca0520778ba2" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "ad30c249-f002-0018-1ca6-4f8a9a000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#test14071c6635\",\"value\":[]}", + "Date" : "Wed, 01 Jul 2020 12:52:38 GMT", + "x-ms-client-request-id" : "5721d6ef-c1e8-4729-8f7e-ca0520778ba2", + "Content-Type" : "application/json;odata=fullmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "0367e980-ed8d-448b-8096-4bd6abc6b58a" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "a7b4293d-9002-00a7-65a6-4fbd3f000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"test14071c6635\"}]}", + "Date" : "Wed, 01 Jul 2020 12:52:38 GMT", + "x-ms-client-request-id" : "0367e980-ed8d-448b-8096-4bd6abc6b58a", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('test14071c6635')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "2b3f0ad8-5cca-47c1-8d30-8f622b8c2a93" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "ad30c24e-f002-0018-20a6-4f8a9a000000", + "Date" : "Wed, 01 Jul 2020 12:52:38 GMT", + "x-ms-client-request-id" : "2b3f0ad8-5cca-47c1-8d30-8f622b8c2a93" + }, + "Exception" : null + } ], + "variables" : [ "5721d6ef-c1e8-4729-8f7e-ca0520778ba2", "test14071c6635", "bdc0fab6-7a19-4191-93ea-1892ef601015", "0367e980-ed8d-448b-8096-4bd6abc6b58a", "2b3f0ad8-5cca-47c1-8d30-8f622b8c2a93" ] +} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/queryTable.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/queryTable.json new file mode 100644 index 000000000000..e7903c311e59 --- /dev/null +++ b/sdk/tables/azure-data-tables/src/test/resources/session-records/queryTable.json @@ -0,0 +1,138 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "77786073-56cf-42b7-a61a-da070c403604", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Wed, 01 Jul 2020 12:52:40 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "093a81a5-5002-005c-32a6-4f00a5000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"atesta467458233\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "77786073-56cf-42b7-a61a-da070c403604", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/Tables('atesta467458233')" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "135a7f14-fe28-49f2-9252-a25d10dfebd7", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Wed, 01 Jul 2020 12:52:40 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "a7b4298b-9002-00a7-27a6-4fbd3f000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"btestb450627457\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "135a7f14-fe28-49f2-9252-a25d10dfebd7", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/Tables('btestb450627457')" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "6fc2e7ed-3c0d-401d-93b2-351725baeb74" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "ad30c2e4-f002-0018-29a6-4f8a9a000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"atesta467458233\"},{\"TableName\":\"btestb450627457\"}]}", + "Date" : "Wed, 01 Jul 2020 12:52:40 GMT", + "x-ms-client-request-id" : "6fc2e7ed-3c0d-401d-93b2-351725baeb74", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "aafd20ad-99b4-4698-a298-77ffb0610937" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "093a81a7-5002-005c-33a6-4f00a5000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"atesta467458233\"},{\"TableName\":\"btestb450627457\"}]}", + "Date" : "Wed, 01 Jul 2020 12:52:41 GMT", + "x-ms-client-request-id" : "aafd20ad-99b4-4698-a298-77ffb0610937", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('atesta467458233')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "1adcd7f8-ae5d-4d85-8b75-cf7dc7e5a605" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "a7b4298e-9002-00a7-29a6-4fbd3f000000", + "Date" : "Wed, 01 Jul 2020 12:52:40 GMT", + "x-ms-client-request-id" : "1adcd7f8-ae5d-4d85-8b75-cf7dc7e5a605" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('btestb450627457')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "848749a5-30f4-4de5-8d1b-c60f00ed547b" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "ad30c2ed-f002-0018-30a6-4f8a9a000000", + "Date" : "Wed, 01 Jul 2020 12:52:40 GMT", + "x-ms-client-request-id" : "848749a5-30f4-4de5-8d1b-c60f00ed547b" + }, + "Exception" : null + } ], + "variables" : [ "atesta467458233", "btestb450627457", "77786073-56cf-42b7-a61a-da070c403604", "135a7f14-fe28-49f2-9252-a25d10dfebd7", "6fc2e7ed-3c0d-401d-93b2-351725baeb74", "aafd20ad-99b4-4698-a298-77ffb0610937", "1adcd7f8-ae5d-4d85-8b75-cf7dc7e5a605", "848749a5-30f4-4de5-8d1b-c60f00ed547b" ] +} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/queryTablewithTop.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/queryTablewithTop.json new file mode 100644 index 000000000000..5fe4ef604300 --- /dev/null +++ b/sdk/tables/azure-data-tables/src/test/resources/session-records/queryTablewithTop.json @@ -0,0 +1,139 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "848bd698-011a-46ed-a001-7aafa978d96a", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Wed, 01 Jul 2020 12:52:39 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "ad30c2b2-f002-0018-7ba6-4f8a9a000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"atesta47573650a\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "848bd698-011a-46ed-a001-7aafa978d96a", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/Tables('atesta47573650a')" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "cceecbc5-ea58-4939-bba3-f7b0f9e157c6", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Wed, 01 Jul 2020 12:52:39 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "a7b42979-9002-00a7-18a6-4fbd3f000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"btestb491748d98\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "cceecbc5-ea58-4939-bba3-f7b0f9e157c6", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/Tables('btestb491748d98')" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata&$top=1", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "7c98cfbf-7d63-4aa3-b1c1-382abdfdf3ac" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Wed, 01 Jul 2020 12:52:39 GMT", + "x-ms-continuation-NextTableName" : "1!44!YnRlc3RiNDkxNzQ4ZDk4ATAxZDY0ZmE2ODEyYzZhYTI-", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "ad30c2b9-f002-0018-01a6-4f8a9a000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"atesta47573650a\"}]}", + "x-ms-client-request-id" : "7c98cfbf-7d63-4aa3-b1c1-382abdfdf3ac", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "a5f700a0-9946-40e3-b0e5-9a387627abc0" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "a7b4297b-9002-00a7-19a6-4fbd3f000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"atesta47573650a\"},{\"TableName\":\"btestb491748d98\"}]}", + "Date" : "Wed, 01 Jul 2020 12:52:39 GMT", + "x-ms-client-request-id" : "a5f700a0-9946-40e3-b0e5-9a387627abc0", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('atesta47573650a')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "31f06f8f-7930-451c-8d51-8fd144aa32b5" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "ad30c2c2-f002-0018-09a6-4f8a9a000000", + "Date" : "Wed, 01 Jul 2020 12:52:39 GMT", + "x-ms-client-request-id" : "31f06f8f-7930-451c-8d51-8fd144aa32b5" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('btestb491748d98')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "c8ee9b8f-5104-4ea6-8d1a-1880c2ae7b7f" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "093a819b-5002-005c-2aa6-4f00a5000000", + "Date" : "Wed, 01 Jul 2020 12:52:40 GMT", + "x-ms-client-request-id" : "c8ee9b8f-5104-4ea6-8d1a-1880c2ae7b7f" + }, + "Exception" : null + } ], + "variables" : [ "atesta47573650a", "btestb491748d98", "848bd698-011a-46ed-a001-7aafa978d96a", "cceecbc5-ea58-4939-bba3-f7b0f9e157c6", "7c98cfbf-7d63-4aa3-b1c1-382abdfdf3ac", "a5f700a0-9946-40e3-b0e5-9a387627abc0", "31f06f8f-7930-451c-8d51-8fd144aa32b5", "c8ee9b8f-5104-4ea6-8d1a-1880c2ae7b7f" ] +} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/updateEntity.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/updateEntity.json new file mode 100644 index 000000000000..265d9f2ff8b6 --- /dev/null +++ b/sdk/tables/azure-data-tables/src/test/resources/session-records/updateEntity.json @@ -0,0 +1,119 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "b0a7672c-2802-45ec-a0e5-c7f601fcc6d5", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Wed, 01 Jul 2020 12:52:38 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "a7b42940-9002-00a7-68a6-4fbd3f000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"test28489451d8\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "b0a7672c-2802-45ec-a0e5-c7f601fcc6d5", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/Tables('test28489451d8')" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/test28489451d8?timeout=5000", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "5b0f2001-9eee-49ec-9d42-f5581e2cb141", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Wed, 01 Jul 2020 12:52:38 GMT", + "Cache-Control" : "no-cache", + "ETag" : "W/\"datetime'2020-07-01T12%3A52%3A39.6146392Z'\"", + "x-ms-request-id" : "ad30c257-f002-0018-29a6-4f8a9a000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#test28489451d8/@Element\",\"odata.etag\":\"W/\\\"datetime'2020-07-01T12%3A52%3A39.6146392Z'\\\"\",\"PartitionKey\":\"partitionkey202594\",\"RowKey\":\"rowkey88272bdb9\",\"Timestamp\":\"2020-07-01T12:52:39.6146392Z\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "5b0f2001-9eee-49ec-9d42-f5581e2cb141", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/test28489451d8(PartitionKey='partitionkey202594',RowKey='rowkey88272bdb9')" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.table.core.windows.net/test28489451d8(PartitionKey='partitionkey202594',RowKey='rowkey88272bdb9')?timeout=5000", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "dea79b44-d15d-45d5-9f3e-8b836c225509", + "Content-Type" : "application/json" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "ETag" : "W/\"datetime'2020-07-01T12%3A52%3A39.6510734Z'\"", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "a7b42947-9002-00a7-6ea6-4fbd3f000000", + "Date" : "Wed, 01 Jul 2020 12:52:38 GMT", + "x-ms-client-request-id" : "dea79b44-d15d-45d5-9f3e-8b836c225509" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "5d8f9dc0-c148-48bd-87f0-0ef93bb0f305" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "ad30c25c-f002-0018-2da6-4f8a9a000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"test28489451d8\"}]}", + "Date" : "Wed, 01 Jul 2020 12:52:38 GMT", + "x-ms-client-request-id" : "5d8f9dc0-c148-48bd-87f0-0ef93bb0f305", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('test28489451d8')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "208bfe9b-e6ab-4d29-a15c-35e8ab9bdebe" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "a7b42950-9002-00a7-76a6-4fbd3f000000", + "Date" : "Wed, 01 Jul 2020 12:52:38 GMT", + "x-ms-client-request-id" : "208bfe9b-e6ab-4d29-a15c-35e8ab9bdebe" + }, + "Exception" : null + } ], + "variables" : [ "test28489451d8", "b0a7672c-2802-45ec-a0e5-c7f601fcc6d5", "partitionkey202594", "rowkey88272bdb9", "dea79b44-d15d-45d5-9f3e-8b836c225509", "5b0f2001-9eee-49ec-9d42-f5581e2cb141", "b5682ac15fa447b7", "5d8f9dc0-c148-48bd-87f0-0ef93bb0f305", "208bfe9b-e6ab-4d29-a15c-35e8ab9bdebe" ] +} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/updateNonExistentEntity.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/updateNonExistentEntity.json new file mode 100644 index 000000000000..1921482bf009 --- /dev/null +++ b/sdk/tables/azure-data-tables/src/test/resources/session-records/updateNonExistentEntity.json @@ -0,0 +1,94 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "f85c5603-c4c2-4628-b2ab-9854db6de12c", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Wed, 01 Jul 2020 12:52:40 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "a7b42993-9002-00a7-2da6-4fbd3f000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"test7868718213\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "f85c5603-c4c2-4628-b2ab-9854db6de12c", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/Tables('test7868718213')" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.table.core.windows.net/test7868718213(PartitionKey='partitionkey887715',RowKey='rowkey611341888')?timeout=5000", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "624dcfdf-ac2b-4f98-baf6-1010bde0a052", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "404", + "x-ms-request-id" : "ad30c302-f002-0018-45a6-4f8a9a000000", + "Body" : "{\"odata.error\":{\"code\":\"ResourceNotFound\",\"message\":{\"lang\":\"en-US\",\"value\":\"The specified resource does not exist.\\nRequestId:ad30c302-f002-0018-45a6-4f8a9a000000\\nTime:2020-07-01T12:52:41.3508756Z\"}}}", + "Date" : "Wed, 01 Jul 2020 12:52:40 GMT", + "x-ms-client-request-id" : "624dcfdf-ac2b-4f98-baf6-1010bde0a052", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "7ae89496-f8dc-431e-9124-65d13583c8c9" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "093a81af-5002-005c-3aa6-4f00a5000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"test7868718213\"}]}", + "Date" : "Wed, 01 Jul 2020 12:52:41 GMT", + "x-ms-client-request-id" : "7ae89496-f8dc-431e-9124-65d13583c8c9", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('test7868718213')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "191e2e41-a9ef-46c1-af53-97ca8a73bb63" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "a7b42996-9002-00a7-2fa6-4fbd3f000000", + "Date" : "Wed, 01 Jul 2020 12:52:40 GMT", + "x-ms-client-request-id" : "191e2e41-a9ef-46c1-af53-97ca8a73bb63" + }, + "Exception" : null + } ], + "variables" : [ "test7868718213", "f85c5603-c4c2-4628-b2ab-9854db6de12c", "partitionkey887715", "rowkey611341888", "624dcfdf-ac2b-4f98-baf6-1010bde0a052", "7ae89496-f8dc-431e-9124-65d13583c8c9", "191e2e41-a9ef-46c1-af53-97ca8a73bb63" ] +} \ No newline at end of file From ca8b84cd7710bc99158f72f9638de6cdd6dbb1fc Mon Sep 17 00:00:00 2001 From: Eleanor Boyd Date: Wed, 1 Jul 2020 09:02:31 -0400 Subject: [PATCH 19/33] fix incorrect changes in readme --- sdk/tables/azure-data-tables/swagger/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/tables/azure-data-tables/swagger/README.md b/sdk/tables/azure-data-tables/swagger/README.md index 52334f296e41..64462257e8de 100644 --- a/sdk/tables/azure-data-tables/swagger/README.md +++ b/sdk/tables/azure-data-tables/swagger/README.md @@ -4,7 +4,7 @@ ### Setup ```ps -ForowKey and clone https://github.com/Azure/autorest.java +Fork and clone https://github.com/Azure/autorest.java git checkout v4 git submodule update --init --recursive mvn package -Dlocal @@ -15,7 +15,7 @@ npm install -g autorest ### Generation ```ps cd -autorest --java --use=C:/worowKey/autorest.java +autorest --java --use=C:/work/autorest.java ``` ### Code generation settings From e849c5e99a39bc9f5689ade548c1ca571eaaeee6 Mon Sep 17 00:00:00 2001 From: Eleanor Boyd Date: Wed, 1 Jul 2020 11:23:20 -0400 Subject: [PATCH 20/33] fix pom --- sdk/tables/azure-data-tables/pom.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sdk/tables/azure-data-tables/pom.xml b/sdk/tables/azure-data-tables/pom.xml index 8ad37d736c40..f914482909bb 100644 --- a/sdk/tables/azure-data-tables/pom.xml +++ b/sdk/tables/azure-data-tables/pom.xml @@ -31,8 +31,7 @@ Licensed under the MIT License. scm:git:git@github.com:Azure/azure-sdk-for-java.git HEAD - - + true From 0216fde8f8ff614a2c2f5e2e6bce830cc333d0bf Mon Sep 17 00:00:00 2001 From: Eleanor Boyd Date: Wed, 1 Jul 2020 11:24:51 -0400 Subject: [PATCH 21/33] fixing pom --- sdk/tables/azure-data-tables/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/tables/azure-data-tables/pom.xml b/sdk/tables/azure-data-tables/pom.xml index f914482909bb..d74e63ff092b 100644 --- a/sdk/tables/azure-data-tables/pom.xml +++ b/sdk/tables/azure-data-tables/pom.xml @@ -31,7 +31,7 @@ Licensed under the MIT License. scm:git:git@github.com:Azure/azure-sdk-for-java.git HEAD - + true From 8b9e9061dfb93cab68e37eff4d7e1b0e89ae7acc Mon Sep 17 00:00:00 2001 From: Eleanor Boyd Date: Wed, 1 Jul 2020 11:53:05 -0400 Subject: [PATCH 22/33] fixing version --- sdk/tables/azure-data-tables/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/tables/azure-data-tables/pom.xml b/sdk/tables/azure-data-tables/pom.xml index d74e63ff092b..7c44ebcc6e49 100644 --- a/sdk/tables/azure-data-tables/pom.xml +++ b/sdk/tables/azure-data-tables/pom.xml @@ -50,7 +50,7 @@ Licensed under the MIT License. org.junit.jupiter junit-jupiter - RELEASE + 5.6.2 test From 3558d0ff128d30b2c1f2afcfc4904b867f548118 Mon Sep 17 00:00:00 2001 From: Eleanor Boyd Date: Wed, 1 Jul 2020 14:15:15 -0400 Subject: [PATCH 23/33] fix impl --- .../tables/implementation/TablesImpl.java | 289 ++++++++++-------- 1 file changed, 155 insertions(+), 134 deletions(-) diff --git a/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/implementation/TablesImpl.java b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/implementation/TablesImpl.java index 2fbecbba2b29..027146409f40 100644 --- a/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/implementation/TablesImpl.java +++ b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/implementation/TablesImpl.java @@ -4,28 +4,52 @@ package com.azure.data.tables.implementation; -import com.azure.core.annotation.*; +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; import com.azure.core.exception.HttpResponseException; import com.azure.core.http.rest.RestProxy; import com.azure.core.util.Context; -import com.azure.data.tables.implementation.models.*; -import reactor.core.publisher.Mono; - +import com.azure.data.tables.implementation.models.OdataMetadataFormat; +import com.azure.data.tables.implementation.models.QueryOptions; +import com.azure.data.tables.implementation.models.ResponseFormat; +import com.azure.data.tables.implementation.models.SignedIdentifier; +import com.azure.data.tables.implementation.models.TableProperties; +import com.azure.data.tables.implementation.models.TableServiceErrorException; +import com.azure.data.tables.implementation.models.TablesCreateResponse; +import com.azure.data.tables.implementation.models.TablesDeleteEntityResponse; +import com.azure.data.tables.implementation.models.TablesDeleteResponse; +import com.azure.data.tables.implementation.models.TablesGetAccessPolicyResponse; +import com.azure.data.tables.implementation.models.TablesInsertEntityResponse; +import com.azure.data.tables.implementation.models.TablesMergeEntityResponse; +import com.azure.data.tables.implementation.models.TablesQueryEntitiesResponse; +import com.azure.data.tables.implementation.models.TablesQueryEntitiesWithPartitionAndRowKeyResponse; +import com.azure.data.tables.implementation.models.TablesQueryResponse; +import com.azure.data.tables.implementation.models.TablesSetAccessPolicyResponse; +import com.azure.data.tables.implementation.models.TablesUpdateEntityResponse; import java.util.List; import java.util.Map; +import reactor.core.publisher.Mono; -/** - * An instance of this class provides access to all the operations defined in Tables. - */ +/** An instance of this class provides access to all the operations defined in Tables. */ public final class TablesImpl { - /** - * The proxy service used to perform REST calls. - */ + /** The proxy service used to perform REST calls. */ private final TablesService service; - /** - * The service client containing this operation class. - */ + /** The service client containing this operation class. */ private final AzureTableImpl client; /** @@ -212,15 +236,15 @@ Mono setAccessPolicy( /** * Queries tables under the given account. * - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in - * the analytics logs when analytics logging is enabled. + * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the + * analytics logs when analytics logging is enabled. * @param nextTableName A table query continuation token from a previous call. - * @param queryOptions Parameter group. - * @param context The context to associate with this operation. - * @return the properties for the table query response. + * @param queryOptions Parameter group. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties for the table query response. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono queryWithResponseAsync( @@ -247,32 +271,32 @@ public Mono queryWithResponseAsync( } String filter = filterInternal; return service.query( - this.client.getUrl(), - this.client.getVersion(), - requestId, - dataServiceVersion, - format, - top, - select, - filter, - nextTableName, - context); + this.client.getUrl(), + this.client.getVersion(), + requestId, + dataServiceVersion, + format, + top, + select, + filter, + nextTableName, + context); } /** * Creates a new table under the given account. * - * @param tableProperties The properties for creating a table. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded - * in the analytics logs when analytics logging is enabled. + * @param tableProperties The properties for creating a table. + * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the + * analytics logs when analytics logging is enabled. * @param responsePreference Specifies whether the response should include the inserted entity in the payload. - * Possible values are return-no-content and return-content. - * @param queryOptions Parameter group. - * @param context The context to associate with this operation. - * @return the response for a single table. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * Possible values are return-no-content and return-content. + * @param queryOptions Parameter group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws TableServiceErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response for a single table. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono createWithResponseAsync( @@ -301,14 +325,14 @@ public Mono createWithResponseAsync( /** * Operation permanently deletes the specified table. * - * @param table The name of the table. + * @param table The name of the table. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when analytics logging is enabled. - * @param context The context to associate with this operation. - * @return the completion. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * analytics logs when analytics logging is enabled. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws TableServiceErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono deleteWithResponseAsync(String table, String requestId, Context context) { @@ -318,18 +342,18 @@ public Mono deleteWithResponseAsync(String table, String r /** * Queries entities in a table. * - * @param table The name of the table. - * @param timeout The timeout parameter is expressed in seconds. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded - * in the analytics logs when analytics logging is enabled. + * @param table The name of the table. + * @param timeout The timeout parameter is expressed in seconds. + * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the + * analytics logs when analytics logging is enabled. * @param nextPartitionKey An entity query continuation token from a previous call. - * @param nextRowKey An entity query continuation token from a previous call. - * @param queryOptions Parameter group. - * @param context The context to associate with this operation. - * @return the properties for the table entity query response. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * @param nextRowKey An entity query continuation token from a previous call. + * @param queryOptions Parameter group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws TableServiceErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties for the table entity query response. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono queryEntitiesWithResponseAsync( @@ -380,18 +404,18 @@ public Mono queryEntitiesWithResponseAsync( /** * Queries entities in a table. * - * @param table The name of the table. + * @param table The name of the table. * @param partitionKey The partition key of the entity. - * @param rowKey The row key of the entity. - * @param timeout The timeout parameter is expressed in seconds. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when analytics logging is enabled. + * @param rowKey The row key of the entity. + * @param timeout The timeout parameter is expressed in seconds. + * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the + * analytics logs when analytics logging is enabled. * @param queryOptions Parameter group. - * @param context The context to associate with this operation. - * @return the properties for the table entity query response. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws TableServiceErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties for the table entity query response. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono queryEntitiesWithPartitionAndRowKeyWithResponseAsync( @@ -436,24 +460,23 @@ public Mono queryEntitiesWith /** * Update entity in a table. * - * @param table The name of the table. - * @param partitionKey The partition key of the entity. - * @param rowKey The row key of the entity. - * @param timeout The timeout parameter is expressed in seconds. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is - * recorded in the analytics logs when analytics logging is enabled. - * @param ifMatch Match condition for an entity to be updated. If specified and a matching entity - * is not found, an error will be raised. To force an unconditional update, set to the - * wildcard character (*). If not specified, an insert will be performed when no - * existing entity is found to update and a replace will be performed if an - * existing entity is found. + * @param table The name of the table. + * @param partitionKey The partition key of the entity. + * @param rowKey The row key of the entity. + * @param timeout The timeout parameter is expressed in seconds. + * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the + * analytics logs when analytics logging is enabled. + * @param ifMatch Match condition for an entity to be updated. If specified and a matching entity is not found, an + * error will be raised. To force an unconditional update, set to the wildcard character (*). If not specified, + * an insert will be performed when no existing entity is found to update and a replace will be performed if an + * existing entity is found. * @param tableEntityProperties The other properties of the table entity. - * @param queryOptions Parameter group. - * @param context The context to associate with this operation. - * @return the completion. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * @param queryOptions Parameter group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws TableServiceErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono updateEntityWithResponseAsync( @@ -490,24 +513,23 @@ public Mono updateEntityWithResponseAsync( /** * Merge entity in a table. * - * @param table The name of the table. - * @param partitionKey The partition key of the entity. - * @param rowKey The row key of the entity. - * @param timeout The timeout parameter is expressed in seconds. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is - * recorded in the analytics logs when analytics logging is enabled. - * @param ifMatch Match condition for an entity to be updated. If specified and a matching entity is - * not found, an error will be raised. To force an unconditional update, set to the - * wildcard character (*). If not specified, an insert will be performed when no - * existing entity is found to update and a merge will be performed if an - * existing entity is found. + * @param table The name of the table. + * @param partitionKey The partition key of the entity. + * @param rowKey The row key of the entity. + * @param timeout The timeout parameter is expressed in seconds. + * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the + * analytics logs when analytics logging is enabled. + * @param ifMatch Match condition for an entity to be updated. If specified and a matching entity is not found, an + * error will be raised. To force an unconditional update, set to the wildcard character (*). If not specified, + * an insert will be performed when no existing entity is found to update and a merge will be performed if an + * existing entity is found. * @param tableEntityProperties The other properties of the table entity. - * @param queryOptions Parameter group. - * @param context The context to associate with this operation. - * @return the completion. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * @param queryOptions Parameter group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws TableServiceErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono mergeEntityWithResponseAsync( @@ -544,21 +566,20 @@ public Mono mergeEntityWithResponseAsync( /** * Deletes the specified entity in a table. * - * @param table The name of the table. + * @param table The name of the table. * @param partitionKey The partition key of the entity. - * @param rowKey The row key of the entity. - * @param ifMatch Match condition for an entity to be deleted. If specified and a matching entity is not - * found, an error will be raised. To force an unconditional delete, set to the wildcard - * character (*). - * @param timeout The timeout parameter is expressed in seconds. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when analytics logging is enabled. + * @param rowKey The row key of the entity. + * @param ifMatch Match condition for an entity to be deleted. If specified and a matching entity is not found, an + * error will be raised. To force an unconditional delete, set to the wildcard character (*). + * @param timeout The timeout parameter is expressed in seconds. + * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the + * analytics logs when analytics logging is enabled. * @param queryOptions Parameter group. - * @param context The context to associate with this operation. - * @return the completion. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws TableServiceErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono deleteEntityWithResponseAsync( @@ -593,19 +614,19 @@ public Mono deleteEntityWithResponseAsync( /** * Insert entity in a table. * - * @param table The name of the table. - * @param timeout The timeout parameter is expressed in seconds. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is - * recorded in the analytics logs when analytics logging is enabled. - * @param responsePreference Specifies whether the response should include the inserted entity in the payload. - * Possible values are return-no-content and return-content. + * @param table The name of the table. + * @param timeout The timeout parameter is expressed in seconds. + * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the + * analytics logs when analytics logging is enabled. + * @param responsePreference Specifies whether the response should include the inserted entity in the payload. + * Possible values are return-no-content and return-content. * @param tableEntityProperties The other properties of the table entity. - * @param queryOptions Parameter group. - * @param context The context to associate with this operation. - * @return the other properties of the table entity. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * @param queryOptions Parameter group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws TableServiceErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the other properties of the table entity. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono insertEntityWithResponseAsync( @@ -639,15 +660,15 @@ public Mono insertEntityWithResponseAsync( * Retrieves details about any stored access policies specified on the table that may be used with Shared Access * Signatures. * - * @param table The name of the table. - * @param timeout The timeout parameter is expressed in seconds. + * @param table The name of the table. + * @param timeout The timeout parameter is expressed in seconds. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when analytics logging is enabled. - * @param context The context to associate with this operation. - * @return a collection of signed identifiers. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * analytics logs when analytics logging is enabled. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws TableServiceErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a collection of signed identifiers. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getAccessPolicyWithResponseAsync( @@ -660,16 +681,16 @@ public Mono getAccessPolicyWithResponseAsync( /** * Sets stored access policies for the table that may be used with Shared Access Signatures. * - * @param table The name of the table. - * @param timeout The timeout parameter is expressed in seconds. + * @param table The name of the table. + * @param timeout The timeout parameter is expressed in seconds. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when analytics logging is enabled. - * @param tableAcl A collection of signed identifiers. - * @param context The context to associate with this operation. - * @return the completion. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * analytics logs when analytics logging is enabled. + * @param tableAcl A collection of signed identifiers. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws TableServiceErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono setAccessPolicyWithResponseAsync( From 5f24375c8497049fc28769cf423b744a64140c54 Mon Sep 17 00:00:00 2001 From: Eleanor Boyd Date: Wed, 1 Jul 2020 15:16:59 -0400 Subject: [PATCH 24/33] fixing checkstyles --- .../data/tables/TablesSharedKeyCredential.java | 14 +++++++++----- .../tables/TablesSharedKeyCredentialPolicy.java | 2 +- .../java/com/azure/data/tables/package-info.java | 5 +++++ .../com/azure/data/tables/AzureTableImplTest.java | 8 ++++---- 4 files changed, 19 insertions(+), 10 deletions(-) create mode 100644 sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/package-info.java diff --git a/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredential.java b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredential.java index c5287404a5a2..58141c31afd5 100644 --- a/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredential.java +++ b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredential.java @@ -6,14 +6,18 @@ import com.azure.storage.common.implementation.StorageImplUtils; import java.net.URL; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Locale; +import java.util.Map; +import java.util.Objects; /** * A Class which helps generate the shared key credentials for a given storage account to create a Http requests to * access Azure Tables */ public class TablesSharedKeyCredential { - private static final String AUTHORIZATION_HEADER_FORMAT = "SharedKeyLite %s:%s"; private final String accountName; private final String accountKey; @@ -35,7 +39,7 @@ public TablesSharedKeyCredential(String accountName, String accountKey) { * Generates the Auth Headers * * @param requestURL the URL which the request is going to - * @param headers the headers of the request + * @param headers the headers of the request * @return the auth header */ public String generateAuthorizationHeader(URL requestURL, Map headers) { @@ -48,7 +52,7 @@ public String generateAuthorizationHeader(URL requestURL, Map he * creates the String to Sign * * @param requestURL the URL which the request is going to - * @param headers the headers of the request + * @param headers the headers of the request * @return a string to sign for the request */ private String buildStringToSign(URL requestURL, Map headers) { @@ -62,7 +66,7 @@ private String buildStringToSign(URL requestURL, Map headers) { /** * gets necessary headers if the request does not already contain them * - * @param headers a map of the headers which the request has + * @param headers a map of the headers which the request has * @param headerName the name of the header to get the standard header for * @return the standard header for the given name */ diff --git a/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredentialPolicy.java b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredentialPolicy.java index 3ed371e874b0..bfdd68f4688b 100644 --- a/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredentialPolicy.java +++ b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredentialPolicy.java @@ -30,7 +30,7 @@ public TablesSharedKeyCredentialPolicy(TablesSharedKeyCredential credential) { * creates an Http response * * @param context the context of the http pipeline - * @param next the next Http pipeline policy + * @param next the next Http pipeline policy * @return an Http response */ public Mono process(HttpPipelineCallContext context, HttpPipelineNextPolicy next) { diff --git a/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/package-info.java b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/package-info.java new file mode 100644 index 000000000000..681b49d60f34 --- /dev/null +++ b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/package-info.java @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +/** Package containing the inner classes for Azure Tables SDK. null. */ +package com.azure.data.tables; diff --git a/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java b/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java index 0637f60e939d..132b3305b00e 100644 --- a/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java +++ b/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java @@ -91,11 +91,11 @@ protected void afterTest() { Mono.when(azureTable.getTables().queryWithResponseAsync(testResourceNamer.randomUuid(), null, queryOptions, Context.NONE).flatMapMany(tablesQueryResponse -> { - return Flux.fromIterable(tablesQueryResponse.getValue().getValue()).flatMap(tableResponseProperty -> { - return azureTable.getTables().deleteWithResponseAsync(tableResponseProperty.getTableName(), - testResourceNamer.randomUuid(), Context.NONE); + return Flux.fromIterable(tablesQueryResponse.getValue().getValue()).flatMap(tableResponseProperty -> { + return azureTable.getTables().deleteWithResponseAsync(tableResponseProperty.getTableName(), + testResourceNamer.randomUuid(), Context.NONE); }); - })).block(); + })).block(); } void createTable(String tableName) { From 229116aaa26c607df3e10bfa61bbb5f9d5789e12 Mon Sep 17 00:00:00 2001 From: Eleanor Boyd Date: Wed, 1 Jul 2020 15:33:20 -0400 Subject: [PATCH 25/33] fixing checkstyles p2 --- .../java/com/azure/data/tables/TablesSharedKeyCredential.java | 2 +- .../src/test/java/com/azure/data/tables/AzureTableImplTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredential.java b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredential.java index 58141c31afd5..b6ff669a2346 100644 --- a/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredential.java +++ b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredential.java @@ -26,7 +26,7 @@ public class TablesSharedKeyCredential { * Constructor for TableSharedKeyCredential Class * * @param accountName name of the storage account - * @param accountKey key to the storage account + * @param accountKey key to the storage account */ public TablesSharedKeyCredential(String accountName, String accountKey) { Objects.requireNonNull(accountName, "'accountName' cannot be null."); diff --git a/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java b/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java index 132b3305b00e..d9c37cc43585 100644 --- a/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java +++ b/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java @@ -94,7 +94,7 @@ protected void afterTest() { return Flux.fromIterable(tablesQueryResponse.getValue().getValue()).flatMap(tableResponseProperty -> { return azureTable.getTables().deleteWithResponseAsync(tableResponseProperty.getTableName(), testResourceNamer.randomUuid(), Context.NONE); - }); + }); })).block(); } From 06e255ae3fcb37d56b0412f67375ed574ee4315d Mon Sep 17 00:00:00 2001 From: Eleanor Boyd Date: Thu, 2 Jul 2020 11:11:55 -0400 Subject: [PATCH 26/33] connie edits --- .../tables/TablesSharedKeyCredential.java | 40 +++++++++---------- .../TablesSharedKeyCredentialPolicy.java | 3 +- .../azure/data/tables/AzureTableImplTest.java | 7 ++-- 3 files changed, 23 insertions(+), 27 deletions(-) diff --git a/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredential.java b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredential.java index b6ff669a2346..87010df4b94c 100644 --- a/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredential.java +++ b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredential.java @@ -29,38 +29,37 @@ public class TablesSharedKeyCredential { * @param accountKey key to the storage account */ public TablesSharedKeyCredential(String accountName, String accountKey) { - Objects.requireNonNull(accountName, "'accountName' cannot be null."); - Objects.requireNonNull(accountKey, "'accountKey' cannot be null."); - this.accountName = accountName; - this.accountKey = accountKey; + this.accountName = Objects.requireNonNull(accountName, "'accountName' cannot be null."); + this.accountKey = Objects.requireNonNull(accountKey, "'accountKey' cannot be null."); } /** * Generates the Auth Headers * - * @param requestURL the URL which the request is going to + * @param requestUrl the URL which the request is going to * @param headers the headers of the request * @return the auth header */ - public String generateAuthorizationHeader(URL requestURL, Map headers) { - String signature = StorageImplUtils.computeHMac256(this.accountKey, this.buildStringToSign(requestURL, + public String generateAuthorizationHeader(URL requestUrl, Map headers) { + String signature = StorageImplUtils.computeHMac256(accountKey, buildStringToSign(requestUrl, headers)); - return String.format(AUTHORIZATION_HEADER_FORMAT, this.accountName, signature); + return String.format(AUTHORIZATION_HEADER_FORMAT, accountName, signature); } /** * creates the String to Sign * - * @param requestURL the URL which the request is going to + * @param requestUrl the Url which the request is going to * @param headers the headers of the request * @return a string to sign for the request */ - private String buildStringToSign(URL requestURL, Map headers) { - String dateHeader = headers.containsKey("x-ms-date") ? "" : this.getStandardHeaderValue(headers, - "Date"); + private String buildStringToSign(URL requestUrl, Map headers) { + String dateHeader = headers.containsKey("x-ms-date") + ? "" + : this.getStandardHeaderValue(headers, "Date"); return String.join("\n", dateHeader, //date - this.getCanonicalizedResource(requestURL)); //Canonicalized resource + getCanonicalizedResource(requestUrl)); //Canonicalized resource } /** @@ -79,20 +78,19 @@ private String getStandardHeaderValue(Map headers, String header /** * returns the canonicalized resource needed for a request * - * @param requestURL the url of the request + * @param requestUrl the url of the request * @return the string that is the canonicalized resource */ - private String getCanonicalizedResource(URL requestURL) { - StringBuilder canonicalizedResource = new StringBuilder("/"); - canonicalizedResource.append(this.accountName); - if (requestURL.getPath().length() > 0) { - canonicalizedResource.append(requestURL.getPath()); + private String getCanonicalizedResource(URL requestUrl) { + StringBuilder canonicalizedResource = new StringBuilder("/").append(accountName); + if (requestUrl.getPath().length() > 0) { + canonicalizedResource.append(requestUrl.getPath()); } else { canonicalizedResource.append('/'); } - if (requestURL.getQuery() != null) { - Map queryParams = StorageImplUtils.parseQueryStringSplitValues(requestURL.getQuery()); + if (requestUrl.getQuery() != null) { + Map queryParams = StorageImplUtils.parseQueryStringSplitValues(requestUrl.getQuery()); ArrayList queryParamNames = new ArrayList<>(queryParams.keySet()); Collections.sort(queryParamNames); diff --git a/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredentialPolicy.java b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredentialPolicy.java index bfdd68f4688b..f689b85d043a 100644 --- a/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredentialPolicy.java +++ b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredentialPolicy.java @@ -3,7 +3,6 @@ package com.azure.data.tables; - import com.azure.core.http.HttpPipelineCallContext; import com.azure.core.http.HttpPipelineNextPolicy; import com.azure.core.http.HttpResponse; @@ -34,7 +33,7 @@ public TablesSharedKeyCredentialPolicy(TablesSharedKeyCredential credential) { * @return an Http response */ public Mono process(HttpPipelineCallContext context, HttpPipelineNextPolicy next) { - String authorizationValue = this.credential.generateAuthorizationHeader(context.getHttpRequest().getUrl(), + String authorizationValue = credential.generateAuthorizationHeader(context.getHttpRequest().getUrl(), context.getHttpRequest().getHeaders().toMap()); context.getHttpRequest().setHeader("Authorization", authorizationValue); return next.process(); diff --git a/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java b/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java index d9c37cc43585..c80179586015 100644 --- a/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java +++ b/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java @@ -47,7 +47,6 @@ public class AzureTableImplTest extends TestBase { @Override protected void beforeTest() { - super.beforeTest(); String connectionString = interceptorManager.isPlaybackMode() ? "DefaultEndpointsProtocol=https;AccountName=dummyAccount;AccountKey=xyzDummy;EndpointSuffix=core.windows.net" : System.getenv("AZURE_TABLES_CONNECTION_STRING"); @@ -58,14 +57,14 @@ protected void beforeTest() { TablesSharedKeyCredential sharedKeyCredential = new TablesSharedKeyCredential(authSettings.getAccount().getName(), authSettings.getAccount().getAccessKey()); - final List policies = new ArrayList<>(); + List policies = new ArrayList<>(); policies.add(new AddDatePolicy()); policies.add(new AddHeadersPolicy(new HttpHeaders().put("Accept", OdataMetadataFormat.APPLICATION_JSON_ODATA_MINIMALMETADATA.toString()))); policies.add(new TablesSharedKeyCredentialPolicy(sharedKeyCredential)); policies.add(new HttpLoggingPolicy(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS))); - final HttpClient httpClientToUse; + HttpClient httpClientToUse; if (interceptorManager.isPlaybackMode()) { httpClientToUse = interceptorManager.getPlaybackClient(); } else { @@ -73,7 +72,7 @@ protected void beforeTest() { policies.add(interceptorManager.getRecordPolicy()); policies.add(new RetryPolicy()); } - final HttpPipeline pipeline = new HttpPipelineBuilder() + HttpPipeline pipeline = new HttpPipelineBuilder() .httpClient(httpClientToUse) .policies(policies.toArray(new HttpPipelinePolicy[0])) .build(); From 8cb259d9e3e0ae67df1298859967542bb5f5d616 Mon Sep 17 00:00:00 2001 From: Eleanor Boyd Date: Thu, 2 Jul 2020 12:31:21 -0400 Subject: [PATCH 27/33] connie edits 2 --- .../com/azure/data/tables/TablesSharedKeyCredential.java | 6 +++++- .../src/main/java/com/azure/data/tables/package-info.java | 2 +- .../test/java/com/azure/data/tables/AzureTableImplTest.java | 1 - 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredential.java b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredential.java index 87010df4b94c..093f3d92a1a5 100644 --- a/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredential.java +++ b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredential.java @@ -92,13 +92,17 @@ private String getCanonicalizedResource(URL requestUrl) { if (requestUrl.getQuery() != null) { Map queryParams = StorageImplUtils.parseQueryStringSplitValues(requestUrl.getQuery()); ArrayList queryParamNames = new ArrayList<>(queryParams.keySet()); + Collections.sort(queryParamNames); for (String queryParamName : queryParamNames) { String[] queryParamValues = queryParams.get(queryParamName); + Arrays.sort(queryParamValues); + String queryParamValuesStr = String.join(",", queryParamValues); - if (queryParamName.equals("comp")) { + + if (queryParamName.equalsIgnoreCase("comp")) { canonicalizedResource.append("?").append(queryParamName.toLowerCase(Locale.ROOT)).append("=") .append(queryParamValuesStr); } diff --git a/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/package-info.java b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/package-info.java index 681b49d60f34..22fcc4bc3349 100644 --- a/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/package-info.java +++ b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/package-info.java @@ -1,5 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -/** Package containing the inner classes for Azure Tables SDK. null. */ +/** Package containing the inner classes for Azure Tables SDK. */ package com.azure.data.tables; diff --git a/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java b/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java index c80179586015..d41c262945ab 100644 --- a/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java +++ b/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java @@ -35,7 +35,6 @@ import reactor.core.publisher.Mono; import reactor.test.StepVerifier; - /** * This class tests the Autorest code for the Tables track 2 SDK */ From 9b19368ddc8c4a2d0502e08fd1d9308b0266f97e Mon Sep 17 00:00:00 2001 From: Eleanor Boyd Date: Thu, 2 Jul 2020 13:09:20 -0400 Subject: [PATCH 28/33] forgot in last commit --- .../java/com/azure/data/tables/TablesSharedKeyCredential.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredential.java b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredential.java index 093f3d92a1a5..276be119ad64 100644 --- a/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredential.java +++ b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredential.java @@ -101,7 +101,7 @@ private String getCanonicalizedResource(URL requestUrl) { Arrays.sort(queryParamValues); String queryParamValuesStr = String.join(",", queryParamValues); - + if (queryParamName.equalsIgnoreCase("comp")) { canonicalizedResource.append("?").append(queryParamName.toLowerCase(Locale.ROOT)).append("=") .append(queryParamValuesStr); From cef982047a3933ea2dd07bce97f2431e7f3bd446 Mon Sep 17 00:00:00 2001 From: Eleanor Boyd Date: Thu, 2 Jul 2020 14:38:35 -0400 Subject: [PATCH 29/33] add changelog --- sdk/tables/azure-data-tables/CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 sdk/tables/azure-data-tables/CHANGELOG.md diff --git a/sdk/tables/azure-data-tables/CHANGELOG.md b/sdk/tables/azure-data-tables/CHANGELOG.md new file mode 100644 index 000000000000..4144f75694a0 --- /dev/null +++ b/sdk/tables/azure-data-tables/CHANGELOG.md @@ -0,0 +1,3 @@ +# Release History + +## 1.0.0-beta.1 (Unreleased) From 1315b59085b02137cbff91dfafd4f157325aacc7 Mon Sep 17 00:00:00 2001 From: Eleanor Boyd Date: Mon, 6 Jul 2020 10:27:27 -0400 Subject: [PATCH 30/33] connie comments --- .../com/azure/data/tables/AzureTableImplTest.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java b/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java index d41c262945ab..d0f61fa4808e 100644 --- a/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java +++ b/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java @@ -23,6 +23,7 @@ import com.azure.data.tables.implementation.models.QueryOptions; import com.azure.data.tables.implementation.models.ResponseFormat; import com.azure.data.tables.implementation.models.TableProperties; +import com.azure.data.tables.implementation.models.TableServiceErrorException; import com.azure.storage.common.implementation.connectionstring.StorageAuthenticationSettings; import com.azure.storage.common.implementation.connectionstring.StorageConnectionString; import java.util.ArrayList; @@ -102,8 +103,6 @@ void createTable(String tableName) { azureTable.getTables().createWithResponseAsync(tableProperties, requestId, ResponseFormat.RETURN_CONTENT, null, Context.NONE).block(); - - } void insertNoETag(String tableName, Map properties) { @@ -142,7 +141,7 @@ void createTableDuplicateName() { // Act & Assert StepVerifier.create(azureTable.getTables().createWithResponseAsync(tableProperties, requestId, ResponseFormat.RETURN_CONTENT, null, Context.NONE)) - .expectError(com.azure.data.tables.implementation.models.TableServiceErrorException.class) + .expectError(TableServiceErrorException.class) .verify(); } @@ -194,6 +193,12 @@ void queryTable() { queryOptions, Context.NONE)) .assertNext(response -> { Assertions.assertEquals(expectedStatusCode, response.getStatusCode()); + Assertions.assertNotNull(response.getValue(), "Expected there to be a result."); + + var results = response.getValue().getValue(); + + Assertions.assertNotNull(results, "Expected there to be a set of items."); + Assertions.assertEquals(2, results.size()); Assertions.assertEquals(response.getValue().getValue().get(0).getTableName(), tableA); Assertions.assertEquals(response.getValue().getValue().get(1).getTableName(), tableB); }) From 74c33b5ae8b9225a49a75a6f716ae0cc9db69553 Mon Sep 17 00:00:00 2001 From: Eleanor Boyd Date: Mon, 6 Jul 2020 12:11:39 -0400 Subject: [PATCH 31/33] fixing pipeline issues --- sdk/tables/azure-data-tables/pom.xml | 2 +- .../test/java/com/azure/data/tables/AzureTableImplTest.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/sdk/tables/azure-data-tables/pom.xml b/sdk/tables/azure-data-tables/pom.xml index 7c44ebcc6e49..4b6bc21b2d87 100644 --- a/sdk/tables/azure-data-tables/pom.xml +++ b/sdk/tables/azure-data-tables/pom.xml @@ -62,7 +62,7 @@ Licensed under the MIT License. com.azure azure-core-test - 1.3.0 + 1.3.1 test diff --git a/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java b/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java index d0f61fa4808e..c8eebd942ff0 100644 --- a/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java +++ b/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java @@ -23,6 +23,7 @@ import com.azure.data.tables.implementation.models.QueryOptions; import com.azure.data.tables.implementation.models.ResponseFormat; import com.azure.data.tables.implementation.models.TableProperties; +import com.azure.data.tables.implementation.models.TableResponseProperties; import com.azure.data.tables.implementation.models.TableServiceErrorException; import com.azure.storage.common.implementation.connectionstring.StorageAuthenticationSettings; import com.azure.storage.common.implementation.connectionstring.StorageConnectionString; @@ -195,7 +196,7 @@ void queryTable() { Assertions.assertEquals(expectedStatusCode, response.getStatusCode()); Assertions.assertNotNull(response.getValue(), "Expected there to be a result."); - var results = response.getValue().getValue(); + List results = response.getValue().getValue(); Assertions.assertNotNull(results, "Expected there to be a set of items."); Assertions.assertEquals(2, results.size()); From 1351fbe5d2be2cfc74fd392bc3a2700e3ef30429 Mon Sep 17 00:00:00 2001 From: Eleanor Boyd Date: Mon, 6 Jul 2020 15:04:51 -0400 Subject: [PATCH 32/33] assertion for setup --- .../src/test/java/com/azure/data/tables/AzureTableImplTest.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java b/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java index c8eebd942ff0..24f613383869 100644 --- a/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java +++ b/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java @@ -54,6 +54,8 @@ protected void beforeTest() { StorageConnectionString storageConnectionString = StorageConnectionString.create(connectionString, new ClientLogger(AzureTableImplTest.class)); + Assertions.assertNotNull(connectionString, "Cannot continue test if connectionString is not set."); + StorageAuthenticationSettings authSettings = storageConnectionString.getStorageAuthSettings(); TablesSharedKeyCredential sharedKeyCredential = new TablesSharedKeyCredential(authSettings.getAccount().getName(), authSettings.getAccount().getAccessKey()); From 767bfdf1968d3f9122241ef5a0ac973102ed2aac Mon Sep 17 00:00:00 2001 From: Eleanor Boyd Date: Tue, 7 Jul 2020 14:38:56 -0400 Subject: [PATCH 33/33] fix impl --- .../tables/implementation/TablesImpl.java | 506 +++++++++--------- 1 file changed, 253 insertions(+), 253 deletions(-) diff --git a/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/implementation/TablesImpl.java b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/implementation/TablesImpl.java index 027146409f40..e65eb9d22457 100644 --- a/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/implementation/TablesImpl.java +++ b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/implementation/TablesImpl.java @@ -73,164 +73,164 @@ private interface TablesService { @ExpectedResponses({200}) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono query( - @HostParam("url") String url, - @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("DataServiceVersion") String dataServiceVersion, - @QueryParam("$format") OdataMetadataFormat format, - @QueryParam("$top") Integer top, - @QueryParam("$select") String select, - @QueryParam("$filter") String filter, - @QueryParam("NextTableName") String nextTableName, - Context context); + @HostParam("url") String url, + @HeaderParam("x-ms-version") String version, + @HeaderParam("x-ms-client-request-id") String requestId, + @HeaderParam("DataServiceVersion") String dataServiceVersion, + @QueryParam("$format") OdataMetadataFormat format, + @QueryParam("$top") Integer top, + @QueryParam("$select") String select, + @QueryParam("$filter") String filter, + @QueryParam("NextTableName") String nextTableName, + Context context); @Post("/Tables") @ExpectedResponses({201, 204}) @UnexpectedResponseExceptionType(TableServiceErrorException.class) Mono create( - @HostParam("url") String url, - @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("DataServiceVersion") String dataServiceVersion, - @QueryParam("$format") OdataMetadataFormat format, - @HeaderParam("Prefer") ResponseFormat responsePreference, - @BodyParam("application/json") TableProperties tableProperties, - Context context); + @HostParam("url") String url, + @HeaderParam("x-ms-version") String version, + @HeaderParam("x-ms-client-request-id") String requestId, + @HeaderParam("DataServiceVersion") String dataServiceVersion, + @QueryParam("$format") OdataMetadataFormat format, + @HeaderParam("Prefer") ResponseFormat responsePreference, + @BodyParam("application/json") TableProperties tableProperties, + Context context); @Delete("/Tables('{table}')") @ExpectedResponses({204}) @UnexpectedResponseExceptionType(TableServiceErrorException.class) Mono delete( - @HostParam("url") String url, - @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @PathParam("table") String table, - Context context); + @HostParam("url") String url, + @HeaderParam("x-ms-version") String version, + @HeaderParam("x-ms-client-request-id") String requestId, + @PathParam("table") String table, + Context context); @Get("/{table}()") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(TableServiceErrorException.class) Mono queryEntities( - @HostParam("url") String url, - @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("DataServiceVersion") String dataServiceVersion, - @QueryParam("$format") OdataMetadataFormat format, - @QueryParam("$top") Integer top, - @QueryParam("$select") String select, - @QueryParam("$filter") String filter, - @PathParam("table") String table, - @QueryParam("NextPartitionKey") String nextPartitionKey, - @QueryParam("NextRowKey") String nextRowKey, - Context context); + @HostParam("url") String url, + @QueryParam("timeout") Integer timeout, + @HeaderParam("x-ms-version") String version, + @HeaderParam("x-ms-client-request-id") String requestId, + @HeaderParam("DataServiceVersion") String dataServiceVersion, + @QueryParam("$format") OdataMetadataFormat format, + @QueryParam("$top") Integer top, + @QueryParam("$select") String select, + @QueryParam("$filter") String filter, + @PathParam("table") String table, + @QueryParam("NextPartitionKey") String nextPartitionKey, + @QueryParam("NextRowKey") String nextRowKey, + Context context); @Get("/{table}(PartitionKey='{partitionKey}',RowKey='{rowKey}')") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(TableServiceErrorException.class) Mono queryEntitiesWithPartitionAndRowKey( - @HostParam("url") String url, - @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("DataServiceVersion") String dataServiceVersion, - @QueryParam("$format") OdataMetadataFormat format, - @QueryParam("$select") String select, - @QueryParam("$filter") String filter, - @PathParam("table") String table, - @PathParam("partitionKey") String partitionKey, - @PathParam("rowKey") String rowKey, - Context context); + @HostParam("url") String url, + @QueryParam("timeout") Integer timeout, + @HeaderParam("x-ms-version") String version, + @HeaderParam("x-ms-client-request-id") String requestId, + @HeaderParam("DataServiceVersion") String dataServiceVersion, + @QueryParam("$format") OdataMetadataFormat format, + @QueryParam("$select") String select, + @QueryParam("$filter") String filter, + @PathParam("table") String table, + @PathParam("partitionKey") String partitionKey, + @PathParam("rowKey") String rowKey, + Context context); @Put("/{table}(PartitionKey='{partitionKey}',RowKey='{rowKey}')") @ExpectedResponses({204}) @UnexpectedResponseExceptionType(TableServiceErrorException.class) Mono updateEntity( - @HostParam("url") String url, - @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("DataServiceVersion") String dataServiceVersion, - @QueryParam("$format") OdataMetadataFormat format, - @PathParam("table") String table, - @PathParam("partitionKey") String partitionKey, - @PathParam("rowKey") String rowKey, - @HeaderParam("If-Match") String ifMatch, - @BodyParam("application/json") Map tableEntityProperties, - Context context); + @HostParam("url") String url, + @QueryParam("timeout") Integer timeout, + @HeaderParam("x-ms-version") String version, + @HeaderParam("x-ms-client-request-id") String requestId, + @HeaderParam("DataServiceVersion") String dataServiceVersion, + @QueryParam("$format") OdataMetadataFormat format, + @PathParam("table") String table, + @PathParam("partitionKey") String partitionKey, + @PathParam("rowKey") String rowKey, + @HeaderParam("If-Match") String ifMatch, + @BodyParam("application/json") Map tableEntityProperties, + Context context); @Patch("/{table}(PartitionKey='{partitionKey}',RowKey='{rowKey}')") @ExpectedResponses({204}) @UnexpectedResponseExceptionType(TableServiceErrorException.class) Mono mergeEntity( - @HostParam("url") String url, - @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("DataServiceVersion") String dataServiceVersion, - @QueryParam("$format") OdataMetadataFormat format, - @PathParam("table") String table, - @PathParam("partitionKey") String partitionKey, - @PathParam("rowKey") String rowKey, - @HeaderParam("If-Match") String ifMatch, - @BodyParam("application/json") Map tableEntityProperties, - Context context); + @HostParam("url") String url, + @QueryParam("timeout") Integer timeout, + @HeaderParam("x-ms-version") String version, + @HeaderParam("x-ms-client-request-id") String requestId, + @HeaderParam("DataServiceVersion") String dataServiceVersion, + @QueryParam("$format") OdataMetadataFormat format, + @PathParam("table") String table, + @PathParam("partitionKey") String partitionKey, + @PathParam("rowKey") String rowKey, + @HeaderParam("If-Match") String ifMatch, + @BodyParam("application/json") Map tableEntityProperties, + Context context); @Delete("/{table}(PartitionKey='{partitionKey}',RowKey='{rowKey}')") @ExpectedResponses({204}) @UnexpectedResponseExceptionType(TableServiceErrorException.class) Mono deleteEntity( - @HostParam("url") String url, - @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("DataServiceVersion") String dataServiceVersion, - @QueryParam("$format") OdataMetadataFormat format, - @PathParam("table") String table, - @PathParam("partitionKey") String partitionKey, - @PathParam("rowKey") String rowKey, - @HeaderParam("If-Match") String ifMatch, - Context context); + @HostParam("url") String url, + @QueryParam("timeout") Integer timeout, + @HeaderParam("x-ms-version") String version, + @HeaderParam("x-ms-client-request-id") String requestId, + @HeaderParam("DataServiceVersion") String dataServiceVersion, + @QueryParam("$format") OdataMetadataFormat format, + @PathParam("table") String table, + @PathParam("partitionKey") String partitionKey, + @PathParam("rowKey") String rowKey, + @HeaderParam("If-Match") String ifMatch, + Context context); @Post("/{table}") @ExpectedResponses({201, 204}) @UnexpectedResponseExceptionType(TableServiceErrorException.class) Mono insertEntity( - @HostParam("url") String url, - @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("DataServiceVersion") String dataServiceVersion, - @QueryParam("$format") OdataMetadataFormat format, - @PathParam("table") String table, - @HeaderParam("Prefer") ResponseFormat responsePreference, - @BodyParam("application/json") Map tableEntityProperties, - Context context); + @HostParam("url") String url, + @QueryParam("timeout") Integer timeout, + @HeaderParam("x-ms-version") String version, + @HeaderParam("x-ms-client-request-id") String requestId, + @HeaderParam("DataServiceVersion") String dataServiceVersion, + @QueryParam("$format") OdataMetadataFormat format, + @PathParam("table") String table, + @HeaderParam("Prefer") ResponseFormat responsePreference, + @BodyParam("application/json") Map tableEntityProperties, + Context context); @Get("/{table}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(TableServiceErrorException.class) Mono getAccessPolicy( - @HostParam("url") String url, - @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @PathParam("table") String table, - @QueryParam("comp") String comp, - Context context); + @HostParam("url") String url, + @QueryParam("timeout") Integer timeout, + @HeaderParam("x-ms-version") String version, + @HeaderParam("x-ms-client-request-id") String requestId, + @PathParam("table") String table, + @QueryParam("comp") String comp, + Context context); @Put("/{table}") @ExpectedResponses({204}) @UnexpectedResponseExceptionType(TableServiceErrorException.class) Mono setAccessPolicy( - @HostParam("url") String url, - @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @PathParam("table") String table, - @QueryParam("comp") String comp, - @BodyParam("application/xml") List tableAcl, - Context context); + @HostParam("url") String url, + @QueryParam("timeout") Integer timeout, + @HeaderParam("x-ms-version") String version, + @HeaderParam("x-ms-client-request-id") String requestId, + @PathParam("table") String table, + @QueryParam("comp") String comp, + @BodyParam("application/xml") List tableAcl, + Context context); } /** @@ -248,7 +248,7 @@ Mono setAccessPolicy( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono queryWithResponseAsync( - String requestId, String nextTableName, QueryOptions queryOptions, Context context) { + String requestId, String nextTableName, QueryOptions queryOptions, Context context) { final String dataServiceVersion = "3.0"; OdataMetadataFormat formatInternal = null; if (queryOptions != null) { @@ -271,16 +271,16 @@ public Mono queryWithResponseAsync( } String filter = filterInternal; return service.query( - this.client.getUrl(), - this.client.getVersion(), - requestId, - dataServiceVersion, - format, - top, - select, - filter, - nextTableName, - context); + this.client.getUrl(), + this.client.getVersion(), + requestId, + dataServiceVersion, + format, + top, + select, + filter, + nextTableName, + context); } /** @@ -300,11 +300,11 @@ public Mono queryWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono createWithResponseAsync( - TableProperties tableProperties, - String requestId, - ResponseFormat responsePreference, - QueryOptions queryOptions, - Context context) { + TableProperties tableProperties, + String requestId, + ResponseFormat responsePreference, + QueryOptions queryOptions, + Context context) { final String dataServiceVersion = "3.0"; OdataMetadataFormat formatInternal = null; if (queryOptions != null) { @@ -312,14 +312,14 @@ public Mono createWithResponseAsync( } OdataMetadataFormat format = formatInternal; return service.create( - this.client.getUrl(), - this.client.getVersion(), - requestId, - dataServiceVersion, - format, - responsePreference, - tableProperties, - context); + this.client.getUrl(), + this.client.getVersion(), + requestId, + dataServiceVersion, + format, + responsePreference, + tableProperties, + context); } /** @@ -357,13 +357,13 @@ public Mono deleteWithResponseAsync(String table, String r */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono queryEntitiesWithResponseAsync( - String table, - Integer timeout, - String requestId, - String nextPartitionKey, - String nextRowKey, - QueryOptions queryOptions, - Context context) { + String table, + Integer timeout, + String requestId, + String nextPartitionKey, + String nextRowKey, + QueryOptions queryOptions, + Context context) { final String dataServiceVersion = "3.0"; OdataMetadataFormat formatInternal = null; if (queryOptions != null) { @@ -386,19 +386,19 @@ public Mono queryEntitiesWithResponseAsync( } String filter = filterInternal; return service.queryEntities( - this.client.getUrl(), - timeout, - this.client.getVersion(), - requestId, - dataServiceVersion, - format, - top, - select, - filter, - table, - nextPartitionKey, - nextRowKey, - context); + this.client.getUrl(), + timeout, + this.client.getVersion(), + requestId, + dataServiceVersion, + format, + top, + select, + filter, + table, + nextPartitionKey, + nextRowKey, + context); } /** @@ -419,13 +419,13 @@ public Mono queryEntitiesWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono queryEntitiesWithPartitionAndRowKeyWithResponseAsync( - String table, - String partitionKey, - String rowKey, - Integer timeout, - String requestId, - QueryOptions queryOptions, - Context context) { + String table, + String partitionKey, + String rowKey, + Integer timeout, + String requestId, + QueryOptions queryOptions, + Context context) { final String dataServiceVersion = "3.0"; OdataMetadataFormat formatInternal = null; if (queryOptions != null) { @@ -443,18 +443,18 @@ public Mono queryEntitiesWith } String filter = filterInternal; return service.queryEntitiesWithPartitionAndRowKey( - this.client.getUrl(), - timeout, - this.client.getVersion(), - requestId, - dataServiceVersion, - format, - select, - filter, - table, - partitionKey, - rowKey, - context); + this.client.getUrl(), + timeout, + this.client.getVersion(), + requestId, + dataServiceVersion, + format, + select, + filter, + table, + partitionKey, + rowKey, + context); } /** @@ -480,15 +480,15 @@ public Mono queryEntitiesWith */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono updateEntityWithResponseAsync( - String table, - String partitionKey, - String rowKey, - Integer timeout, - String requestId, - String ifMatch, - Map tableEntityProperties, - QueryOptions queryOptions, - Context context) { + String table, + String partitionKey, + String rowKey, + Integer timeout, + String requestId, + String ifMatch, + Map tableEntityProperties, + QueryOptions queryOptions, + Context context) { final String dataServiceVersion = "3.0"; OdataMetadataFormat formatInternal = null; if (queryOptions != null) { @@ -496,18 +496,18 @@ public Mono updateEntityWithResponseAsync( } OdataMetadataFormat format = formatInternal; return service.updateEntity( - this.client.getUrl(), - timeout, - this.client.getVersion(), - requestId, - dataServiceVersion, - format, - table, - partitionKey, - rowKey, - ifMatch, - tableEntityProperties, - context); + this.client.getUrl(), + timeout, + this.client.getVersion(), + requestId, + dataServiceVersion, + format, + table, + partitionKey, + rowKey, + ifMatch, + tableEntityProperties, + context); } /** @@ -533,15 +533,15 @@ public Mono updateEntityWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono mergeEntityWithResponseAsync( - String table, - String partitionKey, - String rowKey, - Integer timeout, - String requestId, - String ifMatch, - Map tableEntityProperties, - QueryOptions queryOptions, - Context context) { + String table, + String partitionKey, + String rowKey, + Integer timeout, + String requestId, + String ifMatch, + Map tableEntityProperties, + QueryOptions queryOptions, + Context context) { final String dataServiceVersion = "3.0"; OdataMetadataFormat formatInternal = null; if (queryOptions != null) { @@ -549,18 +549,18 @@ public Mono mergeEntityWithResponseAsync( } OdataMetadataFormat format = formatInternal; return service.mergeEntity( - this.client.getUrl(), - timeout, - this.client.getVersion(), - requestId, - dataServiceVersion, - format, - table, - partitionKey, - rowKey, - ifMatch, - tableEntityProperties, - context); + this.client.getUrl(), + timeout, + this.client.getVersion(), + requestId, + dataServiceVersion, + format, + table, + partitionKey, + rowKey, + ifMatch, + tableEntityProperties, + context); } /** @@ -583,14 +583,14 @@ public Mono mergeEntityWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono deleteEntityWithResponseAsync( - String table, - String partitionKey, - String rowKey, - String ifMatch, - Integer timeout, - String requestId, - QueryOptions queryOptions, - Context context) { + String table, + String partitionKey, + String rowKey, + String ifMatch, + Integer timeout, + String requestId, + QueryOptions queryOptions, + Context context) { final String dataServiceVersion = "3.0"; OdataMetadataFormat formatInternal = null; if (queryOptions != null) { @@ -598,17 +598,17 @@ public Mono deleteEntityWithResponseAsync( } OdataMetadataFormat format = formatInternal; return service.deleteEntity( - this.client.getUrl(), - timeout, - this.client.getVersion(), - requestId, - dataServiceVersion, - format, - table, - partitionKey, - rowKey, - ifMatch, - context); + this.client.getUrl(), + timeout, + this.client.getVersion(), + requestId, + dataServiceVersion, + format, + table, + partitionKey, + rowKey, + ifMatch, + context); } /** @@ -630,13 +630,13 @@ public Mono deleteEntityWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono insertEntityWithResponseAsync( - String table, - Integer timeout, - String requestId, - ResponseFormat responsePreference, - Map tableEntityProperties, - QueryOptions queryOptions, - Context context) { + String table, + Integer timeout, + String requestId, + ResponseFormat responsePreference, + Map tableEntityProperties, + QueryOptions queryOptions, + Context context) { final String dataServiceVersion = "3.0"; OdataMetadataFormat formatInternal = null; if (queryOptions != null) { @@ -644,16 +644,16 @@ public Mono insertEntityWithResponseAsync( } OdataMetadataFormat format = formatInternal; return service.insertEntity( - this.client.getUrl(), - timeout, - this.client.getVersion(), - requestId, - dataServiceVersion, - format, - table, - responsePreference, - tableEntityProperties, - context); + this.client.getUrl(), + timeout, + this.client.getVersion(), + requestId, + dataServiceVersion, + format, + table, + responsePreference, + tableEntityProperties, + context); } /** @@ -672,10 +672,10 @@ public Mono insertEntityWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getAccessPolicyWithResponseAsync( - String table, Integer timeout, String requestId, Context context) { + String table, Integer timeout, String requestId, Context context) { final String comp = "acl"; return service.getAccessPolicy( - this.client.getUrl(), timeout, this.client.getVersion(), requestId, table, comp, context); + this.client.getUrl(), timeout, this.client.getVersion(), requestId, table, comp, context); } /** @@ -694,9 +694,9 @@ public Mono getAccessPolicyWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono setAccessPolicyWithResponseAsync( - String table, Integer timeout, String requestId, List tableAcl, Context context) { + String table, Integer timeout, String requestId, List tableAcl, Context context) { final String comp = "acl"; return service.setAccessPolicy( - this.client.getUrl(), timeout, this.client.getVersion(), requestId, table, comp, tableAcl, context); + this.client.getUrl(), timeout, this.client.getVersion(), requestId, table, comp, tableAcl, context); } }