@Test
public void should_register_tests() throws URISyntaxException {

  SensorContextTester context = SensorContextTester.create(new File(""));
  MutableTestCase testCase = mock(MutableTestCase.class);
  when(testCase.setDurationInMs(anyLong())).thenReturn(testCase);
  when(testCase.setStatus(any(TestCase.Status.class))).thenReturn(testCase);
  when(testCase.setMessage(ArgumentMatchers.nullable(String.class))).thenReturn(testCase);
  when(testCase.setStackTrace(anyString())).thenReturn(testCase);
  when(testCase.setType(anyString())).thenReturn(testCase);
  MutableTestPlan testPlan = mock(MutableTestPlan.class);
  when(testPlan.addTestCase(anyString())).thenReturn(testCase);
  when(perspectives.as(eq(MutableTestPlan.class),
    argThat(inputFileMatcher(":ch.hortis.sonar.mvn.mc.MetricsCollectorRegistryTest")))).thenReturn(testPlan);
  parser.collect(context, getDir("multipleReports"));
  verify(testPlan).addTestCase("testGetUnKnownCollector");
  verify(testPlan).addTestCase("testGetJDependsCollector");
}