@Test public void isAbleTo_extract_id_from_netsparker_v1_0_40_109_result_when_create_new_scan_triggered() throws AdapterException { String body = NetsparkerAdapterTestFileSupport.getTestfileSupport().loadTestFile("netsparker_v1.0.40.109_new_scan_output.json"); String id = adapterToTest.extractIDFromScanResult(body, context); assertEquals("a42ab3cf-58e8-455e-6668-a88503af65fe", id); }
String extractIDFromScanResult(String body, NetsparkerAdapterContext context) throws AdapterException { return context.json().fetchRootNode(body).fetchArrayElement(0).fetch(PROPERTY_SCAN_ID).asText(); }
NetsparkerAdapterV1 extends AbstractAdapter<NetsparkerAdapterContext, NetsparkerAdapterConfig> implements NetsparkerAdapter { String extractIDFromScanResult(String body, NetsparkerAdapterContext context) throws AdapterException { return context.json().fetchRootNode(body).fetchArrayElement(0).fetch(PROPERTY_SCAN_ID).asText(); } }
NetsparkerAdapterV1 extends AbstractAdapter<NetsparkerAdapterContext, NetsparkerAdapterConfig> implements NetsparkerAdapter { String extractIDFromScanResult(String body, NetsparkerAdapterContext context) throws AdapterException { return context.json().fetchRootNode(body).fetchArrayElement(0).fetch(PROPERTY_SCAN_ID).asText(); }  }
NetsparkerAdapterV1 extends AbstractAdapter<NetsparkerAdapterContext, NetsparkerAdapterConfig> implements NetsparkerAdapter { String extractIDFromScanResult(String body, NetsparkerAdapterContext context) throws AdapterException { return context.json().fetchRootNode(body).fetchArrayElement(0).fetch(PROPERTY_SCAN_ID).asText(); }  @Override String execute(NetsparkerAdapterConfig config, AdapterRuntimeContext runtimeContext); @Override int getAdapterVersion(); }
NetsparkerAdapterV1 extends AbstractAdapter<NetsparkerAdapterContext, NetsparkerAdapterConfig> implements NetsparkerAdapter { String extractIDFromScanResult(String body, NetsparkerAdapterContext context) throws AdapterException { return context.json().fetchRootNode(body).fetchArrayElement(0).fetch(PROPERTY_SCAN_ID).asText(); }  @Override String execute(NetsparkerAdapterConfig config, AdapterRuntimeContext runtimeContext); @Override int getAdapterVersion();  }