Search in sources :

Example 1 with DialogNodeAction

use of com.ibm.watson.developer_cloud.assistant.v1.model.DialogNodeAction in project java-sdk by watson-developer-cloud.

the class ConversationTest method testCreateDialogNodeOptionsBuilder.

/**
 * Test CreateDialogNodeOptions builder.
 */
@Test
public void testCreateDialogNodeOptionsBuilder() {
    String dialogNodeName = "aDialogNode";
    DialogNodeAction action0 = new DialogNodeAction();
    action0.setName("action0");
    action0.setCredentials("credential0");
    DialogNodeAction action1 = new DialogNodeAction();
    action1.setName("action1");
    action1.setCredentials("credential1");
    CreateDialogNodeOptions createOptions = new CreateDialogNodeOptions.Builder().workspaceId(WORKSPACE_ID).dialogNode(dialogNodeName).addActions(action0).addActions(action1).build();
    assertEquals(createOptions.workspaceId(), WORKSPACE_ID);
    assertEquals(createOptions.dialogNode(), dialogNodeName);
    assertEquals(createOptions.actions().size(), 2);
    assertEquals(createOptions.actions().get(0), action0);
    assertEquals(createOptions.actions().get(0).getCredentials(), "credential0");
    assertEquals(createOptions.actions().get(1), action1);
    assertEquals(createOptions.actions().get(1).getCredentials(), "credential1");
}
Also used : DialogNodeAction(com.ibm.watson.developer_cloud.conversation.v1.model.DialogNodeAction) CreateDialogNodeOptions(com.ibm.watson.developer_cloud.conversation.v1.model.CreateDialogNodeOptions) WatsonServiceUnitTest(com.ibm.watson.developer_cloud.WatsonServiceUnitTest) Test(org.junit.Test)

Example 2 with DialogNodeAction

use of com.ibm.watson.developer_cloud.assistant.v1.model.DialogNodeAction in project java-sdk by watson-developer-cloud.

the class AssistantTest method testUpdateDialogNodeOptionsBuilder.

/**
 * Test UpdateDialogNodeOptions builder.
 */
@Test
public void testUpdateDialogNodeOptionsBuilder() {
    String dialogNodeName = "aDialogNode";
    String newDialogNodeName = "renamedDialogNode";
    DialogNodeAction action0 = new DialogNodeAction();
    action0.setName("action0");
    action0.setCredentials("credential0");
    DialogNodeAction action1 = new DialogNodeAction();
    action1.setName("action1");
    action1.setCredentials("credential1");
    UpdateDialogNodeOptions updateOptions = new UpdateDialogNodeOptions.Builder().workspaceId(WORKSPACE_ID).dialogNode(dialogNodeName).newDialogNode(newDialogNodeName).addNewActions(action0).addNewActions(action1).newDigressIn(UpdateDialogNodeOptions.NewDigressIn.RETURNS).newDigressOut(UpdateDialogNodeOptions.NewDigressOut.ALLOW_ALL).newDigressOutSlots(UpdateDialogNodeOptions.NewDigressOutSlots.ALLOW_ALL).build();
    assertEquals(updateOptions.workspaceId(), WORKSPACE_ID);
    assertEquals(updateOptions.dialogNode(), dialogNodeName);
    assertEquals(updateOptions.newActions().size(), 2);
    assertEquals(updateOptions.newActions().get(0), action0);
    assertEquals(updateOptions.newActions().get(0).getCredentials(), "credential0");
    assertEquals(updateOptions.newActions().get(1), action1);
    assertEquals(updateOptions.newActions().get(1).getCredentials(), "credential1");
    assertEquals(updateOptions.newDigressIn(), UpdateDialogNodeOptions.NewDigressIn.RETURNS);
    assertEquals(updateOptions.newDigressOut(), UpdateDialogNodeOptions.NewDigressOut.ALLOW_ALL);
    assertEquals(updateOptions.newDigressOutSlots(), UpdateDialogNodeOptions.NewDigressOutSlots.ALLOW_ALL);
}
Also used : DialogNodeAction(com.ibm.watson.developer_cloud.assistant.v1.model.DialogNodeAction) UpdateDialogNodeOptions(com.ibm.watson.developer_cloud.assistant.v1.model.UpdateDialogNodeOptions) WatsonServiceUnitTest(com.ibm.watson.developer_cloud.WatsonServiceUnitTest) Test(org.junit.Test)

Example 3 with DialogNodeAction

use of com.ibm.watson.developer_cloud.assistant.v1.model.DialogNodeAction in project java-sdk by watson-developer-cloud.

the class AssistantTest method testCreateDialogNodeOptionsBuilder.

/**
 * Test CreateDialogNodeOptions builder.
 */
