@Test public void webscan_login_basic_json_has_webconfig_as_expected() throws Exception { String json = SharedKernelTestFileSupport.getTestfileSupport().loadTestFile("webscan/webscan_login_basic.json"); SecHubConfiguration result = SECHUB_CONFIG.fromJSON(json); Optional<SecHubWebScanConfiguration> webScanOption = result.getWebScan(); assertTrue("webscan config must be present", webScanOption.isPresent()); SecHubWebScanConfiguration secHubWebScanConfiguration = webScanOption.get(); Optional<WebLoginConfiguration> loginOption = secHubWebScanConfiguration.getLogin(); assertTrue("login config must be present", loginOption.isPresent()); WebLoginConfiguration loginConfiguration = loginOption.get(); assertEquals(new URL("https: Optional<BasicLoginConfiguration> basic = loginConfiguration.getBasic(); assertTrue("basic login config must be present", basic.isPresent()); assertEquals("realm0", basic.get().getRealm().get()); assertEquals("user0", new String(basic.get().getUser())); assertEquals("pwd0", new String(basic.get().getPassword())); Optional<FormLoginConfiguration> form = loginConfiguration.getForm(); assertFalse("form login config must NOT be present", form.isPresent()); }
public Optional<SecHubWebScanConfiguration> getWebScan() { return webScan; }
SecHubConfiguration implements JSONable<SecHubConfiguration> { public Optional<SecHubWebScanConfiguration> getWebScan() { return webScan; } }
SecHubConfiguration implements JSONable<SecHubConfiguration> { public Optional<SecHubWebScanConfiguration> getWebScan() { return webScan; }  }
SecHubConfiguration implements JSONable<SecHubConfiguration> { public Optional<SecHubWebScanConfiguration> getWebScan() { return webScan; }  static SecHubConfiguration createFromJSON(String json); void setProjectId(String projectId); String getProjectId(); void setApiVersion(String apiVersion); String getApiVersion(); void setWebScan(SecHubWebScanConfiguration webScan); Optional<SecHubWebScanConfiguration> getWebScan(); void setCodeScan(SecHubCodeScanConfiguration codeScan); Optional<SecHubCodeScanConfiguration> getCodeScan(); void setInfraScan(SecHubInfrastructureScanConfiguration infraStructureScan); Optional<SecHubInfrastructureScanConfiguration> getInfraScan(); @Override Class<SecHubConfiguration> getJSONTargetClass(); }
SecHubConfiguration implements JSONable<SecHubConfiguration> { public Optional<SecHubWebScanConfiguration> getWebScan() { return webScan; }  static SecHubConfiguration createFromJSON(String json); void setProjectId(String projectId); String getProjectId(); void setApiVersion(String apiVersion); String getApiVersion(); void setWebScan(SecHubWebScanConfiguration webScan); Optional<SecHubWebScanConfiguration> getWebScan(); void setCodeScan(SecHubCodeScanConfiguration codeScan); Optional<SecHubCodeScanConfiguration> getCodeScan(); void setInfraScan(SecHubInfrastructureScanConfiguration infraStructureScan); Optional<SecHubInfrastructureScanConfiguration> getInfraScan(); @Override Class<SecHubConfiguration> getJSONTargetClass(); static final String PROPERTY_PROJECT_ID; static final String PROPERTY_API_VERSION; static final String PROPERTY_WEB_SCAN; static final String PROPERTY_INFRA_SCAN; static final String PROPERTY_CODE_SCAN; }