test_class.declarator: bareMetalRemovalUpdater = new BareMetalRemovalUpdater()
test_class.modifier: private final
test_class.original_string: private final BareMetalRemovalUpdater bareMetalRemovalUpdater = new BareMetalRemovalUpdater();
test_class.type: BareMetalRemovalUpdater
test_class.var_name: bareMetalRemovalUpdater
test_class.declarator: values
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private ResultSet values;
test_class.type: ResultSet
test_class.var_name: values
test_class.declarator: dbConnection
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private Connection dbConnection;
test_class.type: Connection
test_class.var_name: dbConnection
test_class.declarator: preparedStatement
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private PreparedStatement preparedStatement;
test_class.type: PreparedStatement
test_class.var_name: preparedStatement
test_class.file: engine/schema/src/test/java/com/cloud/upgrade/dao/BareMetalRemovalUpdaterTest.java
test_class.identifier: BareMetalRemovalUpdaterTest
test_case.body: @Test
      public void test_updateConfigurationItems_whenThereAreTwoUpdates() throws Exception {
          when(dbConnection.prepareStatement(BareMetalRemovalUpdater.UPDATE_CONFIGURATION_ITEM)).thenReturn(preparedStatement);
          final List<Map<String, String>> updatedRows = new ArrayList<>();
          final HashMap<String, String> updatedRow1 = new HashMap<>();
          updatedRow1.put(BareMetalRemovalUpdater.VALUE, "hypervisor_a");
          updatedRow1.put(BareMetalRemovalUpdater.CATEGORY, "someCategory");
          updatedRow1.put(BareMetalRemovalUpdater.INSTANCE, "someInstance");
          updatedRow1.put(BareMetalRemovalUpdater.COMPONENT, "someComponent");
          updatedRow1.put(BareMetalRemovalUpdater.NAME, "someName");
          final HashMap<String, String> updatedRow2 = new HashMap<>();
          updatedRow1.put(BareMetalRemovalUpdater.VALUE, "hypervisor_b");
          updatedRow1.put(BareMetalRemovalUpdater.CATEGORY, "anotherCategory");
          updatedRow1.put(BareMetalRemovalUpdater.INSTANCE, "anotherInstance");
          updatedRow1.put(BareMetalRemovalUpdater.COMPONENT, "anotherCmponent");
          updatedRow1.put(BareMetalRemovalUpdater.NAME, "anotherName");
          updatedRows.add(updatedRow1);
          updatedRows.add(updatedRow2);
  
          bareMetalRemovalUpdater.updateConfigurationItems(dbConnection, updatedRows);
  
          verify(preparedStatement, times(10)).setString(anyInt(), anyString());
          verify(preparedStatement, times(2)).executeUpdate();
      }
