use of org.sonar.scanner.scan.filesystem.StatusDetection in project sonarqube by SonarSource.
the class StatusDetectionFactoryTest method testCreate.
@Test
public void testCreate() throws Exception {
StatusDetectionFactory factory = new StatusDetectionFactory(mock(ProjectRepositories.class));
StatusDetection detection = factory.create();
assertThat(detection).isNotNull();
}
use of org.sonar.scanner.scan.filesystem.StatusDetection in project sonarqube by SonarSource.
the class StatusDetectionTest method detect_status.
@Test
public void detect_status() {
Table<String, String, String> t = ImmutableTable.of();
ProjectRepositories ref = new ProjectRepositories(t, createTable(), null);
StatusDetection statusDetection = new StatusDetection(ref);
assertThat(statusDetection.status("foo", "src/Foo.java", "ABCDE")).isEqualTo(InputFile.Status.SAME);
assertThat(statusDetection.status("foo", "src/Foo.java", "XXXXX")).isEqualTo(InputFile.Status.CHANGED);
assertThat(statusDetection.status("foo", "src/Other.java", "QWERT")).isEqualTo(InputFile.Status.ADDED);
}
Aggregations