SlotTypeRenderer { public com.amazon.ask.interaction.model.SlotType renderSlotType(SlotTypeDefinition slotType, SlotTypeData slotData) { assertNotNull(slotType, "slotType"); assertNotNull(slotData, "slotMetadata"); return com.amazon.ask.interaction.model.SlotType.builder() .withName(slotType.getName()) .withValues(renderValues(slotData)) .build(); }  com.amazon.ask.interaction.model.SlotType renderSlotType(SlotTypeDefinition slotType, SlotTypeData slotData);  }
@Test(expected = IllegalArgumentException.class) public void testNullSlotType() { underTest.renderSlotType(null, mockSlotData); }
@Test(expected = IllegalArgumentException.class) public void testNullSlotMetadata() { underTest.renderSlotType(null, mockSlotData); }
@Test public void testNoValues() { when(mockSlotData.getValuesIndex()).thenReturn(Collections.emptyMap()); assertEquals( underTest.renderSlotType(mockSlotType, mockSlotData), slotTypeBuilder() .withName("TypeName") .withValues(Collections.emptyList()) .build()); }
@Test public void testRenderValue() { when(mockSlotData.getValuesIndex()).thenReturn(Collections.singletonMap( "test_id", slotValueBuilder() .withValue("test_value") .withSynonyms(Collections.singletonList("test_synonym")) .build() )); assertEquals( underTest.renderSlotType(mockSlotType, mockSlotData), slotTypeBuilder() .withName("TypeName") .withValues(Collections.singletonList( slotTypeValueBuilder() .withId("test_id") .withName(slotValueBuilder() .withValue("test_value") .withSynonyms(Collections.singletonList("test_synonym")) .build() ) .build() )) .build()); }