Search in sources :

Example 1 with RunOrderCalculator

use of org.apache.maven.surefire.util.RunOrderCalculator in project junit5 by junit-team.

the class JUnitPlatformProviderTests method providerParametersMock.

private static ProviderParameters providerParametersMock(RunListener runListener, TestListResolver testListResolver, Class<?>... testClasses) {
    TestsToRun testsToRun = newTestsToRun(testClasses);
    ScanResult scanResult = mock(ScanResult.class);
    when(scanResult.applyFilter(any(), any())).thenReturn(testsToRun);
    RunOrderCalculator runOrderCalculator = mock(RunOrderCalculator.class);
    when(runOrderCalculator.orderTestClasses(any())).thenReturn(testsToRun);
    ReporterFactory reporterFactory = mock(ReporterFactory.class);
    when(reporterFactory.createReporter()).thenReturn(runListener);
    TestRequest testRequest = mock(TestRequest.class);
    when(testRequest.getTestListResolver()).thenReturn(testListResolver);
    ProviderParameters providerParameters = mock(ProviderParameters.class);
    when(providerParameters.getScanResult()).thenReturn(scanResult);
    when(providerParameters.getRunOrderCalculator()).thenReturn(runOrderCalculator);
    when(providerParameters.getReporterFactory()).thenReturn(reporterFactory);
    when(providerParameters.getTestRequest()).thenReturn(testRequest);
    return providerParameters;
}
Also used : RunOrderCalculator(org.apache.maven.surefire.util.RunOrderCalculator) ProviderParameters(org.apache.maven.surefire.providerapi.ProviderParameters) ScanResult(org.apache.maven.surefire.util.ScanResult) ReporterFactory(org.apache.maven.surefire.report.ReporterFactory) TestsToRun(org.apache.maven.surefire.util.TestsToRun) TestRequest(org.apache.maven.surefire.testset.TestRequest)

Aggregations

ProviderParameters (org.apache.maven.surefire.providerapi.ProviderParameters)1 ReporterFactory (org.apache.maven.surefire.report.ReporterFactory)1 TestRequest (org.apache.maven.surefire.testset.TestRequest)1 RunOrderCalculator (org.apache.maven.surefire.util.RunOrderCalculator)1 ScanResult (org.apache.maven.surefire.util.ScanResult)1 TestsToRun (org.apache.maven.surefire.util.TestsToRun)1