|
54 | 54 | import com.ibm.watson.developer_cloud.conversation.v1.model.ListWorkspacesOptions; |
55 | 55 | import com.ibm.watson.developer_cloud.conversation.v1.model.LogCollection; |
56 | 56 | import com.ibm.watson.developer_cloud.conversation.v1.model.LogExport; |
| 57 | +import com.ibm.watson.developer_cloud.conversation.v1.model.Mentions; |
57 | 58 | import com.ibm.watson.developer_cloud.conversation.v1.model.MessageOptions; |
58 | 59 | import com.ibm.watson.developer_cloud.conversation.v1.model.MessageResponse; |
59 | 60 | import com.ibm.watson.developer_cloud.conversation.v1.model.OutputData; |
|
82 | 83 | import java.text.DateFormat; |
83 | 84 | import java.text.SimpleDateFormat; |
84 | 85 | import java.util.ArrayList; |
| 86 | +import java.util.Arrays; |
85 | 87 | import java.util.Date; |
86 | 88 | import java.util.HashMap; |
87 | 89 | import java.util.List; |
@@ -521,14 +523,21 @@ public void testCreateExample() { |
521 | 523 | createExampleIntent(); |
522 | 524 |
|
523 | 525 | String exampleText = "Howdy " + UUID.randomUUID().toString(); // gotta be unique |
| 526 | + Mentions mentions = new Mentions(); |
| 527 | + mentions.setEntity("entity"); |
| 528 | + mentions.setLocation(Arrays.asList(0L, 10L)); |
| 529 | + List<Mentions> mentionsList = new ArrayList<>(); |
| 530 | + mentionsList.add(mentions); |
524 | 531 | CreateExampleOptions createOptions = new CreateExampleOptions.Builder(workspaceId, exampleIntent, exampleText) |
| 532 | + .mentions(mentionsList) |
525 | 533 | .build(); |
526 | 534 | Example response = service.createExample(createOptions).execute(); |
527 | 535 |
|
528 | 536 | try { |
529 | 537 | assertNotNull(response); |
530 | 538 | assertNotNull(response.getExampleText()); |
531 | 539 | assertEquals(response.getExampleText(), exampleText); |
| 540 | + assertEquals(response.getMentions(), mentionsList); |
532 | 541 | } catch (Exception ex) { |
533 | 542 | fail(ex.getMessage()); |
534 | 543 | } finally { |
@@ -743,13 +752,20 @@ public void testUpdateExample() { |
743 | 752 | service.createExample(createOptions).execute(); |
744 | 753 |
|
745 | 754 | try { |
| 755 | + Mentions mentions = new Mentions(); |
| 756 | + mentions.setEntity("entity"); |
| 757 | + mentions.setLocation(Arrays.asList(0L, 10L)); |
| 758 | + List<Mentions> mentionsList = new ArrayList<>(); |
| 759 | + mentionsList.add(mentions); |
746 | 760 | UpdateExampleOptions updateOptions = new UpdateExampleOptions.Builder(workspaceId, exampleIntent, exampleText) |
747 | 761 | .newText(exampleText2) |
| 762 | + .newMentions(mentionsList) |
748 | 763 | .build(); |
749 | 764 | Example response = service.updateExample(updateOptions).execute(); |
750 | 765 | assertNotNull(response); |
751 | 766 | assertNotNull(response.getExampleText()); |
752 | 767 | assertEquals(response.getExampleText(), exampleText2); |
| 768 | + assertEquals(response.getMentions(), mentionsList); |
753 | 769 | } catch (Exception ex) { |
754 | 770 | fail(ex.getMessage()); |
755 | 771 | } finally { |
|
0 commit comments