use of com.teamscale.report.testwise.model.TestwiseCoverage in project teamscale-jacoco-agent by cqse.
the class CoverageToTeamscaleStrategyTest method shouldRecordCoverageForTestsEvenIfNotProvidedAsAvailableTest.
@Test
public void shouldRecordCoverageForTestsEvenIfNotProvidedAsAvailableTest() throws Exception {
AgentOptions options = mockOptions();
CoverageToTeamscaleStrategy strategy = new CoverageToTeamscaleStrategy(controller, options, reportGenerator);
TestwiseCoverage testwiseCoverage = getDummyTestwiseCoverage("mytest");
when(reportGenerator.convert(any(File.class))).thenReturn(testwiseCoverage);
// we skip testRunStart and don't provide any available tests
strategy.testStart("mytest");
strategy.testEnd("mytest", new TestExecution("mytest", 0L, ETestExecutionResult.PASSED));
strategy.testRunEnd();
verify(client).uploadReport(eq(EReportFormat.TESTWISE_COVERAGE), matches("\\Q{\"tests\":[{\"duration\":\\E[^,]*\\Q,\"paths\":[{\"files\":[{\"coveredLines\":\"1-4\",\"fileName\":\"Main.java\"}],\"path\":\"src/main/java\"}],\"result\":\"PASSED\",\"sourcePath\":\"mytest\",\"uniformPath\":\"mytest\"}]}\\E"), any(), any(), any(), any());
}
Aggregations