test_class.declarator: LEADER_URL = "http://leader:8083/"
test_class.modifier: private static final
test_class.original_string: private static final String LEADER_URL = "http://leader:8083/";
test_class.type: String
test_class.var_name: LEADER_URL
test_class.declarator: CONNECTOR_NAME = "test"
test_class.modifier: private static final
test_class.original_string: private static final String CONNECTOR_NAME = "test";
test_class.type: String
test_class.var_name: CONNECTOR_NAME
test_class.declarator: CONNECTOR2_NAME = "test2"
test_class.modifier: private static final
test_class.original_string: private static final String CONNECTOR2_NAME = "test2";
test_class.type: String
test_class.var_name: CONNECTOR2_NAME
test_class.declarator: FORWARD = true
test_class.modifier: private static final
test_class.original_string: private static final Boolean FORWARD = true;
test_class.type: Boolean
test_class.var_name: FORWARD
test_class.declarator: CONNECTOR_CONFIG = new HashMap<>()
test_class.modifier: private static final
test_class.original_string: private static final Map<String, String> CONNECTOR_CONFIG = new HashMap<>();
test_class.type: Map<String, String>
test_class.var_name: CONNECTOR_CONFIG
test_class.declarator: CONNECTOR_TASK_NAMES = Arrays.asList(
              new ConnectorTaskId(CONNECTOR_NAME, 0),
              new ConnectorTaskId(CONNECTOR_NAME, 1)
      )
test_class.modifier: private static final
test_class.original_string: private static final List<ConnectorTaskId> CONNECTOR_TASK_NAMES = Arrays.asList(
              new ConnectorTaskId(CONNECTOR_NAME, 0),
              new ConnectorTaskId(CONNECTOR_NAME, 1)
      );
test_class.type: List<ConnectorTaskId>
test_class.var_name: CONNECTOR_TASK_NAMES
test_class.declarator: TASK_CONFIGS = new ArrayList<>()
test_class.modifier: private static final
test_class.original_string: private static final List<Map<String, String>> TASK_CONFIGS = new ArrayList<>();
test_class.type: List<Map<String, String>>
test_class.var_name: TASK_CONFIGS
test_class.declarator: TASK_INFOS = new ArrayList<>()
test_class.modifier: private static final
test_class.original_string: private static final List<TaskInfo> TASK_INFOS = new ArrayList<>();
test_class.type: List<TaskInfo>
test_class.var_name: TASK_INFOS
test_class.declarator: herder
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private Herder herder;
test_class.type: Herder
test_class.var_name: herder
test_class.declarator: connectorsResource
test_class.modifier: private
test_class.original_string: private ConnectorsResource connectorsResource;
test_class.type: ConnectorsResource
test_class.var_name: connectorsResource
test_class.file: connect/runtime/src/test/java/org/apache/kafka/connect/runtime/rest/resources/ConnectorsResourceTest.java
test_class.identifier: ConnectorsResourceTest
test_case.body: @Test
      public void testCreateConnector() throws Throwable {
          CreateConnectorRequest body = new CreateConnectorRequest(CONNECTOR_NAME, Collections.singletonMap(ConnectorConfig.NAME_CONFIG, CONNECTOR_NAME));
  
          final Capture<Callback<Herder.Created<ConnectorInfo>>> cb = Capture.newInstance();
          herder.putConnectorConfig(EasyMock.eq(CONNECTOR_NAME), EasyMock.eq(body.config()), EasyMock.eq(false), EasyMock.capture(cb));
          expectAndCallbackResult(cb, new Herder.Created<>(true, new ConnectorInfo(CONNECTOR_NAME, CONNECTOR_CONFIG, CONNECTOR_TASK_NAMES)));
  
          PowerMock.replayAll();
  
          connectorsResource.createConnector(FORWARD, body);
  
          PowerMock.verifyAll();
      }
