use of org.apache.kafka.connect.runtime.distributed.NotLeaderException in project kafka by apache.
the class ConnectorsResourceTest method testCompleteOrForwardWithErrorAndNoForwardUrl.
@Test
public void testCompleteOrForwardWithErrorAndNoForwardUrl() {
final Capture<Callback<Herder.Created<ConnectorInfo>>> cb = Capture.newInstance();
herder.deleteConnectorConfig(EasyMock.eq(CONNECTOR_NAME), EasyMock.capture(cb));
String leaderUrl = null;
expectAndCallbackException(cb, new NotLeaderException("not leader", leaderUrl));
PowerMock.replayAll();
ConnectRestException e = assertThrows(ConnectRestException.class, () -> connectorsResource.destroyConnector(CONNECTOR_NAME, NULL_HEADERS, FORWARD));
assertTrue(e.getMessage().contains("no known leader URL"));
PowerMock.verifyAll();
}
Aggregations