use of org.sonar.api.batch.scm.BlameLine in project sonarqube by SonarSource.
the class DefaultBlameOutputTest method shouldFailIfNullDate.
@Test
public void shouldFailIfNullDate() {
InputFile file = new TestInputFileBuilder("foo", "src/main/java/Foo.java").setLines(1).build();
var blameOutput = new DefaultBlameOutput(null, analysisWarnings, singletonList(file));
var lines = singletonList(new BlameLine().revision("1").author("guy"));
assertThatThrownBy(() -> blameOutput.blameResult(file, lines)).isInstanceOf(IllegalArgumentException.class).hasMessage("Blame date is null for file " + file + " at line 1");
}
use of org.sonar.api.batch.scm.BlameLine in project sonarqube by SonarSource.
the class DefaultBlameOutputTest method shouldFailIfNotExpectedFile.
@Test
public void shouldFailIfNotExpectedFile() {
InputFile file = new TestInputFileBuilder("foo", "src/main/java/Foo.java").build();
var blameOutput = new DefaultBlameOutput(null, analysisWarnings, singletonList(new TestInputFileBuilder("foo", "src/main/java/Foo2.java").build()));
var lines = singletonList(new BlameLine().revision("1").author("guy"));
assertThatThrownBy(() -> blameOutput.blameResult(file, lines)).isInstanceOf(IllegalArgumentException.class).hasMessage("It was not expected to blame file " + file);
}
Aggregations