@Test
public void should_parse() throws Exception {

  ActiveRulesBuilder activeRulesBuilder = new ActiveRulesBuilder();
  activeRulesBuilder = activateFakeRule(activeRulesBuilder, "BooleanInstantiation");
  activeRulesBuilder = activateFakeRule(activeRulesBuilder, "DuplicateImport");
  activeRulesBuilder = activateFakeRule(activeRulesBuilder, "EmptyCatchBlock");
  activeRulesBuilder = activateFakeRule(activeRulesBuilder, "EmptyElseBlock");
  activeRulesBuilder = activateFakeRule(activeRulesBuilder, "EmptyFinallyBlock");
  activeRulesBuilder = activateFakeRule(activeRulesBuilder, "EmptyForStatement");
  activeRulesBuilder = activateFakeRule(activeRulesBuilder, "EmptyIfStatement");
  activeRulesBuilder = activateFakeRule(activeRulesBuilder, "EmptyTryBlock");
  activeRulesBuilder = activateFakeRule(activeRulesBuilder, "EmptyWhileStatement");
  activeRulesBuilder = activateFakeRule(activeRulesBuilder, "ImportFromSamePackage");
  activeRulesBuilder = activateFakeRule(activeRulesBuilder, "ReturnFromFinallyBlock");
  activeRulesBuilder = activateFakeRule(activeRulesBuilder, "StringInstantiation");
  activeRulesBuilder = activateFakeRule(activeRulesBuilder, "ThrowExceptionFromFinallyBlock");
  activeRulesBuilder = activateFakeRule(activeRulesBuilder, "UnnecessaryGroovyImport");
  activeRulesBuilder = activateFakeRule(activeRulesBuilder, "UnusedImport");
  sensorContextTester.setActiveRules(activeRulesBuilder.build());
  File reportUpdated = getReportWithUpdatedSourceDir();
  sensorContextTester.settings().setProperty(GroovyPlugin.CODENARC_REPORT_PATHS, reportUpdated.getAbsolutePath());
  addFileWithFakeContent("src/org/codenarc/sample/domain/SampleDomain.groovy");
  addFileWithFakeContent("src/org/codenarc/sample/service/NewService.groovy");
  addFileWithFakeContent("src/org/codenarc/sample/service/OtherService.groovy");
  addFileWithFakeContent("src/org/codenarc/sample/service/SampleService.groovy");
  sensor.execute(sensorContextTester);
  assertThat(sensorContextTester.allIssues()).hasSize(17);
}