use of com.google.testing.junit.runner.sharding.ShardingEnvironment in project bazel by bazelbuild.
the class JUnit4TestModelBuilderTest method testDoesNotTouchShardFileWhenShardingDisabled.
@Test
public void testDoesNotTouchShardFileWhenShardingDisabled() {
Class<?> testClass = SampleTestCaseWithTwoTests.class;
Request request = Request.classWithoutSuiteMethod(testClass);
ShardingEnvironment mockShardingEnvironment = mock(ShardingEnvironment.class);
ShardingFilters shardingFilters = new ShardingFilters(mockShardingEnvironment, DEFAULT_SHARDING_STRATEGY);
JUnit4TestModelBuilder modelBuilder = builder(request, testClass.getCanonicalName(), mockShardingEnvironment, shardingFilters, xmlResultWriter);
when(mockShardingEnvironment.isShardingEnabled()).thenReturn(false);
modelBuilder.get();
verify(mockShardingEnvironment, never()).touchShardFile();
}
Aggregations