Skip to content

Commit

Permalink
[Communication] - SMS - Enabling SMS Live tests using Static Resources (
Browse files Browse the repository at this point in the history
#17599)

* Enabling SMS Live tests

* Clean up

* Adding more variables

* Fix SMS live test

* Clean up unneeded module from SMS pom

Co-authored-by: Minnie Liu <peiliu@microsoft.com>
  • Loading branch information
minnieliu and Minnie Liu authored Nov 17, 2020
1 parent bf43d37 commit 3c171e4
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 19 deletions.
16 changes: 0 additions & 16 deletions sdk/communication/azure-communication-sms/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,22 +45,6 @@
<jacoco.min.branchcoverage>0.75</jacoco.min.branchcoverage>
</properties>

<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.5</version> <!-- {x-version-update;org.jacoco:jacoco-maven-plugin;external_dependency} -->
<configuration>
<properties>
<jacoco.min.linecoverage>0.75</jacoco.min.linecoverage>
<jacoco.min.branchcoverage>0.75</jacoco.min.branchcoverage>
</properties>
</configuration>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>com.azure</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public void sendSmsRequestAsyncSingleNumberNoDeliveryReport(HttpClient httpClien
}

private SmsAsyncClient getTestSmsClient(HttpClient httpClient) {
return getSmsClientBuilder(httpClient)
return getSmsClientBuilderWithConnectionString(httpClient)
.buildAsyncClient();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public void sendSmsRequestMalformedNumber(HttpClient httpClient) throws NoSuchAl

private SmsClient getTestSmsClient(HttpClient httpClient) {

return getSmsClientBuilder(httpClient)
return getSmsClientBuilderWithConnectionString(httpClient)
.buildClient();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class SmsLiveTestBase extends TestBase {
.get("SMS_SERVICE_ENDPOINT", "https://REDACTED.communication.azure.com");

static final String CONNECTION_STRING = Configuration.getGlobalConfiguration()
.get("COMMUNICATION_CONNECTION_STRING", "endpoint=https://REDACTED.communication.azure.com/;accesskey=VGhpcyBpcyBhIHRlc3Q=");
.get("COMMUNICATION_LIVETEST_CONNECTION_STRING", "endpoint=https://REDACTED.communication.azure.com/;accesskey=VGhpcyBpcyBhIHRlc3Q=");

protected SmsClientBuilder getSmsClientBuilder(HttpClient httpClient) {
SmsClientBuilder builder = new SmsClientBuilder();
Expand Down
9 changes: 9 additions & 0 deletions sdk/communication/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,18 @@ jobs:
- name: azure-communication-chat
groupId: com.azure
safeName: azurecommunicationchat
- name: azure-communication-sms
groupId: com.azure
safeName: azurecommunicationsms
ServiceDirectory: communication
EnvVars:
AZURE_TEST_MODE: LIVE
SKIP_PHONENUMBER_INTEGRATION_TESTS: TRUE
SKIP_LIVE_TEST: TRUE
AZURE_SUBSCRIPTION_ID: $(acs-subscription-id)
COMMUNICATION_LIVETEST_CONNECTION_STRING: $(communication-livetest-connection-string)
SMS_SERVICE_PHONE_NUMBER: $(communication-livetest-phone-number)
AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id)
AZURE_CLIENT_SECRET: $(aad-azure-sdk-test-client-secret)
AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id)

0 comments on commit 3c171e4

Please sign in to comment.