use of com.endava.cats.model.FuzzingStrategy in project cats by Endava.
the class WithinControlCharsInFieldsValidateSanitizeFuzzerTest method shouldProperlyOverrideSuperClassMethods.
@Test
void shouldProperlyOverrideSuperClassMethods() {
FuzzingData data = Mockito.mock(FuzzingData.class);
Map<String, Schema> reqTypes = new HashMap<>();
reqTypes.put("field", new StringSchema());
Mockito.when(data.getRequestPropertyTypes()).thenReturn(reqTypes);
FuzzingStrategy fuzzingStrategy = controlCharsWithinFieldsValidateSanitizeFuzzer.getFieldFuzzingStrategy(data, "field").get(1);
Assertions.assertThat(fuzzingStrategy.getData()).contains("\u0007");
Assertions.assertThat(controlCharsWithinFieldsValidateSanitizeFuzzer.getExpectedHttpCodeWhenFuzzedValueNotMatchesPattern()).isEqualTo(ResponseCodeFamily.FOURXX);
Assertions.assertThat(controlCharsWithinFieldsValidateSanitizeFuzzer.getExpectedHttpCodeWhenOptionalFieldsAreFuzzed()).isEqualTo(ResponseCodeFamily.FOURXX);
Assertions.assertThat(controlCharsWithinFieldsValidateSanitizeFuzzer.getExpectedHttpCodeWhenRequiredFieldsAreFuzzed()).isEqualTo(ResponseCodeFamily.FOURXX);
Assertions.assertThat(controlCharsWithinFieldsValidateSanitizeFuzzer.description()).isNotNull();
Assertions.assertThat(controlCharsWithinFieldsValidateSanitizeFuzzer.typeOfDataSentToTheService()).isNotNull();
Assertions.assertThat(controlCharsWithinFieldsValidateSanitizeFuzzer.concreteFuzzStrategy().name()).isEqualTo(FuzzingStrategy.replace().name());
}
use of com.endava.cats.model.FuzzingStrategy in project cats by Endava.
the class WithinMultiCodePointEmojisInFieldsTrimValidateFuzzerTest method shouldProperlyOverrideSuperClassMethods.
@Test
void shouldProperlyOverrideSuperClassMethods() {
FuzzingData data = Mockito.mock(FuzzingData.class);
Map<String, Schema> reqTypes = new HashMap<>();
reqTypes.put("field", new StringSchema());
Mockito.when(data.getRequestPropertyTypes()).thenReturn(reqTypes);
FuzzingStrategy fuzzingStrategy = withinMultiCodePointEmojisInFieldsTrimValidateFuzzer.getFieldFuzzingStrategy(data, "field").get(1);
Assertions.assertThat(fuzzingStrategy.name()).isEqualTo(FuzzingStrategy.replace().name());
Assertions.assertThat(fuzzingStrategy.getData()).contains("\uD83D\uDC68\u200D\uD83C\uDFED️");
Assertions.assertThat(withinMultiCodePointEmojisInFieldsTrimValidateFuzzer.getExpectedHttpCodeWhenFuzzedValueNotMatchesPattern()).isEqualTo(ResponseCodeFamily.TWOXX);
Assertions.assertThat(withinMultiCodePointEmojisInFieldsTrimValidateFuzzer.description()).isNotNull();
Assertions.assertThat(withinMultiCodePointEmojisInFieldsTrimValidateFuzzer.concreteFuzzStrategy().name()).isEqualTo(FuzzingStrategy.replace().name());
Assertions.assertThat(withinMultiCodePointEmojisInFieldsTrimValidateFuzzer.typeOfDataSentToTheService()).isNotNull();
}
use of com.endava.cats.model.FuzzingStrategy in project cats by Endava.
the class WithinSingleCodePointEmojisInFieldsTrimValidateFuzzerTest method shouldProperlyOverrideSuperClassMethods.
@Test
void shouldProperlyOverrideSuperClassMethods() {
FuzzingData data = Mockito.mock(FuzzingData.class);
Map<String, Schema> reqTypes = new HashMap<>();
reqTypes.put("field", new StringSchema());
Mockito.when(data.getRequestPropertyTypes()).thenReturn(reqTypes);
FuzzingStrategy fuzzingStrategy = withinSingleCodePointEmojisInFieldsTrimValidateFuzzer.getFieldFuzzingStrategy(data, "field").get(1);
Assertions.assertThat(fuzzingStrategy.name()).isEqualTo(FuzzingStrategy.replace().name());
Assertions.assertThat(fuzzingStrategy.getData()).contains("\uD83D\uDC80");
Assertions.assertThat(withinSingleCodePointEmojisInFieldsTrimValidateFuzzer.getExpectedHttpCodeWhenFuzzedValueNotMatchesPattern()).isEqualTo(ResponseCodeFamily.TWOXX);
Assertions.assertThat(withinSingleCodePointEmojisInFieldsTrimValidateFuzzer.description()).isNotNull();
Assertions.assertThat(withinSingleCodePointEmojisInFieldsTrimValidateFuzzer.concreteFuzzStrategy().name()).isEqualTo(FuzzingStrategy.replace().name());
Assertions.assertThat(withinSingleCodePointEmojisInFieldsTrimValidateFuzzer.typeOfDataSentToTheService()).isNotNull();
}
use of com.endava.cats.model.FuzzingStrategy in project cats by Endava.
the class TrailingMultiCodePointEmojisInFieldsTrimValidateFuzzerTest method shouldProperlyOverrideMethods.
@Test
void shouldProperlyOverrideMethods() {
FuzzingStrategy fuzzingStrategy = trailingMultiCodePointEmojisInFieldsTrimValidateFuzzer.getFieldFuzzingStrategy(null, null).get(1);
Assertions.assertThat(fuzzingStrategy.name()).isEqualTo(FuzzingStrategy.trail().name());
Assertions.assertThat(fuzzingStrategy.getData()).isEqualTo("\uD83D\uDC68\u200D\uD83C\uDFED️");
Assertions.assertThat(trailingMultiCodePointEmojisInFieldsTrimValidateFuzzer.getExpectedHttpCodeWhenFuzzedValueNotMatchesPattern()).isEqualTo(ResponseCodeFamily.TWOXX);
Assertions.assertThat(trailingMultiCodePointEmojisInFieldsTrimValidateFuzzer.description()).isNotNull();
Assertions.assertThat(trailingMultiCodePointEmojisInFieldsTrimValidateFuzzer.typeOfDataSentToTheService()).isNotNull();
}
use of com.endava.cats.model.FuzzingStrategy in project cats by Endava.
the class TrailingSingleCodePointEmojisInFieldsValidateTrimFuzzerTest method givenANewTrailingTabsInFieldsValidateTrimFuzzer_whenCreatingANewInstance_thenTheMethodsBeingOverriddenAreMatchingTheTrailingTabsInFieldsValidateTrimFuzzer.
@Test
void givenANewTrailingTabsInFieldsValidateTrimFuzzer_whenCreatingANewInstance_thenTheMethodsBeingOverriddenAreMatchingTheTrailingTabsInFieldsValidateTrimFuzzer() {
FuzzingStrategy fuzzingStrategy = trailingSingleCodePointEmojisInFieldsValidateTrimFuzzer.getFieldFuzzingStrategy(null, null).get(1);
Assertions.assertThat(fuzzingStrategy.name()).isEqualTo(FuzzingStrategy.trail().name());
Assertions.assertThat(fuzzingStrategy.getData()).isEqualTo("\uD83D\uDC80");
Assertions.assertThat(trailingSingleCodePointEmojisInFieldsValidateTrimFuzzer.getExpectedHttpCodeWhenFuzzedValueNotMatchesPattern()).isEqualTo(ResponseCodeFamily.FOURXX);
Assertions.assertThat(trailingSingleCodePointEmojisInFieldsValidateTrimFuzzer.getExpectedHttpCodeWhenOptionalFieldsAreFuzzed()).isEqualTo(ResponseCodeFamily.FOURXX);
Assertions.assertThat(trailingSingleCodePointEmojisInFieldsValidateTrimFuzzer.getExpectedHttpCodeWhenRequiredFieldsAreFuzzed()).isEqualTo(ResponseCodeFamily.FOURXX);
Assertions.assertThat(trailingSingleCodePointEmojisInFieldsValidateTrimFuzzer.description()).isNotNull();
Assertions.assertThat(trailingSingleCodePointEmojisInFieldsValidateTrimFuzzer.typeOfDataSentToTheService()).isNotNull();
}
Aggregations