@Test public void testRenderSlotPrompts_ExplicitConfirmationPromptId() { when(mockSlotMetadata.getConfirmations()).thenReturn(confirmations); when(mockSlotMetadata.getPrompts()).thenReturn(DialogSlotPrompt.builder() .withConfirmation("explicit.confirmation") .build()); List<Prompt> prompts = underTest.renderSlotPrompts(mockIntentDefinition, "slot_name", mockSlotMetadata); assertEquals(prompts, Collections.singletonList( Prompt.builder() .withId("explicit.confirmation") .withVariations(new ArrayList<>(confirmations)) .build() )); }
public List<Prompt> renderSlotPrompts(IntentDefinition intentDefinition, String slotName, IntentSlotData slotData) { assertNotNull(intentDefinition, "intentDefinition"); assertNotNull(slotName, "slotName"); assertNotNull(slotData, "slotData"); List<Prompt> prompts = new ArrayList<>(); if (!slotData.getConfirmations().isEmpty()) { String promptName = getConfirmPromptName(intentDefinition, slotName, slotData); prompts.add(getPrompt(promptName, slotData.getConfirmations())); } if (!slotData.getElicitations().isEmpty()) { String promptName = getElicitPromptName(intentDefinition, slotName, slotData); prompts.add(getPrompt(promptName, slotData.getElicitations())); } return prompts; }
IntentSlotRenderer { public List<Prompt> renderSlotPrompts(IntentDefinition intentDefinition, String slotName, IntentSlotData slotData) { assertNotNull(intentDefinition, "intentDefinition"); assertNotNull(slotName, "slotName"); assertNotNull(slotData, "slotData"); List<Prompt> prompts = new ArrayList<>(); if (!slotData.getConfirmations().isEmpty()) { String promptName = getConfirmPromptName(intentDefinition, slotName, slotData); prompts.add(getPrompt(promptName, slotData.getConfirmations())); } if (!slotData.getElicitations().isEmpty()) { String promptName = getElicitPromptName(intentDefinition, slotName, slotData); prompts.add(getPrompt(promptName, slotData.getElicitations())); } return prompts; } }
IntentSlotRenderer { public List<Prompt> renderSlotPrompts(IntentDefinition intentDefinition, String slotName, IntentSlotData slotData) { assertNotNull(intentDefinition, "intentDefinition"); assertNotNull(slotName, "slotName"); assertNotNull(slotData, "slotData"); List<Prompt> prompts = new ArrayList<>(); if (!slotData.getConfirmations().isEmpty()) { String promptName = getConfirmPromptName(intentDefinition, slotName, slotData); prompts.add(getPrompt(promptName, slotData.getConfirmations())); } if (!slotData.getElicitations().isEmpty()) { String promptName = getElicitPromptName(intentDefinition, slotName, slotData); prompts.add(getPrompt(promptName, slotData.getElicitations())); } return prompts; }  }
IntentSlotRenderer { public List<Prompt> renderSlotPrompts(IntentDefinition intentDefinition, String slotName, IntentSlotData slotData) { assertNotNull(intentDefinition, "intentDefinition"); assertNotNull(slotName, "slotName"); assertNotNull(slotData, "slotData"); List<Prompt> prompts = new ArrayList<>(); if (!slotData.getConfirmations().isEmpty()) { String promptName = getConfirmPromptName(intentDefinition, slotName, slotData); prompts.add(getPrompt(promptName, slotData.getConfirmations())); } if (!slotData.getElicitations().isEmpty()) { String promptName = getElicitPromptName(intentDefinition, slotName, slotData); prompts.add(getPrompt(promptName, slotData.getElicitations())); } return prompts; }  Slot renderSlot(String slotName, SlotTypeDefinition slotType, IntentData intentData); DialogSlot renderDialogSlot(IntentDefinition intentDefinition, String slotName, SlotTypeDefinition slotType, IntentSlotData slotData); List<Prompt> renderSlotPrompts(IntentDefinition intentDefinition, String slotName, IntentSlotData slotData); }
IntentSlotRenderer { public List<Prompt> renderSlotPrompts(IntentDefinition intentDefinition, String slotName, IntentSlotData slotData) { assertNotNull(intentDefinition, "intentDefinition"); assertNotNull(slotName, "slotName"); assertNotNull(slotData, "slotData"); List<Prompt> prompts = new ArrayList<>(); if (!slotData.getConfirmations().isEmpty()) { String promptName = getConfirmPromptName(intentDefinition, slotName, slotData); prompts.add(getPrompt(promptName, slotData.getConfirmations())); } if (!slotData.getElicitations().isEmpty()) { String promptName = getElicitPromptName(intentDefinition, slotName, slotData); prompts.add(getPrompt(promptName, slotData.getElicitations())); } return prompts; }  Slot renderSlot(String slotName, SlotTypeDefinition slotType, IntentData intentData); DialogSlot renderDialogSlot(IntentDefinition intentDefinition, String slotName, SlotTypeDefinition slotType, IntentSlotData slotData); List<Prompt> renderSlotPrompts(IntentDefinition intentDefinition, String slotName, IntentSlotData slotData);  }