From 2e837a34c0f8296a77bfa57e9e7e088d8b20e7c7 Mon Sep 17 00:00:00 2001 From: Arif Saikat <71465659+arifsaikat-microsoft@users.noreply.github.com> Date: Wed, 16 Jun 2021 12:47:03 -0700 Subject: [PATCH] skip test refactor --- .../CallConnectionAsyncLiveTests.java | 44 +++++++++++-------- .../CallConnectionLiveTests.java | 44 +++++++++++-------- .../DownloadContentAsyncLiveTests.java | 37 +++++++++------- .../DownloadContentLiveTests.java | 16 ++++--- .../ServerCallAsyncLiveTests.java | 16 ++++--- .../callingserver/ServerCallLiveTests.java | 16 ++++--- 6 files changed, 98 insertions(+), 75 deletions(-) diff --git a/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallConnectionAsyncLiveTests.java b/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallConnectionAsyncLiveTests.java index f3c2426363c7b..80a776f34a17e 100644 --- a/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallConnectionAsyncLiveTests.java +++ b/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallConnectionAsyncLiveTests.java @@ -14,7 +14,7 @@ import com.azure.communication.common.PhoneNumberIdentifier; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.Response; -import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable; +import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -27,9 +27,10 @@ public class CallConnectionAsyncLiveTests extends CallingServerTestBase { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable( - named = "COMMUNICATION_SKIP_INT_CALLINGSERVER_TEST", - matches = "(?i)(true)") + @EnabledIfEnvironmentVariable( + named = "RUN_CALLINGSERVER_TEST_RECORD", + matches = "(?i)(true)", + disabledReason = "Requires human intervention") public void runCreatePlayCancelHangupScenarioAsync(HttpClient httpClient) { CallingServerClientBuilder builder = getCallClientUsingConnectionString(httpClient); CallingServerAsyncClient callingServerAsyncClient = @@ -78,9 +79,10 @@ public void runCreatePlayCancelHangupScenarioAsync(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable( - named = "COMMUNICATION_SKIP_INT_CALLINGSERVER_TEST", - matches = "(?i)(true)") + @EnabledIfEnvironmentVariable( + named = "RUN_CALLINGSERVER_TEST_RECORD", + matches = "(?i)(true)", + disabledReason = "Requires human intervention") public void runCreatePlayCancelHangupScenarioWithResponseAsync(HttpClient httpClient) { CallingServerClientBuilder builder = getCallClientUsingConnectionString(httpClient); CallingServerAsyncClient callingServerAsyncClient = @@ -133,9 +135,10 @@ public void runCreatePlayCancelHangupScenarioWithResponseAsync(HttpClient httpCl @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable( - named = "COMMUNICATION_SKIP_INT_CALLINGSERVER_TEST", - matches = "(?i)(true)") + @EnabledIfEnvironmentVariable( + named = "RUN_CALLINGSERVER_TEST_RECORD", + matches = "(?i)(true)", + disabledReason = "Requires human intervention") public void runCreateAddRemoveHangupScenarioAsync(HttpClient httpClient) { CallingServerClientBuilder builder = getCallClientUsingConnectionString(httpClient); CallingServerAsyncClient callingServerAsyncClient = @@ -179,9 +182,10 @@ public void runCreateAddRemoveHangupScenarioAsync(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable( - named = "COMMUNICATION_SKIP_INT_CALLINGSERVER_TEST", - matches = "(?i)(true)") + @EnabledIfEnvironmentVariable( + named = "RUN_CALLINGSERVER_TEST_RECORD", + matches = "(?i)(true)", + disabledReason = "Requires human intervention") public void runCreateAddRemoveHangupScenarioWithResponseAsync(HttpClient httpClient) { CallingServerClientBuilder builder = getCallClientUsingConnectionString(httpClient); CallingServerAsyncClient callingServerAsyncClient = @@ -232,9 +236,10 @@ public void runCreateAddRemoveHangupScenarioWithResponseAsync(HttpClient httpCli @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable( - named = "COMMUNICATION_SKIP_INT_CALLINGSERVER_TEST", - matches = "(?i)(true)") + @EnabledIfEnvironmentVariable( + named = "RUN_CALLINGSERVER_TEST_RECORD", + matches = "(?i)(true)", + disabledReason = "Requires human intervention") public void runCreateJoinHangupScenarioAsync(HttpClient httpClient) { CallingServerClientBuilder builder = getCallClientUsingConnectionString(httpClient); CallingServerAsyncClient callingServerAsyncClient = @@ -286,9 +291,10 @@ public void runCreateJoinHangupScenarioAsync(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable( - named = "COMMUNICATION_SKIP_INT_CALLINGSERVER_TEST", - matches = "(?i)(true)") + @EnabledIfEnvironmentVariable( + named = "RUN_CALLINGSERVER_TEST_RECORD", + matches = "(?i)(true)", + disabledReason = "Requires human intervention") public void runCreateJoinHangupScenarioWithResponseAsync(HttpClient httpClient) { CallingServerClientBuilder builder = getCallClientUsingConnectionString(httpClient); CallingServerAsyncClient callingServerAsyncClient = diff --git a/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallConnectionLiveTests.java b/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallConnectionLiveTests.java index 6a4bffdd10ba3..e6d8e66de9e85 100644 --- a/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallConnectionLiveTests.java +++ b/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallConnectionLiveTests.java @@ -14,7 +14,7 @@ import com.azure.communication.common.PhoneNumberIdentifier; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.Response; -import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable; +import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -27,9 +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)") + @EnabledIfEnvironmentVariable( + named = "RUN_CALLINGSERVER_TEST_RECORD", + matches = "(?i)(true)", + disabledReason = "Requires human intervention") public void runCreatePlayCancelHangupScenario(HttpClient httpClient) { CallingServerClientBuilder builder = getCallClientUsingConnectionString(httpClient); CallingServerClient callingServerClient = setupClient(builder, "runCreatePlayCancelHangupScenario"); @@ -76,9 +77,10 @@ public void runCreatePlayCancelHangupScenario(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable( - named = "COMMUNICATION_SKIP_INT_CALLINGSERVER_TEST", - matches = "(?i)(true)") + @EnabledIfEnvironmentVariable( + named = "RUN_CALLINGSERVER_TEST_RECORD", + matches = "(?i)(true)", + disabledReason = "Requires human intervention") public void runCreatePlayCancelHangupScenarioWithResponse(HttpClient httpClient) { CallingServerClientBuilder builder = getCallClientUsingConnectionString(httpClient); CallingServerClient callingServerClient = @@ -132,9 +134,10 @@ public void runCreatePlayCancelHangupScenarioWithResponse(HttpClient httpClient) @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable( - named = "COMMUNICATION_SKIP_INT_CALLINGSERVER_TEST", - matches = "(?i)(true)") + @EnabledIfEnvironmentVariable( + named = "RUN_CALLINGSERVER_TEST_RECORD", + matches = "(?i)(true)", + disabledReason = "Requires human intervention") public void runCreateAddRemoveHangupScenario(HttpClient httpClient) { CallingServerClientBuilder builder = getCallClientUsingConnectionString(httpClient); CallingServerClient callingServerClient = setupClient(builder, "runCreateAddRemoveHangupScenario"); @@ -172,9 +175,10 @@ public void runCreateAddRemoveHangupScenario(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable( - named = "COMMUNICATION_SKIP_INT_CALLINGSERVER_TEST", - matches = "(?i)(true)") + @EnabledIfEnvironmentVariable( + named = "RUN_CALLINGSERVER_TEST_RECORD", + matches = "(?i)(true)", + disabledReason = "Requires human intervention") public void runCreateAddRemoveHangupScenarioWithResponse(HttpClient httpClient) { CallingServerClientBuilder builder = getCallClientUsingConnectionString(httpClient); CallingServerClient callingServerClient = @@ -225,9 +229,10 @@ public void runCreateAddRemoveHangupScenarioWithResponse(HttpClient httpClient) @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable( - named = "COMMUNICATION_SKIP_INT_CALLINGSERVER_TEST", - matches = "(?i)(true)") + @EnabledIfEnvironmentVariable( + named = "RUN_CALLINGSERVER_TEST_RECORD", + matches = "(?i)(true)", + disabledReason = "Requires human intervention") public void runCreateJoinHangupScenario(HttpClient httpClient) { CallingServerClientBuilder builder = getCallClientUsingConnectionString(httpClient); CallingServerClient callingServerClient = setupClient(builder, "runCreateJoinHangupScenario"); @@ -273,9 +278,10 @@ public void runCreateJoinHangupScenario(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable( - named = "COMMUNICATION_SKIP_INT_CALLINGSERVER_TEST", - matches = "(?i)(true)") + @EnabledIfEnvironmentVariable( + named = "RUN_CALLINGSERVER_TEST_RECORD", + matches = "(?i)(true)", + disabledReason = "Requires human intervention") public void runCreateJoinHangupScenarioWithResponse(HttpClient httpClient) { CallingServerClientBuilder builder = getCallClientUsingConnectionString(httpClient); CallingServerClient callingServerClient = diff --git a/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/DownloadContentAsyncLiveTests.java b/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/DownloadContentAsyncLiveTests.java index ff209eb28b95f..cbbcd18842af2 100644 --- a/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/DownloadContentAsyncLiveTests.java +++ b/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/DownloadContentAsyncLiveTests.java @@ -8,7 +8,7 @@ import com.azure.core.http.HttpClient; import com.azure.core.http.rest.Response; import com.azure.core.util.FluxUtil; -import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable; +import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; import org.mockito.Mockito; @@ -35,9 +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)") + @EnabledIfEnvironmentVariable( + named = "RUN_CALLINGSERVER_TEST_RECORD", + matches = "(?i)(true)", + disabledReason = "Requires human intervention") public void downloadMetadataAsync(HttpClient httpClient) { CallingServerClientBuilder builder = getConversationClientUsingConnectionString(httpClient); CallingServerAsyncClient conversationAsyncClient = setupAsyncClient(builder, "downloadMetadataAsync"); @@ -56,9 +57,10 @@ public void downloadMetadataAsync(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable( - named = "COMMUNICATION_SKIP_INT_CALLINGSERVER_TEST", - matches = "(?i)(true)") + @EnabledIfEnvironmentVariable( + named = "RUN_CALLINGSERVER_TEST_RECORD", + matches = "(?i)(true)", + disabledReason = "Requires human intervention") public void downloadMetadataRetryingAsync(HttpClient httpClient) { CallingServerClientBuilder builder = getConversationClientUsingConnectionString(httpClient); CallingServerAsyncClient conversationAsyncClient = setupAsyncClient(builder, "downloadMetadataAsync"); @@ -77,9 +79,10 @@ public void downloadMetadataRetryingAsync(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable( - named = "COMMUNICATION_SKIP_INT_CALLINGSERVER_TEST", - matches = "(?i)(true)") + @EnabledIfEnvironmentVariable( + named = "RUN_CALLINGSERVER_TEST_RECORD", + matches = "(?i)(true)", + disabledReason = "Requires human intervention") public void downloadVideoAsync(HttpClient httpClient) { CallingServerClientBuilder builder = getConversationClientUsingConnectionString(httpClient); CallingServerAsyncClient conversationAsyncClient = setupAsyncClient(builder, "downloadVideoAsync"); @@ -98,9 +101,10 @@ public void downloadVideoAsync(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable( - named = "COMMUNICATION_SKIP_INT_CALLINGSERVER_TEST", - matches = "(?i)(true)") + @EnabledIfEnvironmentVariable( + named = "RUN_CALLINGSERVER_TEST_RECORD", + matches = "(?i)(true)", + disabledReason = "Requires human intervention") public void downloadToFileAsync(HttpClient httpClient) { CallingServerClientBuilder builder = getConversationClientUsingConnectionString(httpClient); CallingServerAsyncClient conversationAsyncClient = setupAsyncClient(builder, "downloadToFileAsync"); @@ -132,9 +136,10 @@ public void downloadToFileAsync(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable( - named = "COMMUNICATION_SKIP_INT_CALLINGSERVER_TEST", - matches = "(?i)(true)") + @EnabledIfEnvironmentVariable( + named = "RUN_CALLINGSERVER_TEST_RECORD", + matches = "(?i)(true)", + disabledReason = "Requires human intervention") public void downloadToFileRetryingAsync(HttpClient httpClient) { CallingServerClientBuilder builder = getConversationClientUsingConnectionString(httpClient); CallingServerAsyncClient conversationAsyncClient = setupAsyncClient(builder, "downloadToFileAsync"); diff --git a/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/DownloadContentLiveTests.java b/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/DownloadContentLiveTests.java index fc0c00135073d..7ff2806fc4d9a 100644 --- a/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/DownloadContentLiveTests.java +++ b/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/DownloadContentLiveTests.java @@ -6,7 +6,7 @@ import com.azure.communication.callingserver.models.CallingServerErrorException; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.Response; -import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable; +import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; import org.mockito.Mockito; @@ -28,9 +28,10 @@ public class DownloadContentLiveTests extends CallingServerTestBase { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable( - named = "COMMUNICATION_SKIP_INT_CALLINGSERVER_TEST", - matches = "(?i)(true)") + @EnabledIfEnvironmentVariable( + named = "RUN_CALLINGSERVER_TEST_RECORD", + matches = "(?i)(true)", + disabledReason = "Requires human intervention") public void downloadMetadata(HttpClient httpClient) throws UnsupportedEncodingException { CallingServerClientBuilder builder = getConversationClientUsingConnectionString(httpClient); CallingServerClient conversationClient = setupClient(builder, "downloadMetadata"); @@ -48,9 +49,10 @@ public void downloadMetadata(HttpClient httpClient) throws UnsupportedEncodingEx @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable( - named = "COMMUNICATION_SKIP_INT_CALLINGSERVER_TEST", - matches = "(?i)(true)") + @EnabledIfEnvironmentVariable( + named = "RUN_CALLINGSERVER_TEST_RECORD", + matches = "(?i)(true)", + disabledReason = "Requires human intervention") public void downloadVideo(HttpClient httpClient) { CallingServerClientBuilder builder = getConversationClientUsingConnectionString(httpClient); CallingServerClient conversationClient = setupClient(builder, "downloadVideo"); diff --git a/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/ServerCallAsyncLiveTests.java b/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/ServerCallAsyncLiveTests.java index 3c92fa4b2735f..0d94b095cb2f2 100644 --- a/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/ServerCallAsyncLiveTests.java +++ b/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/ServerCallAsyncLiveTests.java @@ -18,7 +18,7 @@ import com.azure.communication.common.PhoneNumberIdentifier; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.Response; -import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable; +import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -208,9 +208,10 @@ public void startRecordingFailsAsync(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable( - named = "COMMUNICATION_SKIP_INT_CALLINGSERVER_TEST", - matches = "(?i)(true)") + @EnabledIfEnvironmentVariable( + named = "RUN_CALLINGSERVER_TEST_RECORD", + matches = "(?i)(true)", + disabledReason = "Requires human intervention") public void runAddRemoveScenarioAsync(HttpClient httpClient) { CallingServerClientBuilder builder = getConversationClientUsingConnectionString(httpClient); CallingServerAsyncClient callingServerAsyncClient = @@ -265,9 +266,10 @@ public void runAddRemoveScenarioAsync(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable( - named = "COMMUNICATION_SKIP_INT_CALLINGSERVER_TEST", - matches = "(?i)(true)") + @EnabledIfEnvironmentVariable( + named = "RUN_CALLINGSERVER_TEST_RECORD", + matches = "(?i)(true)", + disabledReason = "Requires human intervention") public void runAddRemoveScenarioWithResponseAsync(HttpClient httpClient) { CallingServerClientBuilder builder = getConversationClientUsingConnectionString(httpClient); CallingServerAsyncClient callingServerAsyncClient = setupAsyncClient(builder, "runAddRemoveScenarioWithResponseAsync"); diff --git a/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/ServerCallLiveTests.java b/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/ServerCallLiveTests.java index cd646e1c90dec..5f675bc726834 100644 --- a/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/ServerCallLiveTests.java +++ b/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/ServerCallLiveTests.java @@ -19,7 +19,7 @@ import com.azure.core.http.HttpClient; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable; +import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -203,9 +203,10 @@ public void startRecordingFails(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable( - named = "COMMUNICATION_SKIP_INT_CALLINGSERVER_TEST", - matches = "(?i)(true)") + @EnabledIfEnvironmentVariable( + named = "RUN_CALLINGSERVER_TEST_RECORD", + matches = "(?i)(true)", + disabledReason = "Requires human intervention") public void runAddRemoveScenario(HttpClient httpClient) { CallingServerClientBuilder builder = getConversationClientUsingConnectionString(httpClient); CallingServerClient callingServerClient = setupClient(builder, "runAddRemoveScenario"); @@ -255,9 +256,10 @@ public void runAddRemoveScenario(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - @DisabledIfEnvironmentVariable( - named = "COMMUNICATION_SKIP_INT_CALLINGSERVER_TEST", - matches = "(?i)(true)") + @EnabledIfEnvironmentVariable( + named = "RUN_CALLINGSERVER_TEST_RECORD", + matches = "(?i)(true)", + disabledReason = "Requires human intervention") public void runAddRemoveScenarioWithResponse(HttpClient httpClient) { CallingServerClientBuilder builder = getConversationClientUsingConnectionString(httpClient); CallingServerClient callingServerClient = setupClient(builder, "runAddRemoveScenarioWithResponse");