@@ -89,10 +89,12 @@ public class ConversationTest {
|
||||
|
||||
private class FirstPrompt extends StringPrompt {
|
||||
|
||||
@Override
|
||||
public String getPromptText(ConversationContext context) {
|
||||
return "FirstPrompt";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Prompt acceptInput(ConversationContext context, String input) {
|
||||
assertEquals("FirstInput", input);
|
||||
context.setSessionData("data", 10);
|
||||
@@ -107,6 +109,7 @@ public class ConversationTest {
|
||||
return Prompt.END_OF_CONVERSATION;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPromptText(ConversationContext context) {
|
||||
// Assert that session data passes from one prompt to the next
|
||||
assertEquals(context.getSessionData("data"), 10);
|
||||
|
||||
@@ -15,29 +15,35 @@ public class FakeConversable implements Conversable {
|
||||
public Conversation abandonedConverstion;
|
||||
public ConversationAbandonedEvent abandonedConversationEvent;
|
||||
|
||||
@Override
|
||||
public boolean isConversing() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void acceptConversationInput(String input) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean beginConversation(Conversation conversation) {
|
||||
begunConversation = conversation;
|
||||
conversation.outputNextPrompt();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void abandonConversation(Conversation conversation) {
|
||||
abandonedConverstion = conversation;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void abandonConversation(Conversation conversation, ConversationAbandonedEvent details) {
|
||||
abandonedConverstion = conversation;
|
||||
abandonedConversationEvent = details;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendRawMessage(String message) {
|
||||
lastSentMessage = message;
|
||||
}
|
||||
|
||||
@@ -57,6 +57,7 @@ public class ValidatingPromptTest {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPromptText(ConversationContext context) {
|
||||
return null;
|
||||
}
|
||||
@@ -75,6 +76,7 @@ public class ValidatingPromptTest {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPromptText(ConversationContext context) {
|
||||
return null;
|
||||
}
|
||||
@@ -89,6 +91,7 @@ public class ValidatingPromptTest {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPromptText(ConversationContext context) {
|
||||
return null;
|
||||
}
|
||||
@@ -107,6 +110,7 @@ public class ValidatingPromptTest {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPromptText(ConversationContext context) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user