Skip to content

Commit 2620cd0

Browse files
authored
Merge pull request #683 from watson-developer-cloud/unity-sdk-9721
fix(assistant-v2): fix integration test for assistant v2
2 parents abcea52 + 076790a commit 2620cd0

File tree

2 files changed

+45
-5
lines changed

2 files changed

+45
-5
lines changed

Scripts/Services/Assistant/V2/Model/RuntimeResponseGeneric.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,6 @@ public class PreferenceValue
153153
[JsonProperty("agent_unavailable", NullValueHandling = NullValueHandling.Ignore)]
154154
public AgentAvailabilityMessage AgentUnavailable { get; protected set; }
155155
/// <summary>
156-
/// Routing or other contextual information to be used by target service desk systems.
157-
/// </summary>
158-
[JsonProperty("transfer_info", NullValueHandling = NullValueHandling.Ignore)]
159-
public DialogNodeOutputConnectToAgentTransferInfo TransferInfo { get; protected set; }
160-
/// <summary>
161156
/// A label identifying the topic of the conversation, derived from the **title** property of the relevant node
162157
/// or the **topic** property of the dialog node response.
163158
/// </summary>

Tests/AssistantV2IntegrationTests.cs

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,34 @@ public IEnumerator TestListLogs()
300300
[UnityTest, Order(2)]
301301
public IEnumerator TestRuntimeResponseGenericRuntimeResponseTypeChannelTransfer()
302302
{
303+
service = new AssistantService(versionDate);
304+
305+
while (!service.Authenticator.CanAuthenticate())
306+
yield return null;
307+
303308
assistantId = Environment.GetEnvironmentVariable("ASSISTANT_ASSISTANT_ID");
309+
310+
string sessionId = null;
311+
312+
SessionResponse createSessionResponse = null;
313+
Log.Debug("AssistantV2IntegrationTests", "Attempting to CreateSession...");
314+
service.WithHeader("X-Watson-Test", "1");
315+
service.CreateSession(
316+
callback: (DetailedResponse<SessionResponse> response, IBMError error) =>
317+
{
318+
Log.Debug("AssistantV2IntegrationTests", "result: {0}", response.Response);
319+
createSessionResponse = response.Result;
320+
sessionId = createSessionResponse.SessionId;
321+
Assert.IsNotNull(createSessionResponse);
322+
Assert.IsNotNull(response.Result.SessionId);
323+
Assert.IsNull(error);
324+
},
325+
assistantId: assistantId
326+
);
327+
328+
while (createSessionResponse == null)
329+
yield return null;
330+
304331
MessageResponseStateless messageResponse = null;
305332
string conversationId = null;
306333

@@ -331,6 +358,24 @@ public IEnumerator TestRuntimeResponseGenericRuntimeResponseTypeChannelTransfer(
331358

332359
while (messageResponse == null)
333360
yield return null;
361+
362+
object deleteSessionResponse = null;
363+
Log.Debug("AssistantV2IntegrationTests", "Attempting to DeleteSession...");
364+
service.WithHeader("X-Watson-Test", "1");
365+
service.DeleteSession(
366+
callback: (DetailedResponse<object> response, IBMError error) =>
367+
{
368+
Log.Debug("AssistantV2IntegrationTests", "result: {0}", response.Response);
369+
deleteSessionResponse = response.Result;
370+
Assert.IsNotNull(response.Result);
371+
Assert.IsNull(error);
372+
},
373+
assistantId: assistantId,
374+
sessionId: sessionId
375+
);
376+
377+
while (deleteSessionResponse == null)
378+
yield return null;
334379
}
335380

336381
[TearDown]

0 commit comments

Comments
 (0)