@Test public void issues_when_rubocop_file_and_line_errors() throws IOException { List<ExternalIssue> externalIssues = executeSensorImporting(7, 2, "rubocop-report-with-file-and-line-errors.json"); assertThat(externalIssues).hasSize(4); assertThat(location(externalIssues.get(0))).isEqualTo("from line 3 offset 2 to line 3 offset 7"); assertThat(location(externalIssues.get(1))).isEqualTo("from line 3 offset 6 to line 4 offset 3"); assertThat(location(externalIssues.get(2))).isEqualTo("from line 3 offset 0 to line 3 offset 15"); assertThat(location(externalIssues.get(3))).isEqualTo("from line 3 offset 0 to line 3 offset 15"); assertThat(onlyOneLogElement(logTester.logs(LoggerLevel.ERROR))).contains("1000 is not a valid line for pointer. File useless-assignment.rb has 132 line(s)"); assertThat(onlyOneLogElement(logTester.logs(LoggerLevel.WARN))) .isEqualTo("Fail to resolve 1 file(s). No RuboCop issues will be imported on the following file(s): invalid-path.json"); assertThat(logTester.logs(LoggerLevel.DEBUG)).isEmpty(); }
private static boolean isEmpty(@Nullable String value) { return value == null || value.trim().isEmpty(); }
RuboCopSensor implements Sensor { private static boolean isEmpty(@Nullable String value) { return value == null || value.trim().isEmpty(); } }
RuboCopSensor implements Sensor { private static boolean isEmpty(@Nullable String value) { return value == null || value.trim().isEmpty(); }  }
RuboCopSensor implements Sensor { private static boolean isEmpty(@Nullable String value) { return value == null || value.trim().isEmpty(); }  @Override void describe(SensorDescriptor descriptor); @Override void execute(SensorContext context); }
RuboCopSensor implements Sensor { private static boolean isEmpty(@Nullable String value) { return value == null || value.trim().isEmpty(); }  @Override void describe(SensorDescriptor descriptor); @Override void execute(SensorContext context); static final String REPORT_PROPERTY_KEY; }