|
1 | 1 | /* |
2 | | - * (C) Copyright IBM Corp. 2019, 2020. |
| 2 | + * (C) Copyright IBM Corp. 2019, 2021. |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with |
5 | 5 | * the License. You may obtain a copy of the License at |
@@ -192,6 +192,43 @@ public void testBulkClassify() { |
192 | 192 | assertNotNull(response); |
193 | 193 | } |
194 | 194 |
|
| 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 | + } |
195 | 232 | /** Test Delete User Data. */ |
196 | 233 | /* |
197 | 234 | @Test |
|
0 commit comments