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