test_case.class_method_signature: BareMetalRemovalUpdaterTest.test_updateConfigurationItems_whenThereAreTwoUpdates()
test_case.full_signature: @Test public void test_updateConfigurationItems_whenThereAreTwoUpdates()
test_case.identifier: test_updateConfigurationItems_whenThereAreTwoUpdates
test_case.invocations: thenReturn when prepareStatement put put put put put put put put put put add add updateConfigurationItems setString verify times anyInt anyString executeUpdate verify times
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void test_updateConfigurationItems_whenThereAreTwoUpdates()
focal_class.declarator: logger = Logger.getLogger(BareMetalRemovalUpdater.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger logger = Logger.getLogger(BareMetalRemovalUpdater.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: BARE_METAL = "baremetal"
focal_class.modifier: private static final
focal_class.original_string: private static final String BARE_METAL = "baremetal";
focal_class.type: String
focal_class.var_name: BARE_METAL
focal_class.declarator: VALUE_SEPARATOR = ","
focal_class.modifier: private static final
focal_class.original_string: private static final String VALUE_SEPARATOR = ",";
focal_class.type: String
focal_class.var_name: VALUE_SEPARATOR
focal_class.declarator: HYPERVISOR_LIST = "hypervisor.list"
focal_class.modifier: private static final
focal_class.original_string: private static final String HYPERVISOR_LIST = "hypervisor.list";
focal_class.type: String
focal_class.var_name: HYPERVISOR_LIST
focal_class.declarator: VALUE = "value"
focal_class.modifier: public static final
focal_class.original_string: public static final String VALUE = "value";
focal_class.type: String
focal_class.var_name: VALUE
focal_class.declarator: CATEGORY = "category"
focal_class.modifier: public static final
focal_class.original_string: public static final String CATEGORY = "category";
focal_class.type: String
focal_class.var_name: CATEGORY
focal_class.declarator: INSTANCE = "instance"
focal_class.modifier: public static final
focal_class.original_string: public static final String INSTANCE = "instance";
focal_class.type: String
focal_class.var_name: INSTANCE
focal_class.declarator: COMPONENT = "component"
focal_class.modifier: public static final
focal_class.original_string: public static final String COMPONENT = "component";
focal_class.type: String
focal_class.var_name: COMPONENT
focal_class.declarator: NAME = "name"
focal_class.modifier: public static final
focal_class.original_string: public static final String NAME = "name";
focal_class.type: String
focal_class.var_name: NAME
focal_class.declarator: SELECT_CONFIGURATION_ITEMS = "SELECT category, instance, component, name, value FROM configuration WHERE name = ?"
focal_class.modifier: public static final
focal_class.original_string: public static final String SELECT_CONFIGURATION_ITEMS = "SELECT category, instance, component, name, value FROM configuration WHERE name = ?";
focal_class.type: String
focal_class.var_name: SELECT_CONFIGURATION_ITEMS
focal_class.declarator: UPDATE_CONFIGURATION_ITEM = "UPDATE configuration SET value = ? WHERE category = ? AND instance = ? AND component = ? AND name = ?"
focal_class.modifier: public static final
focal_class.original_string: public static final String UPDATE_CONFIGURATION_ITEM = "UPDATE configuration SET value = ? WHERE category = ? AND instance = ? AND component = ? AND name = ?";
focal_class.type: String
focal_class.var_name: UPDATE_CONFIGURATION_ITEM
focal_class.file: engine/schema/src/main/java/com/cloud/upgrade/dao/BareMetalRemovalUpdater.java
focal_class.identifier: BareMetalRemovalUpdater
focal_class.class_method_signature: BareMetalRemovalUpdater.updateConfigurationValuesThatReferenceBareMetal(final Connection conn)
focal_class.full_signature: public void updateConfigurationValuesThatReferenceBareMetal(final Connection conn)
focal_class.identifier: updateConfigurationValuesThatReferenceBareMetal
focal_class.modifiers: public
focal_class.parameters: (final Connection conn)
focal_class.return: void
focal_class.signature: void updateConfigurationValuesThatReferenceBareMetal(final Connection conn)
focal_class.class_method_signature: BareMetalRemovalUpdater.createUpdatedConfigurationItemValues(final Connection conn)
focal_class.full_signature: public List<Map<String, String>> createUpdatedConfigurationItemValues(final Connection conn)
focal_class.identifier: createUpdatedConfigurationItemValues
focal_class.modifiers: public
focal_class.parameters: (final Connection conn)
focal_class.return: List<Map<String, String>>
focal_class.signature: List<Map<String, String>> createUpdatedConfigurationItemValues(final Connection conn)
focal_class.class_method_signature: BareMetalRemovalUpdater.updateConfigurationItems(final Connection conn, final List<Map<String, String>> updatedRows)
focal_class.full_signature: public void updateConfigurationItems(final Connection conn, final List<Map<String, String>> updatedRows)
focal_class.identifier: updateConfigurationItems
focal_class.modifiers: public
focal_class.parameters: (final Connection conn, final List<Map<String, String>> updatedRows)
focal_class.return: void
focal_class.signature: void updateConfigurationItems(final Connection conn, final List<Map<String, String>> updatedRows)
focal_class.class_method_signature: BareMetalRemovalUpdater.updateConfigurationItem(final Connection conn, final String category, final String instance, final String component, final String name, final String value)
focal_class.full_signature: public void updateConfigurationItem(final Connection conn, final String category, final String instance, final String component, final String name, final String value)
focal_class.identifier: updateConfigurationItem
focal_class.modifiers: public
focal_class.parameters: (final Connection conn, final String category, final String instance, final String component, final String name, final String value)
focal_class.return: void
focal_class.signature: void updateConfigurationItem(final Connection conn, final String category, final String instance, final String component, final String name, final String value)
focal_class.class_method_signature: BareMetalRemovalUpdater.findAndUpdateRowsThatReferenceBareMetal(final ResultSet values, final List<Map<String, String>> updatedRows)
focal_class.full_signature: public void findAndUpdateRowsThatReferenceBareMetal(final ResultSet values, final List<Map<String, String>> updatedRows)
focal_class.identifier: findAndUpdateRowsThatReferenceBareMetal
focal_class.modifiers: public
focal_class.parameters: (final ResultSet values, final List<Map<String, String>> updatedRows)
focal_class.return: void
focal_class.signature: void findAndUpdateRowsThatReferenceBareMetal(final ResultSet values, final List<Map<String, String>> updatedRows)
focal_class.class_method_signature: BareMetalRemovalUpdater.createUpdatedValue(final String value)
focal_class.full_signature: public String createUpdatedValue(final String value)
focal_class.identifier: createUpdatedValue
focal_class.modifiers: public
focal_class.parameters: (final String value)
focal_class.return: String
focal_class.signature: String createUpdatedValue(final String value)
focal_class.class_method_signature: BareMetalRemovalUpdater.hasReferenceToBareMetal(final String value)
focal_class.full_signature: public boolean hasReferenceToBareMetal(final String value)
focal_class.identifier: hasReferenceToBareMetal
focal_class.modifiers: public
focal_class.parameters: (final String value)
focal_class.return: boolean
focal_class.signature: boolean hasReferenceToBareMetal(final String value)
focal_class.class_method_signature: BareMetalRemovalUpdater.createUpdatedRow(final String category, final String instance, final String component, final String name, final String filteredValue)
focal_class.full_signature: private HashMap<String, String> createUpdatedRow(final String category, final String instance, final String component, final String name, final String filteredValue)
focal_class.identifier: createUpdatedRow
focal_class.modifiers: private
focal_class.parameters: (final String category, final String instance, final String component, final String name, final String filteredValue)
focal_class.return: HashMap<String, String>
focal_class.signature: HashMap<String, String> createUpdatedRow(final String category, final String instance, final String component, final String name, final String filteredValue)
focal_class.class_method_signature: BareMetalRemovalUpdater.printConfigurationItem(final String category, final String instance, final String component, final String name, final String value)
focal_class.full_signature: private String printConfigurationItem(final String category, final String instance, final String component, final String name, final String value)
focal_class.identifier: printConfigurationItem
focal_class.modifiers: private
focal_class.parameters: (final String category, final String instance, final String component, final String name, final String value)
focal_class.return: String
focal_class.signature: String printConfigurationItem(final String category, final String instance, final String component, final String name, final String value)
focal_method.body: public void updateConfigurationItems(final Connection conn, final List<Map<String, String>> updatedRows) {
          for (final Map<String, String> row : updatedRows) {
              final String category = row.get(CATEGORY);
              final String instance = row.get(INSTANCE);
              final String component = row.get(COMPONENT);
              final String name = row.get(NAME);
              final String value = row.get(VALUE);
              logger.info("Updating configuration item: " + printConfigurationItem(category, instance, component, name, value));
              updateConfigurationItem(conn, category, instance, component, name, value);
          }
      }
focal_method.class_method_signature: BareMetalRemovalUpdater.updateConfigurationItems(final Connection conn, final List<Map<String, String>> updatedRows)
focal_method.full_signature: public void updateConfigurationItems(final Connection conn, final List<Map<String, String>> updatedRows)
focal_method.identifier: updateConfigurationItems
focal_method.invocations: get get get get get info printConfigurationItem updateConfigurationItem
focal_method.modifiers: public
focal_method.parameters: (final Connection conn, final List<Map<String, String>> updatedRows)
focal_method.return: void
focal_method.signature: void updateConfigurationItems(final Connection conn, final List<Map<String, String>> updatedRows)