diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallRecordingAsync.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallRecordingAsync.java index 4301d1a659f05..8f8093897ed0d 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallRecordingAsync.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallRecordingAsync.java @@ -45,8 +45,6 @@ import java.io.IOException; import java.io.OutputStream; import java.net.MalformedURLException; -import java.net.URI; -import java.net.URISyntaxException; import java.net.URL; import java.nio.ByteBuffer; import java.nio.channels.AsynchronousFileChannel; @@ -115,10 +113,6 @@ public Mono> startRecordingWithResponse(StartReco Mono> startRecordingWithResponseInternal(StartRecordingOptions options, Context context) { try { - String callbackUrl = options.getRecordingStateCallbackUrl(); - if (callbackUrl != null && !callbackUrl.isEmpty() && !Boolean.TRUE.equals(new URI(callbackUrl).isAbsolute())) { - throw logger.logExceptionAsError(new InvalidParameterException("'recordingStateCallbackUri' has to be an absolute Uri")); - } StartCallRecordingRequestInternal request = getStartCallRecordingRequest(options); return withContext(contextValue -> { @@ -134,8 +128,6 @@ Mono> startRecordingWithResponseInternal(StartRec }); } catch (RuntimeException ex) { return monoError(logger, ex); - } catch (URISyntaxException ex) { - return monoError(logger, new RuntimeException(ex)); } } diff --git a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallRecordingAsyncUnitTests.java b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallRecordingAsyncUnitTests.java index 4e5df1a101238..c56d91d557e08 100644 --- a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallRecordingAsyncUnitTests.java +++ b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallRecordingAsyncUnitTests.java @@ -4,23 +4,16 @@ package com.azure.communication.callautomation; import com.azure.communication.callautomation.models.CallingServerErrorException; -import com.azure.communication.callautomation.models.RecordingChannel; -import com.azure.communication.callautomation.models.RecordingContent; -import com.azure.communication.callautomation.models.RecordingFormat; import com.azure.communication.callautomation.models.RecordingState; import com.azure.communication.callautomation.models.RecordingStateResult; import com.azure.communication.callautomation.models.ServerCallLocator; import com.azure.communication.callautomation.models.StartRecordingOptions; -import com.azure.communication.common.CommunicationIdentifier; -import com.azure.communication.common.CommunicationUserIdentifier; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.reactivestreams.Publisher; import reactor.test.StepVerifier; -import java.security.InvalidParameterException; import java.util.ArrayList; -import java.util.Arrays; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -33,28 +26,6 @@ public void setup() { callRecording = callingServerClient.getCallRecordingAsync(); } - @Test - public void startRecordingRelativeUriFails() { - validateError(InvalidParameterException.class, - callRecording.startRecording(new StartRecordingOptions(new ServerCallLocator(SERVER_CALL_ID)) - .setRecordingStateCallbackUrl("/not/absolute/uri") - )); - } - - @Test - public void startRecordingWithFullParamsFails() { - StartRecordingOptions startRecordingOptions = new StartRecordingOptions(new ServerCallLocator(SERVER_CALL_ID)) - .setRecordingContent(RecordingContent.AUDIO_VIDEO) - .setRecordingChannel(RecordingChannel.MIXED) - .setRecordingFormat(RecordingFormat.MP4) - .setRecordingStateCallbackUrl("/not/absolute/uri") - .setAudioChannelParticipantOrdering(new ArrayList(Arrays.asList( - new CommunicationUserIdentifier("rawId1"), - new CommunicationUserIdentifier("rawId2")))); - - validateError(InvalidParameterException.class, callRecording.startRecordingWithResponse(startRecordingOptions)); - } - @Test public void recordingOperationsTest() { CallAutomationAsyncClient callingServerClient = CallAutomationUnitTestBase.getCallAutomationAsyncClient( diff --git a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallRecordingUnitTests.java b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallRecordingUnitTests.java index e627b250a0446..c4c8ea2abc85f 100644 --- a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallRecordingUnitTests.java +++ b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallRecordingUnitTests.java @@ -4,22 +4,14 @@ package com.azure.communication.callautomation; import com.azure.communication.callautomation.models.CallingServerErrorException; -import com.azure.communication.callautomation.models.RecordingChannel; -import com.azure.communication.callautomation.models.RecordingContent; -import com.azure.communication.callautomation.models.RecordingFormat; import com.azure.communication.callautomation.models.RecordingState; import com.azure.communication.callautomation.models.RecordingStateResult; import com.azure.communication.callautomation.models.ServerCallLocator; import com.azure.communication.callautomation.models.StartRecordingOptions; -import com.azure.communication.common.CommunicationIdentifier; -import com.azure.communication.common.CommunicationUserIdentifier; -import com.azure.core.util.Context; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import java.security.InvalidParameterException; import java.util.ArrayList; -import java.util.Arrays; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; @@ -32,31 +24,6 @@ public void setup() { CallAutomationClient callAutomationClient = CallAutomationUnitTestBase.getCallAutomationClient(new ArrayList<>()); callRecording = callAutomationClient.getCallRecording(); } - @Test - public void startRecordingRelativeUriFails() { - assertThrows( - InvalidParameterException.class, - () -> callRecording.startRecording(new StartRecordingOptions(new ServerCallLocator(SERVER_CALL_ID)) - .setRecordingStateCallbackUrl("/not/absolute/uri") - )); - } - - @Test - public void startRecordingWithFullParamsFails() { - StartRecordingOptions startRecordingOptions = new StartRecordingOptions(new ServerCallLocator(SERVER_CALL_ID)) - .setRecordingContent(RecordingContent.AUDIO_VIDEO) - .setRecordingChannel(RecordingChannel.MIXED) - .setRecordingFormat(RecordingFormat.MP4) - .setRecordingStateCallbackUrl("/not/absolute/uri") - .setAudioChannelParticipantOrdering(new ArrayList(Arrays.asList( - new CommunicationUserIdentifier("rawId1"), - new CommunicationUserIdentifier("rawId2")))); - - assertThrows( - InvalidParameterException.class, - () -> callRecording.startRecordingWithResponse(startRecordingOptions, Context.NONE) - ); - } @Test public void recordingOperationsTest() { diff --git a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/CallRecordingAsync.java b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/CallRecordingAsync.java index 0c13eb114eaaa..4afe46e0da48e 100644 --- a/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/CallRecordingAsync.java +++ b/sdk/communication/azure-communication-callingserver/src/main/java/com/azure/communication/callingserver/CallRecordingAsync.java @@ -42,8 +42,6 @@ import java.io.IOException; import java.io.OutputStream; import java.net.MalformedURLException; -import java.net.URI; -import java.net.URISyntaxException; import java.net.URL; import java.nio.ByteBuffer; import java.nio.channels.AsynchronousFileChannel; @@ -114,10 +112,6 @@ public Mono> startRecordingWithResponse(StartReco Mono> startRecordingWithResponseInternal(StartRecordingOptions options, Context context) { try { - String callbackUrl = options.getRecordingStateCallbackUrl(); - if (callbackUrl != null && !callbackUrl.isEmpty() && !Boolean.TRUE.equals(new URI(callbackUrl).isAbsolute())) { - throw logger.logExceptionAsError(new InvalidParameterException("'recordingStateCallbackUri' has to be an absolute Uri")); - } StartCallRecordingRequestInternal request = getStartCallRecordingRequest(options); return withContext(contextValue -> { @@ -131,8 +125,6 @@ Mono> startRecordingWithResponseInternal(StartRec }); } catch (RuntimeException ex) { return monoError(logger, ex); - } catch (URISyntaxException ex) { - return monoError(logger, new RuntimeException(ex)); } } diff --git a/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallRecordingAsyncUnitTests.java b/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallRecordingAsyncUnitTests.java index 99eb798aa4371..98b8e0a2779a7 100644 --- a/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallRecordingAsyncUnitTests.java +++ b/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallRecordingAsyncUnitTests.java @@ -4,23 +4,16 @@ package com.azure.communication.callingserver; import com.azure.communication.callingserver.models.CallingServerErrorException; -import com.azure.communication.callingserver.models.ChannelAffinity; -import com.azure.communication.callingserver.models.RecordingChannel; -import com.azure.communication.callingserver.models.RecordingContent; -import com.azure.communication.callingserver.models.RecordingFormat; import com.azure.communication.callingserver.models.RecordingState; import com.azure.communication.callingserver.models.RecordingStateResult; import com.azure.communication.callingserver.models.ServerCallLocator; import com.azure.communication.callingserver.models.StartRecordingOptions; -import com.azure.communication.common.CommunicationUserIdentifier; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.reactivestreams.Publisher; import reactor.test.StepVerifier; -import java.security.InvalidParameterException; import java.util.ArrayList; -import java.util.Arrays; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -33,28 +26,6 @@ public void setup() { callRecording = callingServerClient.getCallRecordingAsync(); } - @Test - public void startRecordingRelativeUriFails() { - validateError(InvalidParameterException.class, - callRecording.startRecording(new StartRecordingOptions(new ServerCallLocator(SERVER_CALL_ID)) - .setRecordingStateCallbackUrl("/not/absolute/uri") - )); - } - - @Test - public void startRecordingWithFullParamsFails() { - StartRecordingOptions startRecordingOptions = new StartRecordingOptions(new ServerCallLocator(SERVER_CALL_ID)) - .setRecordingContent(RecordingContent.AUDIO_VIDEO) - .setRecordingChannel(RecordingChannel.MIXED) - .setRecordingFormat(RecordingFormat.MP4) - .setRecordingStateCallbackUrl("/not/absolute/uri") - .setChannelAffinity(new ArrayList(Arrays.asList( - new ChannelAffinity(0, new CommunicationUserIdentifier("rawId1")), - new ChannelAffinity(1, new CommunicationUserIdentifier("rawId2"))))); - - validateError(InvalidParameterException.class, callRecording.startRecordingWithResponse(startRecordingOptions)); - } - @Test public void recordingOperationsTest() { CallAutomationAsyncClient callingServerClient = CallAutomationUnitTestBase.getCallAutomationAsyncClient( diff --git a/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallRecordingUnitTests.java b/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallRecordingUnitTests.java index 6b05a3c162fda..4c22fa1fab908 100644 --- a/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallRecordingUnitTests.java +++ b/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallRecordingUnitTests.java @@ -4,22 +4,14 @@ package com.azure.communication.callingserver; import com.azure.communication.callingserver.models.CallingServerErrorException; -import com.azure.communication.callingserver.models.ChannelAffinity; -import com.azure.communication.callingserver.models.RecordingChannel; -import com.azure.communication.callingserver.models.RecordingContent; -import com.azure.communication.callingserver.models.RecordingFormat; import com.azure.communication.callingserver.models.RecordingState; import com.azure.communication.callingserver.models.RecordingStateResult; import com.azure.communication.callingserver.models.ServerCallLocator; import com.azure.communication.callingserver.models.StartRecordingOptions; -import com.azure.communication.common.CommunicationUserIdentifier; -import com.azure.core.util.Context; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import java.security.InvalidParameterException; import java.util.ArrayList; -import java.util.Arrays; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; @@ -32,31 +24,6 @@ public void setup() { CallAutomationClient callAutomationClient = CallAutomationUnitTestBase.getCallAutomationClient(new ArrayList<>()); callRecording = callAutomationClient.getCallRecording(); } - @Test - public void startRecordingRelativeUriFails() { - assertThrows( - InvalidParameterException.class, - () -> callRecording.startRecording(new StartRecordingOptions(new ServerCallLocator(SERVER_CALL_ID)) - .setRecordingStateCallbackUrl("/not/absolute/uri") - )); - } - - @Test - public void startRecordingWithFullParamsFails() { - StartRecordingOptions startRecordingOptions = new StartRecordingOptions(new ServerCallLocator(SERVER_CALL_ID)) - .setRecordingContent(RecordingContent.AUDIO_VIDEO) - .setRecordingChannel(RecordingChannel.MIXED) - .setRecordingFormat(RecordingFormat.MP4) - .setRecordingStateCallbackUrl("/not/absolute/uri") - .setChannelAffinity(new ArrayList(Arrays.asList( - new ChannelAffinity(0, new CommunicationUserIdentifier("rawId1")), - new ChannelAffinity(1, new CommunicationUserIdentifier("rawId2"))))); - - assertThrows( - InvalidParameterException.class, - () -> callRecording.startRecordingWithResponse(startRecordingOptions, Context.NONE) - ); - } @Test public void recordingOperationsTest() {