Skip to content

Commit f881d78

Browse files
committed
test(assistant-v2): update IT
1 parent d98b915 commit f881d78

File tree

1 file changed

+38
-1
lines changed

1 file changed

+38
-1
lines changed

assistant/src/test/java/com/ibm/watson/assistant/v2/AssistantServiceIT.java

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* (C) Copyright IBM Corp. 2019, 2020.
2+
* (C) Copyright IBM Corp. 2019, 2021.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at
@@ -192,6 +192,43 @@ public void testBulkClassify() {
192192
assertNotNull(response);
193193
}
194194

195+
/** Test RuntimeResponseGenericRuntimeResponseTypeChannelTransfer. */
196+
@Test
197+
public void testRuntimeResponseGenericRuntimeResponseTypeChannelTransfer() {
198+
199+
// get session ID
200+
CreateSessionOptions createSessionOptions =
201+
new CreateSessionOptions.Builder().assistantId(assistantId).build();
202+
SessionResponse sessionResponse =
203+
service.createSession(createSessionOptions).execute().getResult();
204+
String sessionId = sessionResponse.getSessionId();
205+
206+
final List<String> messages = Arrays.asList("test sdk");
207+
MessageContext context = new MessageContext.Builder().build();
208+
209+
MessageInputOptions inputOptions = new MessageInputOptions.Builder().debug(true).build();
210+
MessageInput input =
211+
new MessageInput.Builder()
212+
.text("test sdk")
213+
.messageType(MessageInput.MessageType.TEXT)
214+
.options(inputOptions)
215+
.build();
216+
MessageOptions messageOptions =
217+
new MessageOptions.Builder()
218+
.assistantId(assistantId)
219+
.sessionId(sessionId)
220+
.input(input)
221+
.context(context)
222+
.build();
223+
MessageResponse response = service.message(messageOptions).execute().getResult();
224+
225+
RuntimeResponseGenericRuntimeResponseTypeChannelTransfer
226+
runtimeResponseGenericRuntimeResponseTypeChannelTransfer =
227+
(RuntimeResponseGenericRuntimeResponseTypeChannelTransfer)
228+
response.getOutput().getGeneric().get(0);
229+
230+
assertNotNull(null);
231+
}
195232
/** Test Delete User Data. */
196233
/*
197234
@Test

0 commit comments

Comments
 (0)