Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR for Server Calling SDK Public Preview #22282

Merged
merged 12 commits into from
Jun 16, 2021
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import com.azure.communication.common.PhoneNumberIdentifier;
import com.azure.core.http.HttpClient;
import com.azure.core.http.rest.Response;
import com.azure.core.test.TestMode;
import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;

Expand All @@ -27,15 +27,10 @@ public class CallConnectionAsyncLiveTests extends CallingServerTestBase {

@ParameterizedTest
@MethodSource("com.azure.core.test.TestBase#getHttpClients")
@DisabledIfEnvironmentVariable(
named = "COMMUNICATION_SKIP_INT_CALLINGSERVER_TEST",
arifsaikat-microsoft marked this conversation as resolved.
Show resolved Hide resolved
matches = "(?i)(true)")
arifsaikat-microsoft marked this conversation as resolved.
Show resolved Hide resolved
public void runCreatePlayCancelHangupScenarioAsync(HttpClient httpClient) {

// This test requires human intervention to record and
// will not function in live mode.
if (this.getTestMode() == TestMode.LIVE) {
System.out.println("Warning: Test is skipped, does not support live mode.");
return;
}

CallingServerClientBuilder builder = getCallClientUsingConnectionString(httpClient);
CallingServerAsyncClient callingServerAsyncClient =
setupAsyncClient(builder, "runCreatePlayCancelHangupScenarioAsync");
Expand Down Expand Up @@ -83,15 +78,10 @@ public void runCreatePlayCancelHangupScenarioAsync(HttpClient httpClient) {

@ParameterizedTest
@MethodSource("com.azure.core.test.TestBase#getHttpClients")
@DisabledIfEnvironmentVariable(
named = "COMMUNICATION_SKIP_INT_CALLINGSERVER_TEST",
matches = "(?i)(true)")
public void runCreatePlayCancelHangupScenarioWithResponseAsync(HttpClient httpClient) {

// This test requires human intervention to record and
// will not function in live mode.
if (this.getTestMode() == TestMode.LIVE) {
System.out.println("Warning: Test is skipped, does not support live mode.");
return;
}

CallingServerClientBuilder builder = getCallClientUsingConnectionString(httpClient);
CallingServerAsyncClient callingServerAsyncClient =
setupAsyncClient(builder, "runCreatePlayCancelHangupScenarioWithResponseAsync");
Expand Down Expand Up @@ -143,15 +133,10 @@ public void runCreatePlayCancelHangupScenarioWithResponseAsync(HttpClient httpCl

@ParameterizedTest
@MethodSource("com.azure.core.test.TestBase#getHttpClients")
@DisabledIfEnvironmentVariable(
named = "COMMUNICATION_SKIP_INT_CALLINGSERVER_TEST",
matches = "(?i)(true)")
public void runCreateAddRemoveHangupScenarioAsync(HttpClient httpClient) {

// This test requires human intervention to record and
// will not function in live mode.
if (this.getTestMode() == TestMode.LIVE) {
System.out.println("Warning: Test is skipped, does not support live mode.");
return;
}

CallingServerClientBuilder builder = getCallClientUsingConnectionString(httpClient);
CallingServerAsyncClient callingServerAsyncClient =
setupAsyncClient(builder, "runCreateAddRemoveHangupScenarioAsync");
Expand Down Expand Up @@ -194,15 +179,10 @@ public void runCreateAddRemoveHangupScenarioAsync(HttpClient httpClient) {

@ParameterizedTest
@MethodSource("com.azure.core.test.TestBase#getHttpClients")
@DisabledIfEnvironmentVariable(
named = "COMMUNICATION_SKIP_INT_CALLINGSERVER_TEST",
matches = "(?i)(true)")
public void runCreateAddRemoveHangupScenarioWithResponseAsync(HttpClient httpClient) {

// This test requires human intervention to record and
// will not function in live mode.
if (this.getTestMode() == TestMode.LIVE) {
System.out.println("Warning: Test is skipped, does not support live mode.");
return;
}

CallingServerClientBuilder builder = getCallClientUsingConnectionString(httpClient);
CallingServerAsyncClient callingServerAsyncClient =
setupAsyncClient(builder, "runCreateAddRemoveHangupScenarioWithResponseAsync");
Expand Down Expand Up @@ -252,15 +232,10 @@ public void runCreateAddRemoveHangupScenarioWithResponseAsync(HttpClient httpCli

@ParameterizedTest
@MethodSource("com.azure.core.test.TestBase#getHttpClients")
@DisabledIfEnvironmentVariable(
named = "COMMUNICATION_SKIP_INT_CALLINGSERVER_TEST",
matches = "(?i)(true)")
public void runCreateJoinHangupScenarioAsync(HttpClient httpClient) {

// This test requires human intervention to record and
// will not function in live mode.
if (this.getTestMode() == TestMode.LIVE) {
System.out.println("Warning: Test is skipped, does not support live mode.");
return;
}

CallingServerClientBuilder builder = getCallClientUsingConnectionString(httpClient);
CallingServerAsyncClient callingServerAsyncClient =
setupAsyncClient(builder, "runCreateJoinHangupScenarioAsync");
Expand Down Expand Up @@ -311,15 +286,10 @@ public void runCreateJoinHangupScenarioAsync(HttpClient httpClient) {

@ParameterizedTest
@MethodSource("com.azure.core.test.TestBase#getHttpClients")
@DisabledIfEnvironmentVariable(
named = "COMMUNICATION_SKIP_INT_CALLINGSERVER_TEST",
matches = "(?i)(true)")
public void runCreateJoinHangupScenarioWithResponseAsync(HttpClient httpClient) {

// This test requires human intervention to record and
// will not function in live mode.
if (this.getTestMode() == TestMode.LIVE) {
System.out.println("Warning: Test is skipped, does not support live mode.");
return;
}

CallingServerClientBuilder builder = getCallClientUsingConnectionString(httpClient);
CallingServerAsyncClient callingServerAsyncClient =
setupAsyncClient(builder, "runCreateJoinHangupScenarioWithResponseAsync");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import com.azure.communication.common.PhoneNumberIdentifier;
import com.azure.core.http.HttpClient;
import com.azure.core.http.rest.Response;
import com.azure.core.test.TestMode;
import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;

Expand All @@ -27,15 +27,10 @@ public class CallConnectionLiveTests extends CallingServerTestBase {

@ParameterizedTest
@MethodSource("com.azure.core.test.TestBase#getHttpClients")
@DisabledIfEnvironmentVariable(
named = "COMMUNICATION_SKIP_INT_CALLINGSERVER_TEST",
matches = "(?i)(true)")
public void runCreatePlayCancelHangupScenario(HttpClient httpClient) {

// This test requires human intervention to record and
// will not function in live mode.
if (this.getTestMode() == TestMode.LIVE) {
System.out.println("Warning: Test is skipped, does not support live mode.");
return;
}

CallingServerClientBuilder builder = getCallClientUsingConnectionString(httpClient);
CallingServerClient callingServerClient = setupClient(builder, "runCreatePlayCancelHangupScenario");

Expand Down Expand Up @@ -81,15 +76,10 @@ public void runCreatePlayCancelHangupScenario(HttpClient httpClient) {

@ParameterizedTest
@MethodSource("com.azure.core.test.TestBase#getHttpClients")
@DisabledIfEnvironmentVariable(
named = "COMMUNICATION_SKIP_INT_CALLINGSERVER_TEST",
matches = "(?i)(true)")
public void runCreatePlayCancelHangupScenarioWithResponse(HttpClient httpClient) {

// This test requires human intervention to record and
// will not function in live mode.
if (this.getTestMode() == TestMode.LIVE) {
System.out.println("Warning: Test is skipped, does not support live mode.");
return;
}

CallingServerClientBuilder builder = getCallClientUsingConnectionString(httpClient);
CallingServerClient callingServerClient =
setupClient(builder, "runCreatePlayCancelHangupScenarioWithResponse");
Expand Down Expand Up @@ -142,15 +132,10 @@ public void runCreatePlayCancelHangupScenarioWithResponse(HttpClient httpClient)

@ParameterizedTest
@MethodSource("com.azure.core.test.TestBase#getHttpClients")
@DisabledIfEnvironmentVariable(
named = "COMMUNICATION_SKIP_INT_CALLINGSERVER_TEST",
matches = "(?i)(true)")
public void runCreateAddRemoveHangupScenario(HttpClient httpClient) {

// This test requires human intervention to record and
// will not function in live mode.
if (this.getTestMode() == TestMode.LIVE) {
System.out.println("Warning: Test is skipped, does not support live mode.");
return;
}

CallingServerClientBuilder builder = getCallClientUsingConnectionString(httpClient);
CallingServerClient callingServerClient = setupClient(builder, "runCreateAddRemoveHangupScenario");

Expand Down Expand Up @@ -187,15 +172,10 @@ public void runCreateAddRemoveHangupScenario(HttpClient httpClient) {

@ParameterizedTest
@MethodSource("com.azure.core.test.TestBase#getHttpClients")
@DisabledIfEnvironmentVariable(
named = "COMMUNICATION_SKIP_INT_CALLINGSERVER_TEST",
matches = "(?i)(true)")
public void runCreateAddRemoveHangupScenarioWithResponse(HttpClient httpClient) {

// This test requires human intervention to record and
// will not function in live mode.
if (this.getTestMode() == TestMode.LIVE) {
System.out.println("Warning: Test is skipped, does not support live mode.");
return;
}

CallingServerClientBuilder builder = getCallClientUsingConnectionString(httpClient);
CallingServerClient callingServerClient =
setupClient(builder, "runCreateAddRemoveHangupScenarioWithResponse");
Expand Down Expand Up @@ -245,15 +225,10 @@ public void runCreateAddRemoveHangupScenarioWithResponse(HttpClient httpClient)

@ParameterizedTest
@MethodSource("com.azure.core.test.TestBase#getHttpClients")
@DisabledIfEnvironmentVariable(
named = "COMMUNICATION_SKIP_INT_CALLINGSERVER_TEST",
matches = "(?i)(true)")
public void runCreateJoinHangupScenario(HttpClient httpClient) {

// This test requires human intervention to record and
// will not function in live mode.
if (this.getTestMode() == TestMode.LIVE) {
System.out.println("Warning: Test is skipped, does not support live mode.");
return;
}

CallingServerClientBuilder builder = getCallClientUsingConnectionString(httpClient);
CallingServerClient callingServerClient = setupClient(builder, "runCreateJoinHangupScenario");

Expand Down Expand Up @@ -298,15 +273,10 @@ public void runCreateJoinHangupScenario(HttpClient httpClient) {

@ParameterizedTest
@MethodSource("com.azure.core.test.TestBase#getHttpClients")
@DisabledIfEnvironmentVariable(
named = "COMMUNICATION_SKIP_INT_CALLINGSERVER_TEST",
matches = "(?i)(true)")
public void runCreateJoinHangupScenarioWithResponse(HttpClient httpClient) {

// This test requires human intervention to record and
// will not function in live mode.
if (this.getTestMode() == TestMode.LIVE) {
System.out.println("Warning: Test is skipped, does not support live mode.");
return;
}

CallingServerClientBuilder builder = getCallClientUsingConnectionString(httpClient);
CallingServerClient callingServerClient =
setupClient(builder, "runCreateJoinHangupScenarioWithResponse");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import com.azure.communication.callingserver.models.ParallelDownloadOptions;
import com.azure.core.http.HttpClient;
import com.azure.core.http.rest.Response;
import com.azure.core.test.TestMode;
import com.azure.core.util.FluxUtil;
import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;
import org.mockito.Mockito;
Expand All @@ -21,10 +21,10 @@
import java.nio.file.Paths;

import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.notNullValue;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyLong;
Expand All @@ -35,15 +35,10 @@ public class DownloadContentAsyncLiveTests extends CallingServerTestBase {

@ParameterizedTest
@MethodSource("com.azure.core.test.TestBase#getHttpClients")
@DisabledIfEnvironmentVariable(
named = "COMMUNICATION_SKIP_INT_CALLINGSERVER_TEST",
matches = "(?i)(true)")
public void downloadMetadataAsync(HttpClient httpClient) {

// This test requires human intervention to record and
// will not function in live mode.
if (this.getTestMode() == TestMode.LIVE) {
System.out.println("Warning: Test is skipped, does not support live mode.");
return;
}

CallingServerClientBuilder builder = getConversationClientUsingConnectionString(httpClient);
CallingServerAsyncClient conversationAsyncClient = setupAsyncClient(builder, "downloadMetadataAsync");

Expand All @@ -61,15 +56,10 @@ public void downloadMetadataAsync(HttpClient httpClient) {

@ParameterizedTest
@MethodSource("com.azure.core.test.TestBase#getHttpClients")
@DisabledIfEnvironmentVariable(
named = "COMMUNICATION_SKIP_INT_CALLINGSERVER_TEST",
matches = "(?i)(true)")
public void downloadMetadataRetryingAsync(HttpClient httpClient) {

// This test requires human intervention to record and
// will not function in live mode.
if (this.getTestMode() == TestMode.LIVE) {
System.out.println("Warning: Test is skipped, does not support live mode.");
return;
}

CallingServerClientBuilder builder = getConversationClientUsingConnectionString(httpClient);
CallingServerAsyncClient conversationAsyncClient = setupAsyncClient(builder, "downloadMetadataAsync");

Expand All @@ -87,15 +77,10 @@ public void downloadMetadataRetryingAsync(HttpClient httpClient) {

@ParameterizedTest
@MethodSource("com.azure.core.test.TestBase#getHttpClients")
@DisabledIfEnvironmentVariable(
named = "COMMUNICATION_SKIP_INT_CALLINGSERVER_TEST",
matches = "(?i)(true)")
public void downloadVideoAsync(HttpClient httpClient) {

// This test requires human intervention to record and
// will not function in live mode.
if (this.getTestMode() == TestMode.LIVE) {
System.out.println("Warning: Test is skipped, does not support live mode.");
return;
}

CallingServerClientBuilder builder = getConversationClientUsingConnectionString(httpClient);
CallingServerAsyncClient conversationAsyncClient = setupAsyncClient(builder, "downloadVideoAsync");

Expand All @@ -113,15 +98,10 @@ public void downloadVideoAsync(HttpClient httpClient) {

@ParameterizedTest
@MethodSource("com.azure.core.test.TestBase#getHttpClients")
@DisabledIfEnvironmentVariable(
named = "COMMUNICATION_SKIP_INT_CALLINGSERVER_TEST",
matches = "(?i)(true)")
public void downloadToFileAsync(HttpClient httpClient) {

// This test requires human intervention to record and
// will not function in live mode.
if (this.getTestMode() == TestMode.LIVE) {
System.out.println("Warning: Test is skipped, does not support live mode.");
return;
}

CallingServerClientBuilder builder = getConversationClientUsingConnectionString(httpClient);
CallingServerAsyncClient conversationAsyncClient = setupAsyncClient(builder, "downloadToFileAsync");
AsynchronousFileChannel channel = Mockito.mock(AsynchronousFileChannel.class);
Expand Down Expand Up @@ -152,15 +132,10 @@ public void downloadToFileAsync(HttpClient httpClient) {

@ParameterizedTest
@MethodSource("com.azure.core.test.TestBase#getHttpClients")
@DisabledIfEnvironmentVariable(
named = "COMMUNICATION_SKIP_INT_CALLINGSERVER_TEST",
matches = "(?i)(true)")
public void downloadToFileRetryingAsync(HttpClient httpClient) {

// This test requires human intervention to record and
// will not function in live mode.
if (this.getTestMode() == TestMode.LIVE) {
System.out.println("Warning: Test is skipped, does not support live mode.");
return;
}

CallingServerClientBuilder builder = getConversationClientUsingConnectionString(httpClient);
CallingServerAsyncClient conversationAsyncClient = setupAsyncClient(builder, "downloadToFileAsync");
AsynchronousFileChannel channel = Mockito.mock(AsynchronousFileChannel.class);
Expand Down
Loading