@Test
public void testGetAllTopicsUnauthorized() {

    client.prepareResponse(newMetadataResponse(topicName, Errors.TOPIC_AUTHORIZATION_FAILED).toStruct());
    try {
        fetcher.getAllTopicMetadata(10L);
        fail();
    } catch (TopicAuthorizationException e) {
        assertEquals(Collections.singleton(topicName), e.unauthorizedTopics());
    }
}