@Test
public void testCreateDialogNodeOptionsBuilder() {
    String dialogNodeName = "aDialogNode";
    DialogNodeAction action0 = new DialogNodeAction();
    action0.setName("action0");
    action0.setCredentials("credential0");
    DialogNodeAction action1 = new DialogNodeAction();
    action1.setName("action1");
    action1.setCredentials("credential1");
    CreateDialogNodeOptions createOptions = new CreateDialogNodeOptions.Builder().workspaceId(WORKSPACE_ID).dialogNode(dialogNodeName).addActions(action0).addActions(action1).digressIn(CreateDialogNodeOptions.DigressIn.RETURNS).digressOut(CreateDialogNodeOptions.DigressOut.ALLOW_ALL).digressOutSlots(CreateDialogNodeOptions.DigressOutSlots.ALLOW_ALL).build();
    assertEquals(createOptions.workspaceId(), WORKSPACE_ID);
    assertEquals(createOptions.dialogNode(), dialogNodeName);
    assertEquals(createOptions.actions().size(), 2);
    assertEquals(createOptions.actions().get(0), action0);
    assertEquals(createOptions.actions().get(0).getCredentials(), "credential0");
    assertEquals(createOptions.actions().get(1), action1);
    assertEquals(createOptions.actions().get(1).getCredentials(), "credential1");
    assertEquals(createOptions.digressIn(), CreateDialogNodeOptions.DigressIn.RETURNS);
    assertEquals(createOptions.digressOut(), CreateDialogNodeOptions.DigressOut.ALLOW_ALL);
    assertEquals(createOptions.digressOutSlots(), CreateDialogNodeOptions.DigressOutSlots.ALLOW_ALL);
}
Also used : DialogNodeAction(com.ibm.watson.developer_cloud.assistant.v1.model.DialogNodeAction) CreateDialogNodeOptions(com.ibm.watson.developer_cloud.assistant.v1.model.CreateDialogNodeOptions) WatsonServiceUnitTest(com.ibm.watson.developer_cloud.WatsonServiceUnitTest) Test(org.junit.Test)

Example 4 with DialogNodeAction

use of com.ibm.watson.developer_cloud.assistant.v1.model.DialogNodeAction in project java-sdk by watson-developer-cloud.

the class ConversationTest method testUpdateDialogNodeOptionsBuilder.

/**
 * Test UpdateDialogNodeOptions builder.
 */
@Test
public void testUpdateDialogNodeOptionsBuilder() {
    String dialogNodeName = "aDialogNode";
    String newDialogNodeName = "renamedDialogNode";
    DialogNodeAction action0 = new DialogNodeAction();
    action0.setName("action0");
    action0.setCredentials("credential0");
    DialogNodeAction action1 = new DialogNodeAction();
    action1.setName("action1");
    action1.setCredentials("credential1");
    UpdateDialogNodeOptions updateOptions = new UpdateDialogNodeOptions.Builder().workspaceId(WORKSPACE_ID).dialogNode(dialogNodeName).newDialogNode(newDialogNodeName).addNewActions(action0).addNewActions(action1).build();
    assertEquals(updateOptions.workspaceId(), WORKSPACE_ID);
    assertEquals(updateOptions.dialogNode(), dialogNodeName);
    assertEquals(updateOptions.newActions().size(), 2);
    assertEquals(updateOptions.newActions().get(0), action0);
    assertEquals(updateOptions.newActions().get(0).getCredentials(), "credential0");
    assertEquals(updateOptions.newActions().get(1), action1);
    assertEquals(updateOptions.newActions().get(1).getCredentials(), "credential1");
}
Also used : DialogNodeAction(com.ibm.watson.developer_cloud.conversation.v1.model.DialogNodeAction) UpdateDialogNodeOptions(com.ibm.watson.developer_cloud.conversation.v1.model.UpdateDialogNodeOptions) WatsonServiceUnitTest(com.ibm.watson.developer_cloud.WatsonServiceUnitTest) Test(org.junit.Test)

Aggregations

WatsonServiceUnitTest (com.ibm.watson.developer_cloud.WatsonServiceUnitTest)4 Test (org.junit.Test)4 DialogNodeAction (com.ibm.watson.developer_cloud.assistant.v1.model.DialogNodeAction)2 DialogNodeAction (com.ibm.watson.developer_cloud.conversation.v1.model.DialogNodeAction)2 CreateDialogNodeOptions (com.ibm.watson.developer_cloud.assistant.v1.model.CreateDialogNodeOptions)1 UpdateDialogNodeOptions (com.ibm.watson.developer_cloud.assistant.v1.model.UpdateDialogNodeOptions)1 CreateDialogNodeOptions (com.ibm.watson.developer_cloud.conversation.v1.model.CreateDialogNodeOptions)1 UpdateDialogNodeOptions (com.ibm.watson.developer_cloud.conversation.v1.model.UpdateDialogNodeOptions)1