@Test public void testRenderDialogSlot_ConfirmationRequired() { when(mockSlotMetadata.getConfirmationRequired()).thenReturn(true); assertTrue(underTest.renderDialogSlot(mockIntentDefinition, "slot_name", mockSlotTypeDefinition, mockSlotMetadata).getConfirmationRequired()); when(mockSlotMetadata.getConfirmationRequired()).thenReturn(false); assertFalse(underTest.renderDialogSlot(mockIntentDefinition, "slot_name", mockSlotTypeDefinition, mockSlotMetadata).getConfirmationRequired()); }
public DialogSlot renderDialogSlot(IntentDefinition intentDefinition, String slotName, SlotTypeDefinition slotType, IntentSlotData slotData) { assertNotNull(intentDefinition, "intentDefinition"); assertStringNotEmpty(slotName, "slotName"); assertNotNull(slotType, "slotType"); assertNotNull(slotData, "slotData"); return DialogSlot.builder() .withName(slotName) .withType(slotType.getName()) .withElicitationRequired(slotData.getElicitationRequired()) .withConfirmationRequired(slotData.getConfirmationRequired()) .withPrompts(DialogSlotPrompt.builder() .withConfirmation(getConfirmPromptName(intentDefinition, slotName, slotData)) .withElicitation(getElicitPromptName(intentDefinition, slotName, slotData)) .build()) .build(); }
IntentSlotRenderer { public DialogSlot renderDialogSlot(IntentDefinition intentDefinition, String slotName, SlotTypeDefinition slotType, IntentSlotData slotData) { assertNotNull(intentDefinition, "intentDefinition"); assertStringNotEmpty(slotName, "slotName"); assertNotNull(slotType, "slotType"); assertNotNull(slotData, "slotData"); return DialogSlot.builder() .withName(slotName) .withType(slotType.getName()) .withElicitationRequired(slotData.getElicitationRequired()) .withConfirmationRequired(slotData.getConfirmationRequired()) .withPrompts(DialogSlotPrompt.builder() .withConfirmation(getConfirmPromptName(intentDefinition, slotName, slotData)) .withElicitation(getElicitPromptName(intentDefinition, slotName, slotData)) .build()) .build(); } }
IntentSlotRenderer { public DialogSlot renderDialogSlot(IntentDefinition intentDefinition, String slotName, SlotTypeDefinition slotType, IntentSlotData slotData) { assertNotNull(intentDefinition, "intentDefinition"); assertStringNotEmpty(slotName, "slotName"); assertNotNull(slotType, "slotType"); assertNotNull(slotData, "slotData"); return DialogSlot.builder() .withName(slotName) .withType(slotType.getName()) .withElicitationRequired(slotData.getElicitationRequired()) .withConfirmationRequired(slotData.getConfirmationRequired()) .withPrompts(DialogSlotPrompt.builder() .withConfirmation(getConfirmPromptName(intentDefinition, slotName, slotData)) .withElicitation(getElicitPromptName(intentDefinition, slotName, slotData)) .build()) .build(); }  }
IntentSlotRenderer { public DialogSlot renderDialogSlot(IntentDefinition intentDefinition, String slotName, SlotTypeDefinition slotType, IntentSlotData slotData) { assertNotNull(intentDefinition, "intentDefinition"); assertStringNotEmpty(slotName, "slotName"); assertNotNull(slotType, "slotType"); assertNotNull(slotData, "slotData"); return DialogSlot.builder() .withName(slotName) .withType(slotType.getName()) .withElicitationRequired(slotData.getElicitationRequired()) .withConfirmationRequired(slotData.getConfirmationRequired()) .withPrompts(DialogSlotPrompt.builder() .withConfirmation(getConfirmPromptName(intentDefinition, slotName, slotData)) .withElicitation(getElicitPromptName(intentDefinition, slotName, slotData)) .build()) .build(); }  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 DialogSlot renderDialogSlot(IntentDefinition intentDefinition, String slotName, SlotTypeDefinition slotType, IntentSlotData slotData) { assertNotNull(intentDefinition, "intentDefinition"); assertStringNotEmpty(slotName, "slotName"); assertNotNull(slotType, "slotType"); assertNotNull(slotData, "slotData"); return DialogSlot.builder() .withName(slotName) .withType(slotType.getName()) .withElicitationRequired(slotData.getElicitationRequired()) .withConfirmationRequired(slotData.getConfirmationRequired()) .withPrompts(DialogSlotPrompt.builder() .withConfirmation(getConfirmPromptName(intentDefinition, slotName, slotData)) .withElicitation(getElicitPromptName(intentDefinition, slotName, slotData)) .build()) .build(); }  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);  }