@Test public void testSendWithNoEndpoint() throws Exception { Meta meta = m_metaHolder.getMeta(); reset(m_metaHolder); Topic topic = meta.findTopic(TEST_TOPIC); for (Partition p : topic.getPartitions()) { p.setEndpoint(null); } when(m_metaHolder.getMeta()).thenReturn(meta); brokerActionsWhenReceivedSendMessageCmd( // MessageSendAnswer.NoOp); List<Pair<String, String>> appProperties = Arrays.asList(new Pair<String, String>("a", "A")); Future<SendResult> future = sendAsync(TEST_TOPIC, "pKey", "body", "rKey", appProperties, false, null); try { future.get( lookup(ProducerConfig.class).getBrokerSenderSendTimeoutMillis() + 200L, TimeUnit.MILLISECONDS); fail(); } catch (TimeoutException e) { // do nothing } catch (Exception e) { fail(); } assertFalse(future.isDone()); List<Command> brokerReceivedCmds = getBrokerReceivedCmds(); assertEquals(0, brokerReceivedCmds.size()); }