Skip to content

Commit

Permalink
Add listTables test
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon Siegel committed Aug 29, 2020
1 parent 1deb725 commit 23d8c93
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import reactor.test.StepVerifier;

import java.time.Duration;

import static org.junit.jupiter.api.Assertions.assertEquals;

/**
* Tests methods for {@link TableServiceAsyncClient}.
*/
Expand Down Expand Up @@ -108,19 +109,19 @@ void serviceDeleteTableWithResponseAsync() {
.verify();
}

@Disabled("TODO: Not working at the moment.")
@Test
void serviceListTableWithResponseWithParamsAsync() {
void serviceListTablesWithFilterAsync() {
// Arrange
ListTablesOptions options = new ListTablesOptions().setFilter("TableName eq SampleTable");
final String tableName = testResourceNamer.randomName("test", 20);
ListTablesOptions options = new ListTablesOptions().setFilter("TableName eq '" + tableName + "'");
serviceClient.createTable(tableName).block(TIMEOUT);

// Act & Assert
StepVerifier.create(serviceClient.listTables(options))
.assertNext(table -> {
System.out.print(table);
assertEquals(tableName, table.getName());
})
.expectComplete()
.verify();

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"networkCallRecords" : [ {
"Method" : "POST",
"Uri" : "https://REDACTED.table.core.windows.net/Tables",
"Headers" : {
"x-ms-version" : "2019-02-02",
"User-Agent" : "azsdk-java-UnknownName/UnknownVersion (11.0.8; Mac OS X; 10.15.6)",
"x-ms-client-request-id" : "06927113-a636-42f5-bb72-b5cc497cefdb",
"Content-Type" : "application/json"
},
"Response" : {
"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" : "204",
"Date" : "Thu, 27 Aug 2020 01:51:44 GMT",
"Cache-Control" : "no-cache",
"DataServiceId" : "https://brsiegelsample.table.core.windows.net/Tables('test3626197efd')",
"Content-Length" : "0",
"x-ms-request-id" : "671fe630-5002-0020-6414-7cb1fb000000",
"Preference-Applied" : "return-no-content",
"x-ms-client-request-id" : "06927113-a636-42f5-bb72-b5cc497cefdb",
"Location" : "https://brsiegelsample.table.core.windows.net/Tables('test3626197efd')"
},
"Exception" : null
}, {
"Method" : "GET",
"Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dfullmetadata&$filter=TableName%20eq%20%27test3626197efd%27",
"Headers" : {
"x-ms-version" : "2019-02-02",
"User-Agent" : "azsdk-java-UnknownName/UnknownVersion (11.0.8; Mac OS X; 10.15.6)",
"x-ms-client-request-id" : "85c97dca-bb2e-4abf-bdea-81ad47538df3"
},
"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" : "671fe642-5002-0020-7314-7cb1fb000000",
"Body" : "{\"odata.metadata\":\"https://brsiegelsample.table.core.windows.net/$metadata#Tables\",\"value\":[{\"odata.type\":\"brsiegelsample.Tables\",\"odata.id\":\"https://brsiegelsample.table.core.windows.net/Tables('test3626197efd')\",\"odata.editLink\":\"Tables('test3626197efd')\",\"TableName\":\"test3626197efd\"}]}",
"Date" : "Thu, 27 Aug 2020 01:51:44 GMT",
"x-ms-client-request-id" : "85c97dca-bb2e-4abf-bdea-81ad47538df3",
"Content-Type" : "application/json;odata=fullmetadata;streaming=true;charset=utf-8"
},
"Exception" : null
} ],
"variables" : [ "test3626197efd" ]
}

0 comments on commit 23d8c93

Please sign in to comment.