Search in sources :

Example 26 with FuzzingStrategy

use of com.endava.cats.model.FuzzingStrategy in project cats by Endava.

the class TrailingControlCharsInFieldsValidateTrimFuzzerTest method givenANewTrailingTabsInFieldsValidateTrimFuzzer_whenCreatingANewInstance_thenTheMethodsBeingOverriddenAreMatchingTheTrailingTabsInFieldsValidateTrimFuzzer.

@Test
void givenANewTrailingTabsInFieldsValidateTrimFuzzer_whenCreatingANewInstance_thenTheMethodsBeingOverriddenAreMatchingTheTrailingTabsInFieldsValidateTrimFuzzer() {
    FuzzingStrategy fuzzingStrategy = trailingControlCharsInFieldsValidateTrimFuzzer.getFieldFuzzingStrategy(null, null).get(1);
    Assertions.assertThat(fuzzingStrategy.name()).isEqualTo(FuzzingStrategy.trail().name());
    Assertions.assertThat(fuzzingStrategy.getData()).isEqualTo("\u0007");
    Assertions.assertThat(trailingControlCharsInFieldsValidateTrimFuzzer.getExpectedHttpCodeWhenFuzzedValueNotMatchesPattern()).isEqualTo(ResponseCodeFamily.FOURXX);
    Assertions.assertThat(trailingControlCharsInFieldsValidateTrimFuzzer.getExpectedHttpCodeWhenOptionalFieldsAreFuzzed()).isEqualTo(ResponseCodeFamily.FOURXX);
    Assertions.assertThat(trailingControlCharsInFieldsValidateTrimFuzzer.getExpectedHttpCodeWhenRequiredFieldsAreFuzzed()).isEqualTo(ResponseCodeFamily.FOURXX);
    Assertions.assertThat(trailingControlCharsInFieldsValidateTrimFuzzer.description()).isNotNull();
    Assertions.assertThat(trailingControlCharsInFieldsValidateTrimFuzzer.typeOfDataSentToTheService()).isNotNull();
}
Also used : FuzzingStrategy(com.endava.cats.model.FuzzingStrategy) Test(org.junit.jupiter.api.Test) QuarkusTest(io.quarkus.test.junit.QuarkusTest)

Example 27 with FuzzingStrategy

use of com.endava.cats.model.FuzzingStrategy in project cats by Endava.

the class TrailingMultiCodePointEmojisInFieldsValidateTrimFuzzerTest method shouldProperlyOverrideMethods.

@Test
void shouldProperlyOverrideMethods() {
    FuzzingStrategy fuzzingStrategy = trailingMultiCodePointEmojisInFieldsValidateTrimFuzzer.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(trailingMultiCodePointEmojisInFieldsValidateTrimFuzzer.getExpectedHttpCodeWhenFuzzedValueNotMatchesPattern()).isEqualTo(ResponseCodeFamily.FOURXX);
    Assertions.assertThat(trailingMultiCodePointEmojisInFieldsValidateTrimFuzzer.getExpectedHttpCodeWhenOptionalFieldsAreFuzzed()).isEqualTo(ResponseCodeFamily.FOURXX);
    Assertions.assertThat(trailingMultiCodePointEmojisInFieldsValidateTrimFuzzer.getExpectedHttpCodeWhenRequiredFieldsAreFuzzed()).isEqualTo(ResponseCodeFamily.FOURXX);
    Assertions.assertThat(trailingMultiCodePointEmojisInFieldsValidateTrimFuzzer.description()).isNotNull();
    Assertions.assertThat(trailingMultiCodePointEmojisInFieldsValidateTrimFuzzer.typeOfDataSentToTheService()).isNotNull();
}
Also used : FuzzingStrategy(com.endava.cats.model.FuzzingStrategy) Test(org.junit.jupiter.api.Test) QuarkusTest(io.quarkus.test.junit.QuarkusTest)

Example 28 with FuzzingStrategy

use of com.endava.cats.model.FuzzingStrategy in project cats by Endava.

the class TrailingSingleCodePointEmojisInFieldsTrimValidateFuzzerTest method givenANewTrailingTabsInFieldsTrimValidateFuzzer_whenCreatingANewInstance_thenTheMethodsBeingOverriddenAreMatchingTheTrailingTabsInFieldsTrimValidateFuzzer.

@Test
void givenANewTrailingTabsInFieldsTrimValidateFuzzer_whenCreatingANewInstance_thenTheMethodsBeingOverriddenAreMatchingTheTrailingTabsInFieldsTrimValidateFuzzer() {
    FuzzingStrategy fuzzingStrategy = trailingSingleCodePointEmojisInFieldsTrimValidateFuzzer.getFieldFuzzingStrategy(null, null).get(1);
    Assertions.assertThat(fuzzingStrategy.name()).isEqualTo(FuzzingStrategy.trail().name());
    Assertions.assertThat(fuzzingStrategy.getData()).isEqualTo("\uD83D\uDC80");
    Assertions.assertThat(trailingSingleCodePointEmojisInFieldsTrimValidateFuzzer.getExpectedHttpCodeWhenFuzzedValueNotMatchesPattern()).isEqualTo(ResponseCodeFamily.TWOXX);
    Assertions.assertThat(trailingSingleCodePointEmojisInFieldsTrimValidateFuzzer.description()).isNotNull();
    Assertions.assertThat(trailingSingleCodePointEmojisInFieldsTrimValidateFuzzer.typeOfDataSentToTheService()).isNotNull();
}
Also used : FuzzingStrategy(com.endava.cats.model.FuzzingStrategy) Test(org.junit.jupiter.api.Test) QuarkusTest(io.quarkus.test.junit.QuarkusTest)

