IntentRenderer { public Optional<DialogIntent> renderDialogIntent(IntentDefinition intentDefinition, IntentData intentData) { if (hasDialogInformation(intentData)) { DialogIntent intent = DialogIntent.builder() .withName(intentDefinition.getName()) .withSlots(renderDialogSlots(intentDefinition, intentData).orElse(null)) .withConfirmationRequired(intentData.getConfirmationRequired()) .withPrompts(resolveConfirmationPrompt(intentDefinition, intentData)) .build(); return Optional.of(intent); } return Optional.empty(); } IntentRenderer(IntentSlotRenderer intentSlotRenderer);  IntentRenderer(); Intent renderIntent(IntentDefinition intentDefinition, IntentData intentData); Optional<DialogIntent> renderDialogIntent(IntentDefinition intentDefinition, IntentData intentData); List<Prompt> renderPrompts(IntentDefinition intentDefinition, IntentData intentData);  }
@Test public void testRenderDialogIntent_NoDialogInformation() { assertEquals(Optional.empty(), underTest.renderDialogIntent(intent, IntentData.builder().build())); assertEquals(Optional.empty(), underTest.renderDialogIntent( intent, IntentData.builder().addSlot("slot_name", IntentSlotData.builder().build()).build())); }