### Question:
WebLoginConfigBuilderStrategy implements AdapterConfigurationStrategy { @Override @SuppressWarnings({ "rawtypes", "unchecked" }) public <B extends AbstractAdapterConfigBuilder<B, C>, C extends AdapterConfig> void configure(B configBuilder) { if (configBuilder instanceof AbstractWebScanAdapterConfigBuilder) { AbstractWebScanAdapterConfigBuilder webConfigBuilder = (AbstractWebScanAdapterConfigBuilder) configBuilder; coinfigureImpl(webConfigBuilder); } else { throw new IllegalArgumentException("Wrong usage in code: Only accetable for web scan adapters!"); } } WebLoginConfigBuilderStrategy(SecHubExecutionContext context); @Override @SuppressWarnings({ "rawtypes", "unchecked" }) void configure(B configBuilder);  }### Answer:
@Test public void basic_login_data_transfered() throws Exception{ WebLoginConfigBuilderStrategy strategyToTest = createStrategy("sechub_config/webscan_login_basic.json"); TestAbstractWebScanAdapterConfigBuilder configBuilder = new TestAbstractWebScanAdapterConfigBuilder(); strategyToTest.configure(configBuilder); TestWebScanAdapterConfig result = configBuilder.build(); LoginConfig loginConfig = result.getLoginConfig(); assertTrue(loginConfig.isBasic()); assertEquals("user0", loginConfig.asBasic().getUser()); assertEquals("pwd0", loginConfig.asBasic().getPassword()); assertEquals("realm0", loginConfig.asBasic().getRealm()); assertEquals(new URL("https: }
@Test public void form_autodetect_login_data_transfered() { WebLoginConfigBuilderStrategy strategyToTest = createStrategy("sechub_config/webscan_login_form_autodetect.json"); TestAbstractWebScanAdapterConfigBuilder configBuilder = new TestAbstractWebScanAdapterConfigBuilder(); strategyToTest.configure(configBuilder); TestWebScanAdapterConfig result = configBuilder.build(); LoginConfig loginConfig = result.getLoginConfig(); assertTrue(loginConfig.isFormAutoDetect()); assertEquals("user1", loginConfig.asFormAutoDetect().getUser()); assertEquals("pwd1", loginConfig.asFormAutoDetect().getPassword()); }
@Test public void form_script_login_data_transfered() { WebLoginConfigBuilderStrategy strategyToTest = createStrategy("sechub_config/webscan_login_form_script.json"); TestAbstractWebScanAdapterConfigBuilder configBuilder = new TestAbstractWebScanAdapterConfigBuilder(); strategyToTest.configure(configBuilder); TestWebScanAdapterConfig result = configBuilder.build(); LoginConfig loginConfig = result.getLoginConfig(); assertTrue(loginConfig.isFormScript()); List<LoginScriptStep> steps = loginConfig.asFormScript().getSteps(); assertEquals(3,steps.size()); Iterator<LoginScriptStep> it = steps.iterator(); LoginScriptStep step = it.next(); assertEquals("input",step.getType()); assertEquals("#example_login_userid",step.getSelector()); assertEquals("user2", step.getValue()); step = it.next(); assertEquals("input",step.getType()); assertEquals("#example_login_pwd",step.getSelector()); assertEquals("pwd2", step.getValue()); step = it.next(); assertEquals("click",step.getType()); assertEquals("#example_login_login_button",step.getSelector()); assertEquals(null, step.getValue()); }