diff --git a/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallAsyncClientTests.java b/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallAsyncClientTests.java index 1187ae0e5edcf..e769f6899a0be 100644 --- a/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallAsyncClientTests.java +++ b/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallAsyncClientTests.java @@ -9,6 +9,7 @@ import com.azure.communication.callingserver.models.CreateCallOptions; import com.azure.communication.callingserver.models.CreateCallResult; import com.azure.communication.callingserver.models.EventSubscriptionType; +import com.azure.communication.callingserver.models.InviteParticipantsRequest; import com.azure.communication.callingserver.models.PlayAudioResult; import com.azure.communication.common.CommunicationIdentifier; import com.azure.communication.common.CommunicationUserIdentifier; @@ -27,9 +28,10 @@ public class CallAsyncClientTests extends CallingServerTestBase { private String from = "8:acs:016a7064-0581-40b9-be73-6dde64d69d72_0000000a-6198-4a66-02c3-593a0d00560d"; private String alternateId = "+18445764430"; - private String to = "+15125189815"; + private String to = "+15125189815"; private String callBackUri = "https://host.app/api/callback/calling"; - private String audioFileUri = "https://acstestapp1.azurewebsites.net/audio/bot-callcenter-intro.wav"; + private String audioFileUri = "https://host.app/audio/bot-callcenter-intro.wav"; + private String invitedUser = "8:acs:016a7064-0581-40b9-be73-6dde64d69d72_0000000a-6d91-5555-b5bb-a43a0d00068c";; @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") @@ -114,7 +116,95 @@ public void runCreatePlayAudioHangupScenarioWithResponseAsync(HttpClient httpCli System.out.println("Error: " + e.getMessage()); throw e; } - } + } + + @ParameterizedTest + @MethodSource("com.azure.core.test.TestBase#getHttpClients") + public void inviteUserRemoveParticipantScenarioAsync(HttpClient httpClient) throws URISyntaxException, InterruptedException { + var builder = getCallClientUsingConnectionString(httpClient); + var callAsyncClient = setupAsyncClient(builder, "inviteUserRemoveParticipantScenarioAsync"); + + try { + // Establish a call + CreateCallOptions options = new CreateCallOptions( + callBackUri, + new LinkedList(Arrays.asList(CallModality.AUDIO)), + new LinkedList(Arrays.asList(EventSubscriptionType.PARTICIPANTS_UPDATED))); + + options.setAlternateCallerId(new PhoneNumberIdentifier(alternateId)); + + CreateCallResult createCallResult = callAsyncClient.createCall( + new CommunicationUserIdentifier(from), + new LinkedList(Arrays.asList(new PhoneNumberIdentifier(to))), + options).block(); + + CallingServerTestUtils.ValidateCreateCallResult(createCallResult); + var callId = createCallResult.getCallLegId(); + + // Invite User + var operationContext = "ac794123-3820-4979-8e2d-50c7d3e07b12"; + InviteParticipantsRequest inviteParticipantsRequest = new InviteParticipantsRequest(); + inviteParticipantsRequest.setParticipants(new LinkedList(Arrays.asList(new CommunicationUserIdentifier(invitedUser)))); + inviteParticipantsRequest.setOperationContext(operationContext); + callAsyncClient.inviteParticipants(callId, inviteParticipantsRequest).block(); + + // Remove Participant + var participantId = "845156dc-15ad-4dec-883c-ee2e27cdb99e"; + callAsyncClient.removeParticipant(callId, participantId).block(); + + // Hang up + callAsyncClient.hangupCall(callId).block(); + } catch (Exception e) { + System.out.println("Error: " + e.getMessage()); + throw e; + } + } + + @ParameterizedTest + @MethodSource("com.azure.core.test.TestBase#getHttpClients") + public void inviteUserRemoveParticipantScenarioWithResponseAsync(HttpClient httpClient) throws URISyntaxException, InterruptedException { + var builder = getCallClientUsingConnectionString(httpClient); + var callAsyncClient = setupAsyncClient(builder, "inviteUserRemoveParticipantScenarioWithResponseAsync"); + + try { + // Establish a call + CreateCallOptions options = new CreateCallOptions( + callBackUri, + new LinkedList(Arrays.asList(CallModality.AUDIO)), + new LinkedList(Arrays.asList(EventSubscriptionType.PARTICIPANTS_UPDATED))); + + options.setAlternateCallerId(new PhoneNumberIdentifier(alternateId)); + + Response createCallResponse = callAsyncClient.createCallWithResponse( + new CommunicationUserIdentifier(from), + new LinkedList(Arrays.asList(new PhoneNumberIdentifier(to))), + options, + Context.NONE).block(); + + CallingServerTestUtils.ValidateCreateCallResponse(createCallResponse); + var callId = createCallResponse.getValue().getCallLegId(); + + // Invite User + var operationContext = "ac794123-3820-4979-8e2d-50c7d3e07b12"; + InviteParticipantsRequest inviteParticipantsRequest = new InviteParticipantsRequest(); + inviteParticipantsRequest.setParticipants(new LinkedList(Arrays.asList(new CommunicationUserIdentifier(invitedUser)))); + inviteParticipantsRequest.setOperationContext(operationContext); + Response inviteParticipantResponse = callAsyncClient.inviteParticipantsWithResponse(callId, inviteParticipantsRequest, Context.NONE).block(); + CallingServerTestUtils.ValidateInviteParticipantResponse(inviteParticipantResponse); + + // Remove Participant + var participantId = "8465d43d-3cf2-4e7f-96f6-e9824348c894"; + Response removeParticipantResponse = callAsyncClient.removeParticipantWithResponse(callId, participantId, Context.NONE).block(); + CallingServerTestUtils.ValidateRemoveParticipantResponse(removeParticipantResponse); + + // Hang up + Response hangupResponse = callAsyncClient.hangupCallWithResponse(callId, Context.NONE).block(); + CallingServerTestUtils.ValidateHangupResponse(hangupResponse); + } catch (Exception e) { + System.out.println("Error: " + e.getMessage()); + throw e; + } + } private CallAsyncClient setupAsyncClient(CallClientBuilder builder, String testName) { return addLoggingPolicy(builder, testName).buildAsyncClient(); diff --git a/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallClientTests.java b/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallClientTests.java index a6da182bb2033..70ffa012a46b8 100644 --- a/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallClientTests.java +++ b/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallClientTests.java @@ -9,6 +9,7 @@ import com.azure.communication.callingserver.models.CreateCallOptions; import com.azure.communication.callingserver.models.CreateCallResult; import com.azure.communication.callingserver.models.EventSubscriptionType; +import com.azure.communication.callingserver.models.InviteParticipantsRequest; import com.azure.communication.callingserver.models.PlayAudioResult; import com.azure.communication.common.CommunicationIdentifier; import com.azure.communication.common.CommunicationUserIdentifier; @@ -29,7 +30,8 @@ public class CallClientTests extends CallingServerTestBase { private String alternateId = "+18445764430"; private String to = "+15125189815"; private String callBackUri = "https://host.app/api/callback/calling"; - private String audioFileUri = "https://acstestapp1.azurewebsites.net/audio/bot-callcenter-intro.wav"; + private String audioFileUri = "https://host.app/audio/bot-callcenter-intro.wav"; + private String invitedUser = "8:acs:016a7064-0581-40b9-be73-6dde64d69d72_0000000a-6d91-5555-b5bb-a43a0d00068c"; @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") @@ -114,7 +116,95 @@ public void runCreatePlayAudioHangupScenarioWithResponse(HttpClient httpClient) System.out.println("Error: " + e.getMessage()); throw e; } - } + } + + @ParameterizedTest + @MethodSource("com.azure.core.test.TestBase#getHttpClients") + public void inviteUserRemoveParticipantScenario(HttpClient httpClient) throws URISyntaxException, InterruptedException { + var builder = getCallClientUsingConnectionString(httpClient); + var callClient = setupClient(builder, "inviteUserRemoveParticipantScenario"); + + try { + // Establish a call + CreateCallOptions options = new CreateCallOptions( + callBackUri, + new LinkedList(Arrays.asList(CallModality.AUDIO)), + new LinkedList(Arrays.asList(EventSubscriptionType.PARTICIPANTS_UPDATED))); + + options.setAlternateCallerId(new PhoneNumberIdentifier(alternateId)); + + CreateCallResult createCallResult = callClient.createCall( + new CommunicationUserIdentifier(from), + new LinkedList(Arrays.asList(new PhoneNumberIdentifier(to))), + options); + + CallingServerTestUtils.ValidateCreateCallResult(createCallResult); + var callId = createCallResult.getCallLegId(); + + // Invite User + var operationContext = "ac794123-3820-4979-8e2d-50c7d3e07b12"; + InviteParticipantsRequest inviteParticipantsRequest = new InviteParticipantsRequest(); + inviteParticipantsRequest.setParticipants(new LinkedList(Arrays.asList(new CommunicationUserIdentifier(invitedUser)))); + inviteParticipantsRequest.setOperationContext(operationContext); + callClient.inviteParticipants(callId, inviteParticipantsRequest); + + // Remove Participant + var participantId = "39659b2c-53a8-40a3-93d5-5da018967401"; + callClient.removeParticipant(callId, participantId); + + // Hang up + callClient.hangupCall(callId); + } catch (Exception e) { + System.out.println("Error: " + e.getMessage()); + throw e; + } + } + + @ParameterizedTest + @MethodSource("com.azure.core.test.TestBase#getHttpClients") + public void inviteUserRemoveParticipantScenarioWithResponse(HttpClient httpClient) throws URISyntaxException, InterruptedException { + var builder = getCallClientUsingConnectionString(httpClient); + var callClient = setupClient(builder, "inviteUserRemoveParticipantScenarioWithResponse"); + + try { + // Establish a call + CreateCallOptions options = new CreateCallOptions( + callBackUri, + new LinkedList(Arrays.asList(CallModality.AUDIO)), + new LinkedList(Arrays.asList(EventSubscriptionType.PARTICIPANTS_UPDATED))); + + options.setAlternateCallerId(new PhoneNumberIdentifier(alternateId)); + + Response createCallResponse = callClient.createCallWithResponse( + new CommunicationUserIdentifier(from), + new LinkedList(Arrays.asList(new PhoneNumberIdentifier(to))), + options, + Context.NONE); + + CallingServerTestUtils.ValidateCreateCallResponse(createCallResponse); + var callId = createCallResponse.getValue().getCallLegId(); + + // Invite User + var operationContext = "ac794123-3820-4979-8e2d-50c7d3e07b12"; + InviteParticipantsRequest inviteParticipantsRequest = new InviteParticipantsRequest(); + inviteParticipantsRequest.setParticipants(new LinkedList(Arrays.asList(new CommunicationUserIdentifier(invitedUser)))); + inviteParticipantsRequest.setOperationContext(operationContext); + Response inviteParticipantResponse = callClient.inviteParticipantsWithResponse(callId, inviteParticipantsRequest, Context.NONE); + CallingServerTestUtils.ValidateInviteParticipantResponse(inviteParticipantResponse); + + // Remove Participant + var participantId = "d702fa95-a3ee-4e2d-8101-8e100e7aaf8a"; + Response removeParticipantResponse = callClient.removeParticipantWithResponse(callId, participantId, Context.NONE); + CallingServerTestUtils.ValidateRemoveParticipantResponse(removeParticipantResponse); + + // Hang up + Response hangupResponse = callClient.hangupCallWithResponse(callId, Context.NONE); + CallingServerTestUtils.ValidateHangupResponse(hangupResponse); + } catch (Exception e) { + System.out.println("Error: " + e.getMessage()); + throw e; + } + } private CallClient setupClient(CallClientBuilder builder, String testName) { return addLoggingPolicy(builder, testName).buildClient(); diff --git a/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallingServerTestUtils.java b/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallingServerTestUtils.java index 46e28bc7663eb..b367c3913aa2e 100644 --- a/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallingServerTestUtils.java +++ b/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallingServerTestUtils.java @@ -49,4 +49,16 @@ protected static void ValidateHangupResponse(Response hangupResponse) assertNotNull(hangupResponse); assertTrue(hangupResponse.getStatusCode() == 202); } + + protected static void ValidateInviteParticipantResponse(Response inviteParticipantResponse) + { + assertNotNull(inviteParticipantResponse); + assertTrue(inviteParticipantResponse.getStatusCode() == 202); + } + + protected static void ValidateRemoveParticipantResponse(Response removeParticipantResponse) + { + assertNotNull(removeParticipantResponse); + assertTrue(removeParticipantResponse.getStatusCode() == 202); + } } diff --git a/sdk/communication/azure-communication-callingserver/src/test/resources/session-records/CallAsyncClientTests.inviteUserRemoveParticipantScenarioAsync[1].json b/sdk/communication/azure-communication-callingserver/src/test/resources/session-records/CallAsyncClientTests.inviteUserRemoveParticipantScenarioAsync[1].json new file mode 100644 index 0000000000000..9384ec9dda86e --- /dev/null +++ b/sdk/communication/azure-communication-callingserver/src/test/resources/session-records/CallAsyncClientTests.inviteUserRemoveParticipantScenarioAsync[1].json @@ -0,0 +1,76 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/calling/calls?api-version=2021-04-15-preview1", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-callingserver/1.0.0-beta.1 (16.0.1; Windows 10; 10.0)", + "Content-Type" : "application/json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "content-length" : "52", + "retry-after" : "0", + "X-Azure-Ref" : "0oce3YAAAAABEMFt9C2aER4e2teZ85i2MQ0hHRURHRTE2MTIAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "StatusCode" : "201", + "X-Microsoft-Skype-Chain-ID" : "bd3eb36e-6a3a-402c-bee2-f2b4af0562dd", + "Body" : "{\"callLegId\":\"b21f6a00-445f-4a23-8053-4c515c16d75f\"}", + "Date" : "Wed, 02 Jun 2021 18:02:09 GMT", + "Content-Type" : "application/json; charset=utf-8", + "Client-Request-Id" : "36e9d9a6-0746-4af8-ad34-70358b635adb" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/calling/calls/b21f6a00-445f-4a23-8053-4c515c16d75f/participants?api-version=2021-04-15-preview1", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-callingserver/1.0.0-beta.1 (16.0.1; Windows 10; 10.0)", + "Content-Type" : "application/json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "content-length" : "0", + "retry-after" : "0", + "X-Azure-Ref" : "0rse3YAAAAAAqsNRcd4WsSrw8rhzeEScDQ0hHRURHRTE2MTIAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "StatusCode" : "202", + "X-Microsoft-Skype-Chain-ID" : "38b0581e-10ef-467f-ad7a-364e76bee477", + "Date" : "Wed, 02 Jun 2021 18:02:22 GMT", + "Client-Request-Id" : "b59edbe3-bf5e-4de7-97f5-fc486fa3b350" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.communication.azure.com/calling/calls/b21f6a00-445f-4a23-8053-4c515c16d75f/participants/845156dc-15ad-4dec-883c-ee2e27cdb99e?api-version=2021-04-15-preview1", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-callingserver/1.0.0-beta.1 (16.0.1; Windows 10; 10.0)" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "content-length" : "0", + "retry-after" : "0", + "X-Azure-Ref" : "00se3YAAAAAD6nVAM2InIQITLaA0PKmKmQ0hHRURHRTE2MTIAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "StatusCode" : "202", + "X-Microsoft-Skype-Chain-ID" : "e62f5d57-2add-405c-8b56-79e8af31e221", + "Date" : "Wed, 02 Jun 2021 18:02:58 GMT", + "Client-Request-Id" : "73dd593d-ba48-4793-8809-1e753a4b67d3" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/calling/calls/b21f6a00-445f-4a23-8053-4c515c16d75f/Hangup?api-version=2021-04-15-preview1", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-callingserver/1.0.0-beta.1 (16.0.1; Windows 10; 10.0)" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "content-length" : "0", + "retry-after" : "0", + "X-Azure-Ref" : "038e3YAAAAAB8rc6neSGjRbr5zrr6QK41Q0hHRURHRTE2MTIAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "StatusCode" : "202", + "X-Microsoft-Skype-Chain-ID" : "dca66ff8-1e41-4cef-a5f9-5a9dbd6d4481", + "Date" : "Wed, 02 Jun 2021 18:03:11 GMT", + "Client-Request-Id" : "aff6cbbd-492f-4bdc-b3ba-357d28ac7dfa" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-callingserver/src/test/resources/session-records/CallAsyncClientTests.inviteUserRemoveParticipantScenarioWithResponseAsync[1].json b/sdk/communication/azure-communication-callingserver/src/test/resources/session-records/CallAsyncClientTests.inviteUserRemoveParticipantScenarioWithResponseAsync[1].json new file mode 100644 index 0000000000000..03a0d8d5b7fd3 --- /dev/null +++ b/sdk/communication/azure-communication-callingserver/src/test/resources/session-records/CallAsyncClientTests.inviteUserRemoveParticipantScenarioWithResponseAsync[1].json @@ -0,0 +1,76 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/calling/calls?api-version=2021-04-15-preview1", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-callingserver/1.0.0-beta.1 (16.0.1; Windows 10; 10.0)", + "Content-Type" : "application/json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "content-length" : "52", + "retry-after" : "0", + "X-Azure-Ref" : "03si3YAAAAAB/xPCKmSJ5TIw3jCDEpWPVREZXMzBFREdFMDkxNQA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "201", + "X-Microsoft-Skype-Chain-ID" : "ddce7a5a-b257-4ef1-a095-f1aa59e9565a", + "Body" : "{\"callLegId\":\"7f1f6900-63e7-42ee-811d-d5bf1bc18401\"}", + "Date" : "Wed, 02 Jun 2021 18:07:26 GMT", + "Content-Type" : "application/json; charset=utf-8", + "Client-Request-Id" : "9e07f2d4-77e2-44ba-bc3e-3d1dd65ae6bb" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/calling/calls/7f1f6900-63e7-42ee-811d-d5bf1bc18401/participants?api-version=2021-04-15-preview1", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-callingserver/1.0.0-beta.1 (16.0.1; Windows 10; 10.0)", + "Content-Type" : "application/json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "content-length" : "0", + "retry-after" : "0", + "X-Azure-Ref" : "078i3YAAAAADbeKmMAcmPRrROSFDPyvoQREZXMzBFREdFMDkxNQA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "202", + "X-Microsoft-Skype-Chain-ID" : "4d38a9fc-0666-4bb0-986e-7afd10c12b17", + "Date" : "Wed, 02 Jun 2021 18:07:43 GMT", + "Client-Request-Id" : "1e814e2f-c3ac-4910-bccc-334d66270dbc" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.communication.azure.com/calling/calls/7f1f6900-63e7-42ee-811d-d5bf1bc18401/participants/8465d43d-3cf2-4e7f-96f6-e9824348c894?api-version=2021-04-15-preview1", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-callingserver/1.0.0-beta.1 (16.0.1; Windows 10; 10.0)" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "content-length" : "0", + "retry-after" : "0", + "X-Azure-Ref" : "0Dcm3YAAAAAB9rZIli8QTQrXvDqduoiqhREZXMzBFREdFMDkxNQA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "202", + "X-Microsoft-Skype-Chain-ID" : "7c25aa00-68ef-48c1-9389-d954bf141bfd", + "Date" : "Wed, 02 Jun 2021 18:08:12 GMT", + "Client-Request-Id" : "6320227b-ed42-4c48-954e-e2301839f36a" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/calling/calls/7f1f6900-63e7-42ee-811d-d5bf1bc18401/Hangup?api-version=2021-04-15-preview1", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-callingserver/1.0.0-beta.1 (16.0.1; Windows 10; 10.0)" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "content-length" : "0", + "retry-after" : "0", + "X-Azure-Ref" : "0Fsm3YAAAAABh/SboP8nsSqTu9P21KpzhREZXMzBFREdFMDkxNQA5ZmM3YjUxOS1hOGNjLTRmODktOTM1ZS1jOTE0OGFlMDllODE=", + "StatusCode" : "202", + "X-Microsoft-Skype-Chain-ID" : "3678d0cd-d647-409c-badb-383b868f58b9", + "Date" : "Wed, 02 Jun 2021 18:08:22 GMT", + "Client-Request-Id" : "04bbd2d2-beb9-4e70-aff1-683ce8b4628e" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-callingserver/src/test/resources/session-records/CallClientTests.inviteUserRemoveParticipantScenarioWithResponse[1].json b/sdk/communication/azure-communication-callingserver/src/test/resources/session-records/CallClientTests.inviteUserRemoveParticipantScenarioWithResponse[1].json new file mode 100644 index 0000000000000..eeb555d82af93 --- /dev/null +++ b/sdk/communication/azure-communication-callingserver/src/test/resources/session-records/CallClientTests.inviteUserRemoveParticipantScenarioWithResponse[1].json @@ -0,0 +1,76 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/calling/calls?api-version=2021-04-15-preview1", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-callingserver/1.0.0-beta.1 (16.0.1; Windows 10; 10.0)", + "Content-Type" : "application/json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "content-length" : "52", + "retry-after" : "0", + "X-Azure-Ref" : "058W3YAAAAACcEYPtAO8fRoeXDTbIlc0WQ0hHRURHRTE2MTYAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "StatusCode" : "201", + "X-Microsoft-Skype-Chain-ID" : "57047a4a-e6d1-4d2b-9275-75f2eabb697c", + "Body" : "{\"callLegId\":\"591f6a00-fcbd-423b-91c5-44a4312679ff\"}", + "Date" : "Wed, 02 Jun 2021 17:54:47 GMT", + "Content-Type" : "application/json; charset=utf-8", + "Client-Request-Id" : "2ff329d2-0369-4e14-b41f-43f3b6c8f80a" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/calling/calls/591f6a00-fcbd-423b-91c5-44a4312679ff/participants?api-version=2021-04-15-preview1", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-callingserver/1.0.0-beta.1 (16.0.1; Windows 10; 10.0)", + "Content-Type" : "application/json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "content-length" : "0", + "retry-after" : "0", + "X-Azure-Ref" : "0+MW3YAAAAABc6E/GZFQSRoRkLpMHupZYQ0hHRURHRTE2MTYAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "StatusCode" : "202", + "X-Microsoft-Skype-Chain-ID" : "d5a5f880-4518-4f24-b2b9-104d96f8ef48", + "Date" : "Wed, 02 Jun 2021 17:55:04 GMT", + "Client-Request-Id" : "8e973608-633d-4095-8ca6-ca6a4d09688e" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.communication.azure.com/calling/calls/591f6a00-fcbd-423b-91c5-44a4312679ff/participants/d702fa95-a3ee-4e2d-8101-8e100e7aaf8a?api-version=2021-04-15-preview1", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-callingserver/1.0.0-beta.1 (16.0.1; Windows 10; 10.0)" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "content-length" : "0", + "retry-after" : "0", + "X-Azure-Ref" : "0H8a3YAAAAAC/CM6NnfXWSKfVRCk8MBe9Q0hHRURHRTE2MTYAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "StatusCode" : "202", + "X-Microsoft-Skype-Chain-ID" : "7972475f-3f3f-4f62-9a95-bed4c25d1053", + "Date" : "Wed, 02 Jun 2021 17:55:43 GMT", + "Client-Request-Id" : "3e8c2851-7394-49da-89db-fdb3c8134e06" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/calling/calls/591f6a00-fcbd-423b-91c5-44a4312679ff/Hangup?api-version=2021-04-15-preview1", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-callingserver/1.0.0-beta.1 (16.0.1; Windows 10; 10.0)" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "content-length" : "0", + "retry-after" : "0", + "X-Azure-Ref" : "0Ksa3YAAAAAA8TgVVliVaS7AUD/GoOGX5Q0hHRURHRTE2MTYAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "StatusCode" : "202", + "X-Microsoft-Skype-Chain-ID" : "37ef53cf-0f25-4da6-9787-52c893f594e9", + "Date" : "Wed, 02 Jun 2021 17:55:54 GMT", + "Client-Request-Id" : "a030a1fa-c2d0-43f0-b1b1-0ddf159360d6" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/communication/azure-communication-callingserver/src/test/resources/session-records/CallClientTests.inviteUserRemoveParticipantScenario[1].json b/sdk/communication/azure-communication-callingserver/src/test/resources/session-records/CallClientTests.inviteUserRemoveParticipantScenario[1].json new file mode 100644 index 0000000000000..d204a3b50e8f0 --- /dev/null +++ b/sdk/communication/azure-communication-callingserver/src/test/resources/session-records/CallClientTests.inviteUserRemoveParticipantScenario[1].json @@ -0,0 +1,76 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/calling/calls?api-version=2021-04-15-preview1", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-callingserver/1.0.0-beta.1 (16.0.1; Windows 10; 10.0)", + "Content-Type" : "application/json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "content-length" : "52", + "retry-after" : "0", + "X-Azure-Ref" : "0f8C3YAAAAACm3jOcX5TZQIhDwJ/0lO6SQ0hHRURHRTE2MTQAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "StatusCode" : "201", + "X-Microsoft-Skype-Chain-ID" : "04fa177c-2e37-4b06-9596-95027606f9df", + "Body" : "{\"callLegId\":\"03000380-46d8-4cae-8c69-0c0ca4ebc05d\"}", + "Date" : "Wed, 02 Jun 2021 17:31:44 GMT", + "Content-Type" : "application/json; charset=utf-8", + "Client-Request-Id" : "deb67eb4-feca-4da4-9d65-aedfe09ec4ad" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/calling/calls/03000380-46d8-4cae-8c69-0c0ca4ebc05d/participants?api-version=2021-04-15-preview1", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-callingserver/1.0.0-beta.1 (16.0.1; Windows 10; 10.0)", + "Content-Type" : "application/json" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "content-length" : "0", + "retry-after" : "0", + "X-Azure-Ref" : "0lcC3YAAAAACnSx/6Qo3rSpXQIMj/XVv5Q0hHRURHRTE2MTQAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "StatusCode" : "202", + "X-Microsoft-Skype-Chain-ID" : "0a946c4d-2ccb-472e-ba36-3936c00c705f", + "Date" : "Wed, 02 Jun 2021 17:32:05 GMT", + "Client-Request-Id" : "a17ffefc-8c5f-4e55-af40-d5a80dae6fa4" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.communication.azure.com/calling/calls/03000380-46d8-4cae-8c69-0c0ca4ebc05d/participants/39659b2c-53a8-40a3-93d5-5da018967401?api-version=2021-04-15-preview1", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-callingserver/1.0.0-beta.1 (16.0.1; Windows 10; 10.0)" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "content-length" : "0", + "retry-after" : "0", + "X-Azure-Ref" : "00MC3YAAAAACyNB5dV2hgQLKAgNbuAgZgQ0hHRURHRTE2MTQAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "StatusCode" : "202", + "X-Microsoft-Skype-Chain-ID" : "057dffae-6319-4501-9e5f-8177fdddb435", + "Date" : "Wed, 02 Jun 2021 17:33:04 GMT", + "Client-Request-Id" : "e4427685-213e-439b-9430-4b51340cb2e1" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.communication.azure.com/calling/calls/03000380-46d8-4cae-8c69-0c0ca4ebc05d/Hangup?api-version=2021-04-15-preview1", + "Headers" : { + "User-Agent" : "azsdk-java-azure-communication-callingserver/1.0.0-beta.1 (16.0.1; Windows 10; 10.0)" + }, + "Response" : { + "X-Cache" : "CONFIG_NOCACHE", + "content-length" : "0", + "retry-after" : "0", + "X-Azure-Ref" : "04cC3YAAAAAA+w3TMgozKS4olFg6wb0r2Q0hHRURHRTE2MTQAOWZjN2I1MTktYThjYy00Zjg5LTkzNWUtYzkxNDhhZTA5ZTgx", + "StatusCode" : "202", + "X-Microsoft-Skype-Chain-ID" : "95cbb524-51df-4031-a4ee-73d6d747f04d", + "Date" : "Wed, 02 Jun 2021 17:33:20 GMT", + "Client-Request-Id" : "c660d615-c4c3-4d47-80a7-6b8ec04d827a" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file