Example 29 with FuzzingStrategy

use of com.endava.cats.model.FuzzingStrategy in project cats by Endava.

the class TrailingWhitespacesInFieldsTrimValidateFuzzerTest method givenANewTrailingSpacesInFieldsTrimValidateFuzzer_whenCreatingANewInstance_thenTheMethodsBeingOverriddenAreMatchingTheTrailingSpacesInFieldsTrimValidateFuzzer.

@Test
void givenANewTrailingSpacesInFieldsTrimValidateFuzzer_whenCreatingANewInstance_thenTheMethodsBeingOverriddenAreMatchingTheTrailingSpacesInFieldsTrimValidateFuzzer() {
    FuzzingStrategy fuzzingStrategy = trailingWhitespacesInFieldsTrimValidateFuzzer.getFieldFuzzingStrategy(null, null).get(0);
    Assertions.assertThat(fuzzingStrategy.name()).isEqualTo(FuzzingStrategy.trail().name());
    Assertions.assertThat(fuzzingStrategy.getData()).isEqualTo(" ");
    Assertions.assertThat(trailingWhitespacesInFieldsTrimValidateFuzzer.getExpectedHttpCodeWhenFuzzedValueNotMatchesPattern()).isEqualTo(ResponseCodeFamily.TWOXX);
    Assertions.assertThat(trailingWhitespacesInFieldsTrimValidateFuzzer.description()).isNotNull();
    Assertions.assertThat(trailingWhitespacesInFieldsTrimValidateFuzzer.typeOfDataSentToTheService()).isNotNull();
}
Also used : FuzzingStrategy(com.endava.cats.model.FuzzingStrategy) Test(org.junit.jupiter.api.Test) QuarkusTest(io.quarkus.test.junit.QuarkusTest)

Example 30 with FuzzingStrategy

use of com.endava.cats.model.FuzzingStrategy in project cats by Endava.

the class TrailingWhitespacesInFieldsValidateTrimFuzzerTest method givenANewTrailingSpacesInFieldsValidateTrimFuzzer_whenCreatingANewInstance_thenTheMethodsBeingOverriddenAreMatchingTheTrailingSpacesInFieldsValidateTrimFuzzer.

@Test
void givenANewTrailingSpacesInFieldsValidateTrimFuzzer_whenCreatingANewInstance_thenTheMethodsBeingOverriddenAreMatchingTheTrailingSpacesInFieldsValidateTrimFuzzer() {
    FuzzingStrategy fuzzingStrategy = trailingWhitespacesInFieldsValidateTrimFuzzer.getFieldFuzzingStrategy(null, null).get(0);
    Assertions.assertThat(fuzzingStrategy.name()).isEqualTo(FuzzingStrategy.trail().name());
    Assertions.assertThat(fuzzingStrategy.getData()).isEqualTo(" ");
    Assertions.assertThat(trailingWhitespacesInFieldsValidateTrimFuzzer.getExpectedHttpCodeWhenFuzzedValueNotMatchesPattern()).isEqualTo(ResponseCodeFamily.FOURXX);
    Assertions.assertThat(trailingWhitespacesInFieldsValidateTrimFuzzer.getExpectedHttpCodeWhenOptionalFieldsAreFuzzed()).isEqualTo(ResponseCodeFamily.FOURXX);
    Assertions.assertThat(trailingWhitespacesInFieldsValidateTrimFuzzer.getExpectedHttpCodeWhenRequiredFieldsAreFuzzed()).isEqualTo(ResponseCodeFamily.FOURXX);
    Assertions.assertThat(trailingWhitespacesInFieldsValidateTrimFuzzer.description()).isNotNull();
    Assertions.assertThat(trailingWhitespacesInFieldsValidateTrimFuzzer.typeOfDataSentToTheService()).isNotNull();
}
Also used : FuzzingStrategy(com.endava.cats.model.FuzzingStrategy) Test(org.junit.jupiter.api.Test) QuarkusTest(io.quarkus.test.junit.QuarkusTest)

Aggregations

FuzzingStrategy (com.endava.cats.model.FuzzingStrategy)67 QuarkusTest (io.quarkus.test.junit.QuarkusTest)62 Test (org.junit.jupiter.api.Test)62 FuzzingData (com.endava.cats.model.FuzzingData)35 StringSchema (io.swagger.v3.oas.models.media.StringSchema)34 Schema (io.swagger.v3.oas.models.media.Schema)30 HashMap (java.util.HashMap)27 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)9 NumberSchema (io.swagger.v3.oas.models.media.NumberSchema)4 CatsDSLParser (com.endava.cats.dsl.CatsDSLParser)3 FuzzingResult (com.endava.cats.model.FuzzingResult)3 CatsHeader (com.endava.cats.model.CatsHeader)2 CatsResponse (com.endava.cats.model.CatsResponse)2 DryRun (com.endava.cats.annotations.DryRun)1 ApiArguments (com.endava.cats.args.ApiArguments)1 AuthArguments (com.endava.cats.args.AuthArguments)1 FilesArguments (com.endava.cats.args.FilesArguments)1 ProcessingArguments (com.endava.cats.args.ProcessingArguments)1 CatsDSLWords (com.endava.cats.dsl.CatsDSLWords)1 ADDITIONAL_PROPERTIES (com.endava.cats.dsl.CatsDSLWords.ADDITIONAL_PROPERTIES)1