test_class.declarator: HTTP_200_STATUS_LINE = new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK")
test_class.modifier: private static final
test_class.original_string: private static final BasicStatusLine HTTP_200_STATUS_LINE = new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK");
test_class.type: BasicStatusLine
test_class.var_name: HTTP_200_STATUS_LINE
test_class.declarator: gson = new GsonBuilder().setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES).create()
test_class.modifier: private static final
test_class.original_string: private static final Gson gson = new GsonBuilder().setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES).create();
test_class.type: Gson
test_class.var_name: gson
test_class.declarator: DEFAULT_TEST_PARAMETERS = new HashMap<String, String>()
test_class.modifier: private static final
test_class.original_string: private static final Map<String, String> DEFAULT_TEST_PARAMETERS = new HashMap<String, String>();
test_class.type: Map<String, String>
test_class.var_name: DEFAULT_TEST_PARAMETERS
test_class.file: utils/src/test/java/com/cloud/utils/rest/RESTServiceConnectorTest.java
test_class.identifier: RESTServiceConnectorTest
test_case.body: @Test
      public void testExecuteDeleteObject() throws Exception {
          final HttpEntity entity = mock(HttpEntity.class);
          final CloseableHttpResponse response = mock(CloseableHttpResponse.class);
          when(response.getEntity()).thenReturn(entity);
          when(response.getStatusLine()).thenReturn(HTTP_200_STATUS_LINE);
          final CloseableHttpClient httpClient = mock(CloseableHttpClient.class);
          when(httpClient.execute(any(HttpHost.class), any(HttpRequest.class), any(HttpClientContext.class))).thenReturn(response);
          final RestClient restClient = new BasicRestClient(httpClient, HttpClientContext.create(), "localhost");
          final RESTServiceConnector connector = new RESTServiceConnector.Builder().client(restClient).build();
  
          connector.executeDeleteObject("/somepath");
  
          verify(httpClient).execute(any(HttpHost.class), HttpUriRequestMethodMatcher.aMethod("DELETE"), any(HttpClientContext.class));
          verify(response).close();
      }
