private void verifyDataCapture(ConfigWriterData configWriterData, Map<String, Map<String, String>> expectedConfigurations) {

    int expectedCaptures = 0;
    Collection<Map<String, String>> expectedValuesCollection = expectedConfigurations.values();
    for (Map<String, String> expectedValues : expectedValuesCollection) {
      expectedCaptures += expectedValues.size();
    }

    Capture<String> captureConfigType = configWriterData.getCaptureConfigType();
    if (expectedCaptures > 0) {
      Assert.assertTrue(captureConfigType.hasCaptured());
      List<String> valuesConfigType = captureConfigType.getValues();
      Assert.assertEquals(expectedCaptures, valuesConfigType.size());
    } else {
      Assert.assertFalse(captureConfigType.hasCaptured());
    }

    Capture<String> capturePropertyName = configWriterData.getCapturePropertyName();
    if (expectedCaptures > 0) {
      Assert.assertTrue(capturePropertyName.hasCaptured());
      List<String> valuesPropertyName = capturePropertyName.getValues();
      Assert.assertEquals(expectedCaptures, valuesPropertyName.size());
    } else {
      Assert.assertFalse(capturePropertyName.hasCaptured());
    }

    Capture<String> capturePropertyValue = configWriterData.getCapturePropertyValue();
    if (expectedCaptures > 0) {
      Assert.assertTrue(capturePropertyValue.hasCaptured());
      List<String> valuesPropertyValue = capturePropertyValue.getValues();
      Assert.assertEquals(expectedCaptures, valuesPropertyValue.size());
    } else {
      Assert.assertFalse(capturePropertyValue.hasCaptured());
    }

    if (expectedCaptures > 0) {
      int i = 0;
      List<String> valuesConfigType = captureConfigType.getValues();
      List<String> valuesPropertyName = capturePropertyName.getValues();
      List<String> valuesPropertyValue = capturePropertyValue.getValues();

      for (Map.Entry<String, Map<String, String>> entry : expectedConfigurations.entrySet()) {
        String configType = entry.getKey();
        Map<String, String> properties = entry.getValue();

        for(Map.Entry<String, String> property:properties.entrySet()) {
          Assert.assertEquals(configType, valuesConfigType.get(i));
          Assert.assertEquals(property.getKey(), valuesPropertyName.get(i));
          Assert.assertEquals(property.getValue(), valuesPropertyValue.get(i));
          i++;
        }
      }
    }

  }
Test checks that {@code KerberosHelper.applyStackAdvisorUpdates} would be called with
full list of the services and not only list of services with KerberosDescriptior.
In this test HDFS service will have KerberosDescriptor, while Zookeeper not.

@throws Exception
ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/AbstractPrepareKerberosServerActionTest.java