@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()); }
@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 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 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); }
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); }
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);  }