Search in sources :

Example 11 with TestCaseListener

use of com.endava.cats.report.TestCaseListener in project cats by Endava.

the class AbugidasCharsInStringFieldsSanitizeValidateFuzzerTest method setup.

@BeforeEach
void setup() {
    ServiceCaller serviceCaller = Mockito.mock(ServiceCaller.class);
    TestCaseListener testCaseListener = Mockito.mock(TestCaseListener.class);
    FilesArguments filesArguments = Mockito.mock(FilesArguments.class);
    abugidasCharsInStringFieldsSanitizeValidateFuzzer = new AbugidasCharsInStringFieldsSanitizeValidateFuzzer(serviceCaller, testCaseListener, catsUtil, filesArguments);
    Mockito.when(testCaseListener.isFieldNotADiscriminator(Mockito.anyString())).thenReturn(true);
    Mockito.when(testCaseListener.isFieldNotADiscriminator("pet#type")).thenReturn(false);
}
Also used : FilesArguments(com.endava.cats.args.FilesArguments) ServiceCaller(com.endava.cats.io.ServiceCaller) TestCaseListener(com.endava.cats.report.TestCaseListener) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 12 with TestCaseListener

use of com.endava.cats.report.TestCaseListener in project cats by Endava.

the class AbugidasCharsInStringFieldsValidateSanitizeFuzzerTest method setup.

@BeforeEach
void setup() {
    ServiceCaller serviceCaller = Mockito.mock(ServiceCaller.class);
    TestCaseListener testCaseListener = Mockito.mock(TestCaseListener.class);
    FilesArguments filesArguments = Mockito.mock(FilesArguments.class);
    abugidasCharsInStringFieldsValidateSanitizeFuzzer = new AbugidasCharsInStringFieldsValidateSanitizeFuzzer(serviceCaller, testCaseListener, catsUtil, filesArguments);
    Mockito.when(testCaseListener.isFieldNotADiscriminator(Mockito.anyString())).thenReturn(true);
    Mockito.when(testCaseListener.isFieldNotADiscriminator("pet#type")).thenReturn(false);
}
Also used : FilesArguments(com.endava.cats.args.FilesArguments) ServiceCaller(com.endava.cats.io.ServiceCaller) TestCaseListener(com.endava.cats.report.TestCaseListener) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 13 with TestCaseListener

use of com.endava.cats.report.TestCaseListener in project cats by Endava.

the class WithinControlCharsInFieldsSanitizeValidateFuzzerTest method setup.

@BeforeEach
void setup() {
    ServiceCaller serviceCaller = Mockito.mock(ServiceCaller.class);
    TestCaseListener testCaseListener = Mockito.mock(TestCaseListener.class);
    FilesArguments filesArguments = Mockito.mock(FilesArguments.class);
    withinControlCharsInFieldsSanitizeValidateFuzzer = new WithinControlCharsInFieldsSanitizeValidateFuzzer(serviceCaller, testCaseListener, catsUtil, filesArguments);
    Mockito.when(testCaseListener.isFieldNotADiscriminator(Mockito.anyString())).thenReturn(true);
    Mockito.when(testCaseListener.isFieldNotADiscriminator("pet#type")).thenReturn(false);
}
Also used : FilesArguments(com.endava.cats.args.FilesArguments) ServiceCaller(com.endava.cats.io.ServiceCaller) TestCaseListener(com.endava.cats.report.TestCaseListener) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 14 with TestCaseListener

use of com.endava.cats.report.TestCaseListener in project cats by Endava.

the class ZalgoTextInStringFieldsValidateSanitizeFuzzerTest method setup.

@BeforeEach
void setup() {
    ServiceCaller serviceCaller = Mockito.mock(ServiceCaller.class);
    TestCaseListener testCaseListener = Mockito.mock(TestCaseListener.class);
    FilesArguments filesArguments = Mockito.mock(FilesArguments.class);
    zalgoTextInStringFieldsValidateSanitizeFuzzer = new ZalgoTextInStringFieldsValidateSanitizeFuzzer(serviceCaller, testCaseListener, catsUtil, filesArguments);
    Mockito.when(testCaseListener.isFieldNotADiscriminator(Mockito.anyString())).thenReturn(true);
    Mockito.when(testCaseListener.isFieldNotADiscriminator("pet#type")).thenReturn(false);
}
Also used : FilesArguments(com.endava.cats.args.FilesArguments) ServiceCaller(com.endava.cats.io.ServiceCaller) TestCaseListener(com.endava.cats.report.TestCaseListener) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 15 with TestCaseListener

use of com.endava.cats.report.TestCaseListener in project cats by Endava.

the class ServiceCallerTest method setupEach.

@BeforeEach
public void setupEach() throws Exception {
    FilesArguments filesArguments = new FilesArguments(catsUtil);
    TestCaseListener testCaseListener = Mockito.mock(TestCaseListener.class);
    serviceCaller = new ServiceCaller(catsGlobalContext, testCaseListener, catsUtil, filesArguments, catsDSLParser, authArguments, apiArguments, processingArguments);
    ReflectionTestUtils.setField(apiArguments, "server", "http://localhost:" + wireMockServer.port());
    ReflectionTestUtils.setField(authArguments, "basicAuth", "user:password");
    ReflectionTestUtils.setField(filesArguments, "refDataFile", new File("src/test/resources/refFields.yml"));
    ReflectionTestUtils.setField(filesArguments, "headersFile", new File("src/test/resources/headers.yml"));
    ReflectionTestUtils.setField(filesArguments, "params", List.of("id=1", "test=2"));
    ReflectionTestUtils.setField(authArguments, "sslKeystore", null);
    ReflectionTestUtils.setField(authArguments, "proxyHost", null);
    ReflectionTestUtils.setField(authArguments, "proxyPort", 0);
    filesArguments.loadHeaders();
    filesArguments.loadRefData();
    filesArguments.loadURLParams();
    catsGlobalContext.getPostSuccessfulResponses().clear();
}
Also used : FilesArguments(com.endava.cats.args.FilesArguments) File(java.io.File) TestCaseListener(com.endava.cats.report.TestCaseListener) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

TestCaseListener (com.endava.cats.report.TestCaseListener)16 BeforeEach (org.junit.jupiter.api.BeforeEach)16 IgnoreArguments (com.endava.cats.args.IgnoreArguments)8 ReportingArguments (com.endava.cats.args.ReportingArguments)8 CatsGlobalContext (com.endava.cats.model.CatsGlobalContext)8 ExecutionStatisticsListener (com.endava.cats.report.ExecutionStatisticsListener)8 TestCaseExporter (com.endava.cats.report.TestCaseExporter)8 ServiceCaller (com.endava.cats.io.ServiceCaller)7 FilesArguments (com.endava.cats.args.FilesArguments)6 File (java.io.File)1