-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Web Pub Sub test recordings (#35848)
* Add opens for testing so it does not fail. * Add bicep script so resources are created for live tests. * Consolidate common properties. * Do not record test token generation because there are no network calls. * Update WebPubSubServiceClientTests * Add async client tests. * Update pom.xml to remove suppression for line coverage. * Extends from TestProxyTestBase. * Do not record non-network tests.
- Loading branch information
Showing
33 changed files
with
500 additions
and
608 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"AssetsRepo": "Azure/azure-sdk-assets", | ||
"AssetsRepoPrefixPath": "java", | ||
"TagPrefix": "java/webpubsub/azure-messaging-webpubsub", | ||
"Tag": "java/webpubsub/azure-messaging-webpubsub_2c7e99b063" | ||
} |
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
43 changes: 43 additions & 0 deletions
43
...bsub/azure-messaging-webpubsub/src/test/java/com/azure/messaging/webpubsub/TestUtils.java
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,43 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
package com.azure.messaging.webpubsub; | ||
|
||
import com.azure.core.http.HttpClient; | ||
import com.azure.core.http.policy.FixedDelayOptions; | ||
import com.azure.core.http.policy.RetryOptions; | ||
import com.azure.core.test.http.AssertingHttpClientBuilder; | ||
import com.azure.core.util.Configuration; | ||
|
||
import java.time.Duration; | ||
|
||
/** | ||
* Common properties used in testing. | ||
*/ | ||
final class TestUtils { | ||
static final String HUB_NAME = "Hub"; | ||
|
||
static String getEndpoint() { | ||
return Configuration.getGlobalConfiguration() | ||
.get("WEB_PUB_SUB_ENDPOINT", "http://testendpoint.webpubsubdev.azure.com"); | ||
} | ||
|
||
static String getConnectionString() { | ||
return Configuration.getGlobalConfiguration() | ||
.get("WEB_PUB_SUB_CONNECTION_STRING", "Endpoint=https://testendpoint.webpubsubdev.azure.com;AccessKey=LoremIpsumDolorSitAmetConsectetur;Version=1.0;"); | ||
} | ||
|
||
static RetryOptions getRetryOptions() { | ||
return new RetryOptions(new FixedDelayOptions(3, Duration.ofSeconds(20))); | ||
} | ||
|
||
static HttpClient buildAsyncAssertingClient(HttpClient httpClient) { | ||
return new AssertingHttpClientBuilder(httpClient) | ||
.assertAsync() | ||
.skipRequest((httpRequest, context) -> false) | ||
.build(); | ||
} | ||
|
||
private TestUtils() { | ||
} | ||
} |
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
Oops, something went wrong.