@Test
public void shouldThrowJmsQueueBrowserUnsupportedOperationIfQueueNameIsNotAQueue() throws Exception {

    final String destinationName = "topic-name";
    final Topic topic = mock(Topic.class);
    when(destinationProvider.getDestination(destinationName)).thenReturn(topic);
    try {
        jmsQueueBrowser.sizeOf(destinationName);
        fail();
    } catch (final JmsQueueBrowserUnsupportedOperation exception) {
        assertThat(exception.getMessage(), is("The named destination must be a Queue: 'topic-name', unable to get the size of a Topic."));
    }
}