use of org.parosproxy.paros.core.scanner.ScannerParam in project zaproxy by zaproxy.
the class VariantFactoryUnitTest method shouldScanNullJsonValuesAsDefinedInOptions.
@ParameterizedTest
@ValueSource(booleans = { true, false })
void shouldScanNullJsonValuesAsDefinedInOptions(boolean scanNulls) {
// Given
ScannerParam scanOptions = mock(ScannerParam.class);
given(scanOptions.getTargetParamsInjectable()).willReturn(ScannerParam.TARGET_POSTDATA);
given(scanOptions.getTargetParamsEnabledRPC()).willReturn(ScannerParam.RPC_JSON);
given(scanOptions.isScanNullJsonValues()).willReturn(scanNulls);
HttpMessage message = new HttpMessage();
// When
List<Variant> variants = factory.createVariants(scanOptions, message);
// Then
VariantJSONQuery jsonVariant = getVariant(variants, VariantJSONQuery.class);
assertThat(jsonVariant.isScanNullValues(), is(equalTo(scanNulls)));
}
Aggregations