test_case.class_method_signature: ConnectorsResourceTest.testCreateConnector()
test_case.full_signature: @Test public void testCreateConnector()
test_case.identifier: testCreateConnector
test_case.invocations: singletonMap newInstance putConnectorConfig eq eq config eq capture expectAndCallbackResult replayAll createConnector verifyAll
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testCreateConnector()
focal_class.declarator: log = LoggerFactory.getLogger(ConnectorsResource.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger log = LoggerFactory.getLogger(ConnectorsResource.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: REQUEST_TIMEOUT_MS = 90 * 1000
focal_class.modifier: private static final
focal_class.original_string: private static final long REQUEST_TIMEOUT_MS = 90 * 1000;
focal_class.type: long
focal_class.var_name: REQUEST_TIMEOUT_MS
focal_class.declarator: herder
focal_class.modifier: private final
focal_class.original_string: private final Herder herder;
focal_class.type: Herder
focal_class.var_name: herder
focal_class.declarator: context
focal_class.modifier: @javax.ws.rs.core.Context
      private
focal_class.original_string: @javax.ws.rs.core.Context
      private ServletContext context;
focal_class.type: ServletContext
focal_class.var_name: context
focal_class.file: connect/runtime/src/main/java/org/apache/kafka/connect/runtime/rest/resources/ConnectorsResource.java
focal_class.identifier: ConnectorsResource
focal_class.class_method_signature: ConnectorsResource.ConnectorsResource(Herder herder)
focal_class.full_signature: public  ConnectorsResource(Herder herder)
focal_class.identifier: ConnectorsResource
focal_class.modifiers: public
focal_class.parameters: (Herder herder)
focal_class.signature:  ConnectorsResource(Herder herder)
focal_class.class_method_signature: ConnectorsResource.listConnectors(final @QueryParam("forward") Boolean forward)
focal_class.full_signature: @GET @Path("/") public Collection<String> listConnectors(final @QueryParam("forward") Boolean forward)
focal_class.identifier: listConnectors
focal_class.modifiers: @GET @Path("/") public
focal_class.parameters: (final @QueryParam("forward") Boolean forward)
focal_class.return: Collection<String>
focal_class.signature: Collection<String> listConnectors(final @QueryParam("forward") Boolean forward)
focal_class.class_method_signature: ConnectorsResource.createConnector(final @QueryParam("forward") Boolean forward,
                                      final CreateConnectorRequest createRequest)
focal_class.full_signature: @POST @Path("/") public Response createConnector(final @QueryParam("forward") Boolean forward,
                                      final CreateConnectorRequest createRequest)
focal_class.identifier: createConnector
focal_class.modifiers: @POST @Path("/") public
focal_class.parameters: (final @QueryParam("forward") Boolean forward,
                                      final CreateConnectorRequest createRequest)
focal_class.return: Response
focal_class.signature: Response createConnector(final @QueryParam("forward") Boolean forward,
                                      final CreateConnectorRequest createRequest)
focal_class.class_method_signature: ConnectorsResource.getConnector(final @PathParam("connector") String connector,
                                        final @QueryParam("forward") Boolean forward)
focal_class.full_signature: @GET @Path("/{connector}") public ConnectorInfo getConnector(final @PathParam("connector") String connector,
                                        final @QueryParam("forward") Boolean forward)
focal_class.identifier: getConnector
focal_class.modifiers: @GET @Path("/{connector}") public
focal_class.parameters: (final @PathParam("connector") String connector,
                                        final @QueryParam("forward") Boolean forward)
focal_class.return: ConnectorInfo
focal_class.signature: ConnectorInfo getConnector(final @PathParam("connector") String connector,
                                        final @QueryParam("forward") Boolean forward)
focal_class.class_method_signature: ConnectorsResource.getConnectorConfig(final @PathParam("connector") String connector,
                                                    final @QueryParam("forward") Boolean forward)
focal_class.full_signature: @GET @Path("/{connector}/config") public Map<String, String> getConnectorConfig(final @PathParam("connector") String connector,
                                                    final @QueryParam("forward") Boolean forward)
focal_class.identifier: getConnectorConfig
focal_class.modifiers: @GET @Path("/{connector}/config") public
focal_class.parameters: (final @PathParam("connector") String connector,
                                                    final @QueryParam("forward") Boolean forward)
focal_class.return: Map<String, String>
focal_class.signature: Map<String, String> getConnectorConfig(final @PathParam("connector") String connector,
                                                    final @QueryParam("forward") Boolean forward)
focal_class.class_method_signature: ConnectorsResource.getConnectorStatus(final @PathParam("connector") String connector)
focal_class.full_signature: @GET @Path("/{connector}/status") public ConnectorStateInfo getConnectorStatus(final @PathParam("connector") String connector)
focal_class.identifier: getConnectorStatus
focal_class.modifiers: @GET @Path("/{connector}/status") public
focal_class.parameters: (final @PathParam("connector") String connector)
focal_class.return: ConnectorStateInfo
focal_class.signature: ConnectorStateInfo getConnectorStatus(final @PathParam("connector") String connector)
focal_class.class_method_signature: ConnectorsResource.putConnectorConfig(final @PathParam("connector") String connector,
                                         final @QueryParam("forward") Boolean forward,
                                         final Map<String, String> connectorConfig)
focal_class.full_signature: @PUT @Path("/{connector}/config") public Response putConnectorConfig(final @PathParam("connector") String connector,
                                         final @QueryParam("forward") Boolean forward,
                                         final Map<String, String> connectorConfig)
focal_class.identifier: putConnectorConfig
focal_class.modifiers: @PUT @Path("/{connector}/config") public
focal_class.parameters: (final @PathParam("connector") String connector,
                                         final @QueryParam("forward") Boolean forward,
                                         final Map<String, String> connectorConfig)
focal_class.return: Response
focal_class.signature: Response putConnectorConfig(final @PathParam("connector") String connector,
                                         final @QueryParam("forward") Boolean forward,
                                         final Map<String, String> connectorConfig)
focal_class.class_method_signature: ConnectorsResource.restartConnector(final @PathParam("connector") String connector,
                                   final @QueryParam("forward") Boolean forward)
focal_class.full_signature: @POST @Path("/{connector}/restart") public void restartConnector(final @PathParam("connector") String connector,
                                   final @QueryParam("forward") Boolean forward)
focal_class.identifier: restartConnector
focal_class.modifiers: @POST @Path("/{connector}/restart") public
focal_class.parameters: (final @PathParam("connector") String connector,
                                   final @QueryParam("forward") Boolean forward)
focal_class.return: void
focal_class.signature: void restartConnector(final @PathParam("connector") String connector,
                                   final @QueryParam("forward") Boolean forward)
focal_class.class_method_signature: ConnectorsResource.pauseConnector(@PathParam("connector") String connector)
focal_class.full_signature: @PUT @Path("/{connector}/pause") public Response pauseConnector(@PathParam("connector") String connector)
focal_class.identifier: pauseConnector
focal_class.modifiers: @PUT @Path("/{connector}/pause") public
focal_class.parameters: (@PathParam("connector") String connector)
focal_class.return: Response
focal_class.signature: Response pauseConnector(@PathParam("connector") String connector)
focal_class.class_method_signature: ConnectorsResource.resumeConnector(@PathParam("connector") String connector)
focal_class.full_signature: @PUT @Path("/{connector}/resume") public Response resumeConnector(@PathParam("connector") String connector)
focal_class.identifier: resumeConnector
focal_class.modifiers: @PUT @Path("/{connector}/resume") public
focal_class.parameters: (@PathParam("connector") String connector)
focal_class.return: Response
focal_class.signature: Response resumeConnector(@PathParam("connector") String connector)
focal_class.class_method_signature: ConnectorsResource.getTaskConfigs(final @PathParam("connector") String connector,
                                           final @QueryParam("forward") Boolean forward)
focal_class.full_signature: @GET @Path("/{connector}/tasks") public List<TaskInfo> getTaskConfigs(final @PathParam("connector") String connector,
                                           final @QueryParam("forward") Boolean forward)
focal_class.identifier: getTaskConfigs
focal_class.modifiers: @GET @Path("/{connector}/tasks") public
focal_class.parameters: (final @PathParam("connector") String connector,
                                           final @QueryParam("forward") Boolean forward)
focal_class.return: List<TaskInfo>
focal_class.signature: List<TaskInfo> getTaskConfigs(final @PathParam("connector") String connector,
                                           final @QueryParam("forward") Boolean forward)
focal_class.class_method_signature: ConnectorsResource.putTaskConfigs(final @PathParam("connector") String connector,
                                 final @QueryParam("forward") Boolean forward,
                                 final List<Map<String, String>> taskConfigs)
focal_class.full_signature: @POST @Path("/{connector}/tasks") public void putTaskConfigs(final @PathParam("connector") String connector,
                                 final @QueryParam("forward") Boolean forward,
                                 final List<Map<String, String>> taskConfigs)
focal_class.identifier: putTaskConfigs
focal_class.modifiers: @POST @Path("/{connector}/tasks") public
focal_class.parameters: (final @PathParam("connector") String connector,
                                 final @QueryParam("forward") Boolean forward,
                                 final List<Map<String, String>> taskConfigs)
focal_class.return: void
focal_class.signature: void putTaskConfigs(final @PathParam("connector") String connector,
                                 final @QueryParam("forward") Boolean forward,
                                 final List<Map<String, String>> taskConfigs)
focal_class.class_method_signature: ConnectorsResource.getTaskStatus(final @PathParam("connector") String connector,
                                                        final @PathParam("task") Integer task)
focal_class.full_signature: @GET @Path("/{connector}/tasks/{task}/status") public ConnectorStateInfo.TaskState getTaskStatus(final @PathParam("connector") String connector,
                                                        final @PathParam("task") Integer task)
focal_class.identifier: getTaskStatus
focal_class.modifiers: @GET @Path("/{connector}/tasks/{task}/status") public
focal_class.parameters: (final @PathParam("connector") String connector,
                                                        final @PathParam("task") Integer task)
focal_class.return: ConnectorStateInfo.TaskState
focal_class.signature: ConnectorStateInfo.TaskState getTaskStatus(final @PathParam("connector") String connector,
                                                        final @PathParam("task") Integer task)
focal_class.class_method_signature: ConnectorsResource.restartTask(final @PathParam("connector") String connector,
                              final @PathParam("task") Integer task,
                              final @QueryParam("forward") Boolean forward)
focal_class.full_signature: @POST @Path("/{connector}/tasks/{task}/restart") public void restartTask(final @PathParam("connector") String connector,
                              final @PathParam("task") Integer task,
                              final @QueryParam("forward") Boolean forward)
focal_class.identifier: restartTask
focal_class.modifiers: @POST @Path("/{connector}/tasks/{task}/restart") public
focal_class.parameters: (final @PathParam("connector") String connector,
                              final @PathParam("task") Integer task,
                              final @QueryParam("forward") Boolean forward)
focal_class.return: void
focal_class.signature: void restartTask(final @PathParam("connector") String connector,
                              final @PathParam("task") Integer task,
                              final @QueryParam("forward") Boolean forward)
focal_class.class_method_signature: ConnectorsResource.destroyConnector(final @PathParam("connector") String connector,
                                   final @QueryParam("forward") Boolean forward)
focal_class.full_signature: @DELETE @Path("/{connector}") public void destroyConnector(final @PathParam("connector") String connector,
                                   final @QueryParam("forward") Boolean forward)
focal_class.identifier: destroyConnector
focal_class.modifiers: @DELETE @Path("/{connector}") public
focal_class.parameters: (final @PathParam("connector") String connector,
                                   final @QueryParam("forward") Boolean forward)
focal_class.return: void
focal_class.signature: void destroyConnector(final @PathParam("connector") String connector,
                                   final @QueryParam("forward") Boolean forward)
focal_class.class_method_signature: ConnectorsResource.completeOrForwardRequest(FutureCallback<T> cb,
                                                String path,
                                                String method,
                                                Object body,
                                                TypeReference<U> resultType,
                                                Translator<T, U> translator,
                                                Boolean forward)
focal_class.full_signature: private T completeOrForwardRequest(FutureCallback<T> cb,
                                                String path,
                                                String method,
                                                Object body,
                                                TypeReference<U> resultType,
                                                Translator<T, U> translator,
                                                Boolean forward)
focal_class.identifier: completeOrForwardRequest
focal_class.modifiers: private
focal_class.parameters: (FutureCallback<T> cb,
                                                String path,
                                                String method,
                                                Object body,
                                                TypeReference<U> resultType,
                                                Translator<T, U> translator,
                                                Boolean forward)
focal_class.return: T
focal_class.signature: T completeOrForwardRequest(FutureCallback<T> cb,
                                                String path,
                                                String method,
                                                Object body,
                                                TypeReference<U> resultType,
                                                Translator<T, U> translator,
                                                Boolean forward)
focal_class.class_method_signature: ConnectorsResource.completeOrForwardRequest(FutureCallback<T> cb, String path, String method, Object body,
                                             TypeReference<T> resultType, Boolean forward)
focal_class.full_signature: private T completeOrForwardRequest(FutureCallback<T> cb, String path, String method, Object body,
                                             TypeReference<T> resultType, Boolean forward)
focal_class.identifier: completeOrForwardRequest
focal_class.modifiers: private
focal_class.parameters: (FutureCallback<T> cb, String path, String method, Object body,
                                             TypeReference<T> resultType, Boolean forward)
focal_class.return: T
focal_class.signature: T completeOrForwardRequest(FutureCallback<T> cb, String path, String method, Object body,
                                             TypeReference<T> resultType, Boolean forward)
focal_class.class_method_signature: ConnectorsResource.completeOrForwardRequest(FutureCallback<T> cb, String path, String method,
                                             Object body, Boolean forward)
focal_class.full_signature: private T completeOrForwardRequest(FutureCallback<T> cb, String path, String method,
                                             Object body, Boolean forward)
focal_class.identifier: completeOrForwardRequest
focal_class.modifiers: private
focal_class.parameters: (FutureCallback<T> cb, String path, String method,
                                             Object body, Boolean forward)
focal_class.return: T
focal_class.signature: T completeOrForwardRequest(FutureCallback<T> cb, String path, String method,
                                             Object body, Boolean forward)
focal_method.body: @POST
      @Path("/")
      public Response createConnector(final @QueryParam("forward") Boolean forward,
                                      final CreateConnectorRequest createRequest) throws Throwable {
          String name = createRequest.name();
          Map<String, String> configs = createRequest.config();
          if (!configs.containsKey(ConnectorConfig.NAME_CONFIG))
              configs.put(ConnectorConfig.NAME_CONFIG, name);
  
          FutureCallback<Herder.Created<ConnectorInfo>> cb = new FutureCallback<>();
          herder.putConnectorConfig(name, configs, false, cb);
          Herder.Created<ConnectorInfo> info = completeOrForwardRequest(cb, "/connectors", "POST", createRequest,
                  new TypeReference<ConnectorInfo>() { }, new CreatedConnectorInfoTranslator(), forward);
          return Response.created(URI.create("/connectors/" + name)).entity(info.result()).build();
      }
focal_method.class_method_signature: ConnectorsResource.createConnector(final @QueryParam("forward") Boolean forward,
                                      final CreateConnectorRequest createRequest)
focal_method.full_signature: @POST @Path("/") public Response createConnector(final @QueryParam("forward") Boolean forward,
                                      final CreateConnectorRequest createRequest)
focal_method.identifier: createConnector
focal_method.invocations: name config containsKey put putConnectorConfig completeOrForwardRequest build entity created create result
focal_method.modifiers: @POST @Path("/") public
focal_method.parameters: (final @QueryParam("forward") Boolean forward,
                                      final CreateConnectorRequest createRequest)
focal_method.return: Response
focal_method.signature: Response createConnector(final @QueryParam("forward") Boolean forward,
                                      final CreateConnectorRequest createRequest)