@SuppressWarnings("unchecked")
@Test
public void returnLinkableItemTypesForTriggerChannelType() throws IOException {

    ChannelTypeUID channelTypeUID = new ChannelTypeUID("binding", "ct");
    ChannelType channelType = ChannelTypeBuilder.trigger(channelTypeUID, "Label").build();
    when(channelTypeRegistry.getChannelType(channelTypeUID)).thenReturn(channelType);
    TriggerProfileType profileType = mock(TriggerProfileType.class);
    when(profileType.getSupportedChannelTypeUIDs()).thenReturn(List.of(channelTypeUID));
    when(profileType.getSupportedItemTypes()).thenReturn(List.of("Switch", "Dimmer"));
    when(profileTypeRegistry.getProfileTypes()).thenReturn(List.of(profileType));
    Response response = channelTypeResource.getLinkableItemTypes(channelTypeUID.getAsString());
    verify(channelTypeRegistry).getChannelType(channelTypeUID);
    verify(profileTypeRegistry).getProfileTypes();
    assertThat(response.getStatus(), is(200));
    assertThat((Set<String>) response.getEntity(), IsIterableContaining.hasItems("Switch", "Dimmer"));
}