@Test
public void test_createUpdatedConfigurationItemValues_whenThereAreConfigurationItems() throws Exception {

    when(dbConnection.prepareStatement(BareMetalRemovalUpdater.SELECT_CONFIGURATION_ITEMS)).thenReturn(preparedStatement);
    when(preparedStatement.executeQuery()).thenReturn(values);
    when(values.next())
            .thenReturn(true)
            .thenReturn(true)
            .thenReturn(false);
    when(values.getString(BareMetalRemovalUpdater.VALUE))
            .thenReturn("BAREMETAL,hypervisor_a")
            .thenReturn("hypervisor_b,baremetal");
    when(values.getString(BareMetalRemovalUpdater.CATEGORY))
            .thenReturn("someCategory")
            .thenReturn("anotherCategory");
    when(values.getString(BareMetalRemovalUpdater.INSTANCE))
            .thenReturn("someInstance")
            .thenReturn("anotherInstance");
    when(values.getString(BareMetalRemovalUpdater.COMPONENT))
            .thenReturn("someComponent")
            .thenReturn("anotherComponent");
    when(values.getString(BareMetalRemovalUpdater.NAME))
            .thenReturn("someName")
            .thenReturn("anotherName");
    final List<Map<String, String>> updatedRows = bareMetalRemovalUpdater.createUpdatedConfigurationItemValues(dbConnection);
    assertThat(updatedRows, hasSize(2));
}