private ConfigWriterData setupConfigWriter(KerberosConfigDataFileWriterFactory factory) throws IOException {
    Capture<String> captureConfigType = newCapture(CaptureType.ALL);
    Capture<String> capturePropertyName = newCapture(CaptureType.ALL);
    Capture<String> capturePropertyValue = newCapture(CaptureType.ALL);

    KerberosConfigDataFileWriter mockWriter = createMock(KerberosConfigDataFileWriter.class);
    mockWriter.addRecord(capture(captureConfigType), capture(capturePropertyName), capture(capturePropertyValue), eq(KerberosConfigDataFileWriter.OPERATION_TYPE_SET));
    expectLastCall().anyTimes();
    mockWriter.close();
    expectLastCall().anyTimes();

    expect(factory.createKerberosConfigDataFileWriter(anyObject(File.class))).andReturn(mockWriter).once();

    return new ConfigWriterData(captureConfigType, capturePropertyName, capturePropertyValue);
  }
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