### Question:
BasicAuthConfigurer { public void configure(ConfigurerParameters parameters) { SecurityComponentsProvider securityProvider = parameters.getProvider(); String host = parameters.getHost(); String serverKey = parameters.getServerKey(); Supplier<? extends Component> parentComponent = parameters.getParentComponent(); SecurityManager securityManager = parameters.getSecurityManager(); HttpClient client = parameters.getClient(); int port = parameters.getPort(); CredentialsProvider credentialsProvider = client.getOptions().getCredentialsProvider(); credentialsProvider.setCredentials(new AuthenticationScope(host, port), securityProvider.getUserCredentials(host, serverKey, parentComponent, securityManager)); }  void configure(ConfigurerParameters parameters);  }### Answer:
@Test public void testConfigure() { EasyMockSupport support = new EasyMockSupport(); @SuppressWarnings("unchecked") Supplier<? extends Component> parentProvider = support.createMock(Supplier.class); SecurityManager securityManager = support.createMock(SecurityManager.class); Credentials creds = support.createMock(Credentials.class); SecurityComponentsProvider provider = createProvider(support, parentProvider, securityManager, creds); HttpClientOptions options = new HttpClientOptions(); HttpClient client = createClient(support, options); support.replayAll(); BasicAuthConfigurer configurer = new BasicAuthConfigurer(); ConfigurerParameters parameters = new ConfigurerParameters(); parameters.setProvider(provider); parameters.setClient(client); parameters.setHost(ourServerName); parameters.setPort(ourPort); parameters.setServerKey(ourServerKey); parameters.setParentComponent(parentProvider); parameters.setSecurityManager(securityManager); configurer.configure(parameters); CredentialsProvider credsProvider = options.getCredentialsProvider(); Credentials credentials = credsProvider.getCredentials(new AuthenticationScope(ourServerName, ourPort)); assertEquals(creds, credentials); support.verifyAll(); }