### Question:
XPackAuth implements Auth<Settings.Builder> { @Override public void configure(Settings.Builder settings) { credentials.applyTo(settings); certInfo.applyTo(settings); } protected  XPackAuth(Credentials<Settings.Builder> credentials, CertInfo<Settings.Builder> certInfo); @Override void configure(Settings.Builder settings); @PluginBuilderFactory static XPackAuth.Builder newBuilder();  }### Answer:
@Test public void appliesCredentialsIfConfigured() { Credentials<Settings.Builder> credentials = Mockito.mock(Credentials.class); Settings.Builder settingsBuilder = Settings.builder(); XPackAuth xPackAuth = createTestBuilder() .withCredentials(credentials) .build(); xPackAuth.configure(settingsBuilder); Mockito.verify(credentials).applyTo(builderArgumentCaptor.capture()); Assert.assertEquals(settingsBuilder, builderArgumentCaptor.getValue()); }
@Test public void appliesCertInfoIfConfigured() { CertInfo<Settings.Builder> certInfo = Mockito.mock(CertInfo.class); Settings.Builder settingsBuilder = Settings.builder(); XPackAuth xPackAuth = createTestBuilder() .withCertInfo(certInfo) .build(); xPackAuth.configure(settingsBuilder); Mockito.verify(certInfo).applyTo(builderArgumentCaptor.capture()); Assert.assertEquals(settingsBuilder, builderArgumentCaptor.getValue()); }