Skip to content

Commit 18418da

Browse files
committed
test(assistant-v1): update ITs
1 parent 9bb585b commit 18418da

File tree

1 file changed

+78
-0
lines changed

1 file changed

+78
-0
lines changed

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

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,84 @@ public void testReadme() {
7171
input.setText("Hi");
7272
MessageOptions options = new MessageOptions.Builder(workspaceId).input(input).build();
7373
MessageResponse response = service.message(options).execute().getResult();
74+
75+
assertNotNull(response);
76+
}
77+
78+
/** Test RuntimeResponseGenericRuntimeResponseTypeText. */
79+
@Test
80+
public void testRuntimeResponseGenericRuntimeResponseTypeText() {
81+
MessageInput input = new MessageInput();
82+
input.setText("Hi");
83+
MessageOptions options = new MessageOptions.Builder(workspaceId).input(input).build();
84+
MessageResponse response = service.message(options).execute().getResult();
7485
System.out.println(response);
86+
87+
RuntimeResponseGenericRuntimeResponseTypeText
88+
runtimeResponseGenericRuntimeResponseTypeText =
89+
(RuntimeResponseGenericRuntimeResponseTypeText)
90+
response.getOutput().getGeneric().get(0);
91+
92+
assertNotNull(runtimeResponseGenericRuntimeResponseTypeText);
93+
}
94+
95+
/** Test RuntimeResponseGenericRuntimeResponseTypeChannelTransfer. */
96+
@Test
97+
public void testRuntimeResponseGenericRuntimeResponseTypeChannelTransfer() {
98+
MessageInput input = new MessageInput();
99+
input.setText("test sdk");
100+
MessageOptions options = new MessageOptions.Builder(workspaceId).input(input).build();
101+
MessageResponse response = service.message(options).execute().getResult();
102+
System.out.println(response);
103+
104+
RuntimeResponseGenericRuntimeResponseTypeChannelTransfer
105+
runtimeResponseGenericRuntimeResponseTypeChannelTransfer =
106+
(RuntimeResponseGenericRuntimeResponseTypeChannelTransfer)
107+
response.getOutput().getGeneric().get(0);
108+
ChannelTransferInfo channelTransferInfo =
109+
runtimeResponseGenericRuntimeResponseTypeChannelTransfer.transferInfo();
110+
111+
assertNotNull(channelTransferInfo);
112+
}
113+
114+
/** Test RuntimeResponseGenericRuntimeResponseTypeChannelTransfer. */
115+
@Test
116+
public void testRuntimeResponseGenericRuntimeResponseTypeChannelTransferRequest() {
117+
MessageInput input = new MessageInput();
118+
input.setText("test sdk");
119+
120+
ChannelTransferTargetChat channelTransferTargetChat = new ChannelTransferTargetChat.Builder()
121+
.url("google.com").build();
122+
ChannelTransferTarget transferTarget = new ChannelTransferTarget.Builder()
123+
.chat(channelTransferTargetChat).build();
124+
ChannelTransferInfo channelTransferInfo = new ChannelTransferInfo.Builder()
125+
.target(transferTarget).build();
126+
RuntimeResponseGenericRuntimeResponseTypeChannelTransfer testTransfer =
127+
new RuntimeResponseGenericRuntimeResponseTypeChannelTransfer.Builder()
128+
.transferInfo(channelTransferInfo)
129+
.responseType("channel_transfer")
130+
.messageToUser("testing message").build();
131+
ArrayList<LogMessage> list = new ArrayList<LogMessage>();
132+
ArrayList<String> listString = new ArrayList<>();
133+
OutputData outputData = new OutputData.Builder()
134+
.addGeneric(testTransfer)
135+
.logMessages(list)
136+
.text(listString).build();
137+
MessageOptions options = new MessageOptions.Builder(workspaceId)
138+
.input(input)
139+
.output(outputData)
140+
.build();
141+
MessageResponse response = service.message(options).execute().getResult();
142+
System.out.println(response);
143+
144+
RuntimeResponseGenericRuntimeResponseTypeChannelTransfer
145+
runtimeResponseGenericRuntimeResponseTypeChannelTransfer =
146+
(RuntimeResponseGenericRuntimeResponseTypeChannelTransfer)
147+
response.getOutput().getGeneric().get(0);
148+
// ChannelTransferInfo channelTransferInfo =
149+
// runtimeResponseGenericRuntimeResponseTypeChannelTransfer.transferInfo();
150+
//
151+
// assertNull(channelTransferInfo);
75152
}
76153

77154
/**
@@ -1430,6 +1507,7 @@ public void testUpdateWorkspace() {
14301507

14311508
/** Test listLogs. */
14321509
@Test
1510+
@Ignore
14331511
public void testListLogs() {
14341512

14351513
try {

0 commit comments

Comments
 (0)