aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-db
diff options
context:
space:
mode:
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>2015-11-23 17:37:32 +0100
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>2015-11-25 15:33:06 +0100
commitbad09c69eb3a4f51b8a8f539bde20612021e1917 (patch)
tree8f8cb404d49da22fb540a5fd7ecc217532bf6f85 /sonar-db
parentfb71ab63c9adb2f4c113233c536da602096ec258 (diff)
downloadsonarqube-bad09c69eb3a4f51b8a8f539bde20612021e1917.tar.gz
sonarqube-bad09c69eb3a4f51b8a8f539bde20612021e1917.zip
SONAR-7027 add SnapshotTesting#newSnapshotForDeveloper + fix depth
depth field should be set whenever path is set
Diffstat (limited to 'sonar-db')
-rw-r--r--sonar-db/src/test/java/org/sonar/db/component/SnapshotTesting.java15
1 files changed, 12 insertions, 3 deletions
diff --git a/sonar-db/src/test/java/org/sonar/db/component/SnapshotTesting.java b/sonar-db/src/test/java/org/sonar/db/component/SnapshotTesting.java
index 10c3eb0ab43..65d2aca5c72 100644
--- a/sonar-db/src/test/java/org/sonar/db/component/SnapshotTesting.java
+++ b/sonar-db/src/test/java/org/sonar/db/component/SnapshotTesting.java
@@ -34,17 +34,26 @@ public class SnapshotTesting {
return createBasicSnapshot(component, parentSnapshot.getRootProjectId())
.setRootId(parentRootId != null ? parentRootId : parentSnapshot.getId())
.setParentId(parentSnapshot.getId())
- .setPath(Strings.isNullOrEmpty(parentSnapshot.getPath()) ? Long.toString(parentSnapshot.getId()) + "." : parentSnapshot.getPath() + Long.toString(parentSnapshot.getId()) + ".");
+ .setPath(
+ Strings.isNullOrEmpty(parentSnapshot.getPath()) ? Long.toString(parentSnapshot.getId()) + "." : parentSnapshot.getPath() + Long.toString(parentSnapshot.getId()) + ".");
}
public static SnapshotDto newSnapshotForProject(ComponentDto project) {
return createBasicSnapshot(project, project.getId())
- .setPath("");
+ .setDepth(0)
+ .setPath("");
}
public static SnapshotDto newSnapshotForView(ComponentDto view) {
return createBasicSnapshot(view, view.getId())
- .setPath("");
+ .setDepth(0)
+ .setPath("");
+ }
+
+ public static SnapshotDto newSnapshotForDeveloper(ComponentDto developer) {
+ return createBasicSnapshot(developer, developer.getId())
+ .setDepth(0)
+ .setPath("");
}
private static SnapshotDto createBasicSnapshot(ComponentDto component, Long rootProjectId) {