forked from Azure/azure-sdk-for-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
datasourceExists() implementation and tests (Azure#258)
Adding implementation and tests of datasourceExists()
- Loading branch information
Showing
7 changed files
with
196 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
...search/src/test/resources/session-records/existsReturnsFalseForNonExistingDatasource.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"networkCallRecords" : [ { | ||
"Method" : "GET", | ||
"Uri" : "https://azs-sdk04a58790fc78.search.windows.net/datasources('inExistentDataSourceName')?api-version=2019-05-06", | ||
"Headers" : { }, | ||
"Response" : { | ||
"Pragma" : "no-cache", | ||
"retry-after" : "0", | ||
"request-id" : "d14df4eb-219d-4345-b735-f32438ddf446", | ||
"StatusCode" : "404", | ||
"Date" : "Wed, 13 Nov 2019 15:09:18 GMT", | ||
"Strict-Transport-Security" : "max-age=15724800; includeSubDomains", | ||
"Cache-Control" : "no-cache", | ||
"elapsed-time" : "50", | ||
"OData-Version" : "4.0", | ||
"Expires" : "-1", | ||
"Content-Length" : "133", | ||
"Body" : "{\"error\":{\"code\":\"\",\"message\":\"No data source with the name 'inExistentDataSourceName' was found in service 'azs-sdk04a58790fc78'.\"}}", | ||
"Preference-Applied" : "odata.include-annotations=\"*\"", | ||
"Content-Language" : "en", | ||
"Content-Type" : "application/json; odata.metadata=minimal" | ||
}, | ||
"Exception" : null | ||
} ], | ||
"variables" : [ ] | ||
} |
51 changes: 51 additions & 0 deletions
51
...ure-search/src/test/resources/session-records/existsReturnsTrueForExistingDatasource.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
{ | ||
"networkCallRecords" : [ { | ||
"Method" : "PUT", | ||
"Uri" : "https://azs-sdk77f119396ba3.search.windows.net/datasources('azs-java-test-sql')?api-version=2019-05-06", | ||
"Headers" : { | ||
"Content-Type" : "application/json; charset=utf-8" | ||
}, | ||
"Response" : { | ||
"Pragma" : "no-cache", | ||
"retry-after" : "0", | ||
"request-id" : "2614d0c0-9103-479d-8099-473200f761d8", | ||
"StatusCode" : "201", | ||
"Date" : "Wed, 13 Nov 2019 10:07:25 GMT", | ||
"Strict-Transport-Security" : "max-age=15724800; includeSubDomains", | ||
"Cache-Control" : "no-cache", | ||
"ETag" : "W/\"0x8D7682148C4E1B5\"", | ||
"elapsed-time" : "80", | ||
"OData-Version" : "4.0", | ||
"Expires" : "-1", | ||
"Content-Length" : "383", | ||
"Body" : "{\"@odata.context\":\"https://azs-sdk77f119396ba3.search.windows.net/$metadata#datasources/$entity\",\"@odata.etag\":\"\\\"0x8D7682148C4E1B5\\\"\",\"name\":\"azs-java-test-sql\",\"description\":\"Some data source\",\"type\":\"azuresql\",\"subtype\":null,\"credentials\":{\"connectionString\":null},\"container\":{\"name\":\"GeoNamesRI\",\"query\":null},\"dataChangeDetectionPolicy\":null,\"dataDeletionDetectionPolicy\":null}", | ||
"Preference-Applied" : "odata.include-annotations=\"*\"", | ||
"Content-Type" : "application/json; odata.metadata=minimal", | ||
"Location" : "https://azs-sdk77f119396ba3.search.windows.net/datasources('azs-java-test-sql')?api-version=2019-05-06" | ||
}, | ||
"Exception" : null | ||
}, { | ||
"Method" : "GET", | ||
"Uri" : "https://azs-sdk77f119396ba3.search.windows.net/datasources('azs-java-test-sql')?api-version=2019-05-06", | ||
"Headers" : { }, | ||
"Response" : { | ||
"Pragma" : "no-cache", | ||
"retry-after" : "0", | ||
"request-id" : "4700d870-fc1f-419a-84d5-59c1925c5b6b", | ||
"StatusCode" : "200", | ||
"Date" : "Wed, 13 Nov 2019 10:07:25 GMT", | ||
"Strict-Transport-Security" : "max-age=15724800; includeSubDomains", | ||
"Cache-Control" : "no-cache", | ||
"ETag" : "W/\"0x8D7682148C4E1B5\"", | ||
"elapsed-time" : "52", | ||
"OData-Version" : "4.0", | ||
"Expires" : "-1", | ||
"Content-Length" : "383", | ||
"Body" : "{\"@odata.context\":\"https://azs-sdk77f119396ba3.search.windows.net/$metadata#datasources/$entity\",\"@odata.etag\":\"\\\"0x8D7682148C4E1B5\\\"\",\"name\":\"azs-java-test-sql\",\"description\":\"Some data source\",\"type\":\"azuresql\",\"subtype\":null,\"credentials\":{\"connectionString\":null},\"container\":{\"name\":\"GeoNamesRI\",\"query\":null},\"dataChangeDetectionPolicy\":null,\"dataDeletionDetectionPolicy\":null}", | ||
"Preference-Applied" : "odata.include-annotations=\"*\"", | ||
"Content-Type" : "application/json; odata.metadata=minimal" | ||
}, | ||
"Exception" : null | ||
} ], | ||
"variables" : [ ] | ||
} |