Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions sdk/communication/azure-communication-administration/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,6 @@
<artifactId>azure-core</artifactId>
<version>1.9.0</version> <!-- {x-version-update;com.azure:azure-core;dependency} -->
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core-http-netty</artifactId>
<version>1.6.2</version> <!-- {x-version-update;com.azure:azure-core-http-netty;dependency} -->
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-communication-common</artifactId>
Expand Down
6 changes: 0 additions & 6 deletions sdk/communication/azure-communication-chat/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,6 @@
<artifactId>azure-communication-administration</artifactId>
<version>1.0.0-beta.3</version> <!-- {x-version-update;com.azure:azure-communication-administration;current} -->
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core-http-netty</artifactId>
<version>1.6.2</version> <!-- {x-version-update;com.azure:azure-core-http-netty;dependency} -->
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core-test</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,12 @@
import com.azure.communication.chat.models.*;
import com.azure.communication.common.CommunicationUserCredential;
import com.azure.core.exception.HttpResponseException;
import com.azure.core.http.policy.FixedDelay;
import com.azure.core.http.policy.RetryPolicy;
import com.azure.core.http.HttpClient;
import com.azure.core.test.TestBase;
import com.azure.core.test.TestMode;
import com.azure.core.util.Configuration;
import com.azure.core.util.logging.ClientLogger;


import java.time.Duration;
import java.time.ZonedDateTime;
import java.time.LocalDateTime;
import java.time.ZoneId;
Expand All @@ -44,8 +40,6 @@ public class ChatClientTestBase extends TestBase {
protected static final String CONNSTRING = Configuration.getGlobalConfiguration()
.get("COMMUNICATION_SERVICES_CONNECTION_STRING", "pw==");

protected static final FixedDelay RETRY_STRATEGY = new FixedDelay(3, Duration.ofMillis(1000));

protected ChatClientBuilder getChatClientBuilder(String token, HttpClient httpClient) {
ChatClientBuilder builder = new ChatClientBuilder();

Expand All @@ -60,10 +54,7 @@ protected ChatClientBuilder getChatClientBuilder(String token, HttpClient httpCl
builder.credential(new CommunicationUserCredential(token));
}

if (interceptorManager.isLiveMode()) {
builder.addPolicy(new RetryPolicy(RETRY_STRATEGY));
}
else {
if (getTestMode() == TestMode.RECORD) {
builder.addPolicy(interceptorManager.getRecordPolicy());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

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

import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;

Expand Down Expand Up @@ -176,8 +178,7 @@ public void canAddListAndRemoveMembersWithResponseAsync(HttpClient httpClient) t
}

assertTrue(returnedMembers.size() == 4);
})
.verifyComplete();
});

for (ChatThreadMember member: options.getMembers()) {
StepVerifier.create(chatThreadClient.removeMemberWithResponse(member.getUser()))
Expand Down Expand Up @@ -408,6 +409,9 @@ public void canSendTypingNotificationWithResponse(HttpClient httpClient) {

@ParameterizedTest
@MethodSource("com.azure.core.test.TestBase#getHttpClients")
@DisabledIfEnvironmentVariable(
named = "SKIP_LIVE_TEST",
matches = "(?i)(true)")
public void canSendThenListReadReceipts(HttpClient httpClient) throws InterruptedException {
// Arrange
setupTest(httpClient);
Expand All @@ -431,16 +435,16 @@ public void canSendThenListReadReceipts(HttpClient httpClient) throws Interrupte
assertEquals(resp.getStatusCode(), 200);
resp.getItems().forEach(item -> returnedReadReceipts.add(item));
});

if (interceptorManager.isPlaybackMode()) {
assertTrue(returnedReadReceipts.size() > 0);
checkReadReceiptListContainsMessageId(returnedReadReceipts, messageResponseRef.get().getId());
}
assertTrue(returnedReadReceipts.size() > 0);
checkReadReceiptListContainsMessageId(returnedReadReceipts, messageResponseRef.get().getId());
});
}

@ParameterizedTest
@MethodSource("com.azure.core.test.TestBase#getHttpClients")
@DisabledIfEnvironmentVariable(
named = "SKIP_LIVE_TEST",
matches = "(?i)(true)")
public void canSendThenListReadReceiptsWithResponse(HttpClient httpClient) throws InterruptedException {
// Arrange
setupTest(httpClient);
Expand All @@ -466,12 +470,9 @@ public void canSendThenListReadReceiptsWithResponse(HttpClient httpClient) throw
resp.getItems().forEach(item -> returnedReadReceipts.add(item));
});

if (interceptorManager.isPlaybackMode()) {
assertTrue(returnedReadReceipts.size() > 0);
checkReadReceiptListContainsMessageId(returnedReadReceipts, messageResponseRef.get().getId());
}
})
.verifyComplete();
assertTrue(returnedReadReceipts.size() > 0);
checkReadReceiptListContainsMessageId(returnedReadReceipts, messageResponseRef.get().getId());
});

}
}
4 changes: 3 additions & 1 deletion sdk/communication/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ jobs:
safeName: azurecommunicationadministration
- name: azure-communication-chat
groupId: com.azure
safeName: azurecommunicationchatclient
safeName: azurecommunicationchat
ServiceDirectory: communication
EnvVars:
AZURE_TEST_MODE: LIVE
SKIP_PHONENUMBER_INTEGRATION_TESTS: TRUE
SKIP_LIVE_TEST: TRUE