Search in sources :

Example 16 with NotFoundException

use of org.apache.kafka.connect.errors.NotFoundException in project kafka by apache.

the class ConnectorsResourceTest method testGetConnectorConfigConnectorNotFound.

@Test(expected = NotFoundException.class)
public void testGetConnectorConfigConnectorNotFound() throws Throwable {
    final Capture<Callback<Map<String, String>>> cb = Capture.newInstance();
    herder.connectorConfig(EasyMock.eq(CONNECTOR_NAME), EasyMock.capture(cb));
    expectAndCallbackException(cb, new NotFoundException("not found"));
    PowerMock.replayAll();
    connectorsResource.getConnectorConfig(CONNECTOR_NAME, FORWARD);
    PowerMock.verifyAll();
}
Also used : Callback(org.apache.kafka.connect.util.Callback) NotFoundException(org.apache.kafka.connect.errors.NotFoundException) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) Test(org.junit.Test)

Aggregations

NotFoundException (org.apache.kafka.connect.errors.NotFoundException)16 Test (org.junit.Test)8 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)7 Callback (org.apache.kafka.connect.util.Callback)6 ConnectException (org.apache.kafka.connect.errors.ConnectException)5 ConnectorTaskId (org.apache.kafka.connect.util.ConnectorTaskId)4 ArrayList (java.util.ArrayList)3 NoSuchElementException (java.util.NoSuchElementException)3 TimeoutException (java.util.concurrent.TimeoutException)3 WakeupException (org.apache.kafka.common.errors.WakeupException)3 AlreadyExistsException (org.apache.kafka.connect.errors.AlreadyExistsException)3 ConnectorInfo (org.apache.kafka.connect.runtime.rest.entities.ConnectorInfo)3 TaskInfo (org.apache.kafka.connect.runtime.rest.entities.TaskInfo)3 BadRequestException (org.apache.kafka.connect.runtime.rest.errors.BadRequestException)3 ExecutionException (java.util.concurrent.ExecutionException)2 FutureCallback (org.apache.kafka.connect.util.FutureCallback)2 List (java.util.List)1 ConnectorStatus (org.apache.kafka.connect.runtime.ConnectorStatus)1 Herder (org.apache.kafka.connect.runtime.Herder)1 TargetState (org.apache.kafka.connect.runtime.TargetState)1