test_case.class_method_signature: RESTServiceConnectorTest.testExecuteDeleteObject()
test_case.full_signature: @Test public void testExecuteDeleteObject()
test_case.identifier: testExecuteDeleteObject
test_case.invocations: mock mock thenReturn when getEntity thenReturn when getStatusLine mock thenReturn when execute any any any create build client executeDeleteObject execute verify any aMethod any close verify
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testExecuteDeleteObject()
focal_class.declarator: s_logger = LoggerFactory.getLogger(RESTServiceConnector.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger s_logger = LoggerFactory.getLogger(RESTServiceConnector.class);
focal_class.type: Logger
focal_class.var_name: s_logger
focal_class.declarator: ABSENT = Optional.absent()
focal_class.modifier: private static final
focal_class.original_string: private static final Optional<String> ABSENT = Optional.absent();
focal_class.type: Optional<String>
focal_class.var_name: ABSENT
focal_class.declarator: client
focal_class.modifier: private final
focal_class.original_string: private final RestClient client;
focal_class.type: RestClient
focal_class.var_name: client
focal_class.declarator: gson
focal_class.modifier: private final
focal_class.original_string: private final Gson gson;
focal_class.type: Gson
focal_class.var_name: gson
focal_class.file: utils/src/main/java/com/cloud/utils/rest/RESTServiceConnector.java
focal_class.identifier: RESTServiceConnector
focal_class.class_method_signature: RESTServiceConnector.RESTServiceConnector(final Builder builder)
focal_class.full_signature: private  RESTServiceConnector(final Builder builder)
focal_class.identifier: RESTServiceConnector
focal_class.modifiers: private
focal_class.parameters: (final Builder builder)
focal_class.signature:  RESTServiceConnector(final Builder builder)
focal_class.class_method_signature: RESTServiceConnector.setGsonDeserializer(final Map<Class<?>, JsonDeserializer<?>> classToDeserializerMap)
focal_class.full_signature: private static Gson setGsonDeserializer(final Map<Class<?>, JsonDeserializer<?>> classToDeserializerMap)
focal_class.identifier: setGsonDeserializer
focal_class.modifiers: private static
focal_class.parameters: (final Map<Class<?>, JsonDeserializer<?>> classToDeserializerMap)
focal_class.return: Gson
focal_class.signature: Gson setGsonDeserializer(final Map<Class<?>, JsonDeserializer<?>> classToDeserializerMap)
focal_class.class_method_signature: RESTServiceConnector.create()
focal_class.full_signature: public static Builder create()
focal_class.identifier: create
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: Builder
focal_class.signature: Builder create()
focal_class.class_method_signature: RESTServiceConnector.executeUpdateObject(final T newObject, final String path, final Map<String, String> parameters)
focal_class.full_signature: public void executeUpdateObject(final T newObject, final String path, final Map<String, String> parameters)
focal_class.identifier: executeUpdateObject
focal_class.modifiers: public
focal_class.parameters: (final T newObject, final String path, final Map<String, String> parameters)
focal_class.return: void
focal_class.signature: void executeUpdateObject(final T newObject, final String path, final Map<String, String> parameters)
focal_class.class_method_signature: RESTServiceConnector.executeUpdateObject(final T newObject, final String path)
focal_class.full_signature: public void executeUpdateObject(final T newObject, final String path)
focal_class.identifier: executeUpdateObject
focal_class.modifiers: public
focal_class.parameters: (final T newObject, final String path)
focal_class.return: void
focal_class.signature: void executeUpdateObject(final T newObject, final String path)
focal_class.class_method_signature: RESTServiceConnector.executeCreateObject(final T newObject, final String path, final Map<String, String> parameters)
focal_class.full_signature: @SuppressWarnings("unchecked") public T executeCreateObject(final T newObject, final String path, final Map<String, String> parameters)
focal_class.identifier: executeCreateObject
focal_class.modifiers: @SuppressWarnings("unchecked") public
focal_class.parameters: (final T newObject, final String path, final Map<String, String> parameters)
focal_class.return: T
focal_class.signature: T executeCreateObject(final T newObject, final String path, final Map<String, String> parameters)
focal_class.class_method_signature: RESTServiceConnector.executeCreateObject(final T newObject, final String uri)
focal_class.full_signature: public T executeCreateObject(final T newObject, final String uri)
focal_class.identifier: executeCreateObject
focal_class.modifiers: public
focal_class.parameters: (final T newObject, final String uri)
focal_class.return: T
focal_class.signature: T executeCreateObject(final T newObject, final String uri)
focal_class.class_method_signature: RESTServiceConnector.executeDeleteObject(final String path)
focal_class.full_signature: public void executeDeleteObject(final String path)
focal_class.identifier: executeDeleteObject
focal_class.modifiers: public
focal_class.parameters: (final String path)
focal_class.return: void
focal_class.signature: void executeDeleteObject(final String path)
focal_class.class_method_signature: RESTServiceConnector.executeRetrieveObject(final Type returnObjectType, final String path, final Map<String, String> parameters)
focal_class.full_signature: public T executeRetrieveObject(final Type returnObjectType, final String path, final Map<String, String> parameters)
focal_class.identifier: executeRetrieveObject
focal_class.modifiers: public
focal_class.parameters: (final Type returnObjectType, final String path, final Map<String, String> parameters)
focal_class.return: T
focal_class.signature: T executeRetrieveObject(final Type returnObjectType, final String path, final Map<String, String> parameters)
focal_class.class_method_signature: RESTServiceConnector.executeRetrieveObject(final Type returnObjectType, final String path)
focal_class.full_signature: public T executeRetrieveObject(final Type returnObjectType, final String path)
focal_class.identifier: executeRetrieveObject
focal_class.modifiers: public
focal_class.parameters: (final Type returnObjectType, final String path)
focal_class.return: T
focal_class.signature: T executeRetrieveObject(final Type returnObjectType, final String path)
focal_class.class_method_signature: RESTServiceConnector.createAndExecuteRequest(final HttpMethods method, final String path, final Map<String, String> parameters, final Optional<String> jsonPayLoad)
focal_class.full_signature: private CloseableHttpResponse createAndExecuteRequest(final HttpMethods method, final String path, final Map<String, String> parameters, final Optional<String> jsonPayLoad)
focal_class.identifier: createAndExecuteRequest
focal_class.modifiers: private
focal_class.parameters: (final HttpMethods method, final String path, final Map<String, String> parameters, final Optional<String> jsonPayLoad)
focal_class.return: CloseableHttpResponse
focal_class.signature: CloseableHttpResponse createAndExecuteRequest(final HttpMethods method, final String path, final Map<String, String> parameters, final Optional<String> jsonPayLoad)
focal_class.class_method_signature: RESTServiceConnector.executeRequest(final HttpUriRequest httpRequest)
focal_class.full_signature: private CloseableHttpResponse executeRequest(final HttpUriRequest httpRequest)
focal_class.identifier: executeRequest
focal_class.modifiers: private
focal_class.parameters: (final HttpUriRequest httpRequest)
focal_class.return: CloseableHttpResponse
focal_class.signature: CloseableHttpResponse executeRequest(final HttpUriRequest httpRequest)
focal_class.class_method_signature: RESTServiceConnector.readResponseBody(final CloseableHttpResponse response, final Type type)
focal_class.full_signature: private T readResponseBody(final CloseableHttpResponse response, final Type type)
focal_class.identifier: readResponseBody
focal_class.modifiers: private
focal_class.parameters: (final CloseableHttpResponse response, final Type type)
focal_class.return: T
focal_class.signature: T readResponseBody(final CloseableHttpResponse response, final Type type)
focal_method.body: public void executeDeleteObject(final String path) throws CloudstackRESTException {
          s_logger.debug("Executing delete object on " + path);
          client.closeResponse(createAndExecuteRequest(HttpMethods.DELETE, path, new HashMap<String, String>(), ABSENT));
      }
focal_method.class_method_signature: RESTServiceConnector.executeDeleteObject(final String path)
focal_method.full_signature: public void executeDeleteObject(final String path)
focal_method.identifier: executeDeleteObject
focal_method.invocations: debug closeResponse createAndExecuteRequest
focal_method.modifiers: public
focal_method.parameters: (final String path)
focal_method.return: void
focal_method.signature: void executeDeleteObject(final String path)