aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api-impl/src/main
diff options
context:
space:
mode:
authorJacek <52388493+jacek-poreda-sonarsource@users.noreply.github.com>2019-09-05 13:05:19 +0200
committerSonarTech <sonartech@sonarsource.com>2019-09-05 20:21:02 +0200
commitad082b3d7b15c604eabe253087d9c1a33464f637 (patch)
tree44e3b0b5d91ec2620abf3678c8203a479333e572 /sonar-plugin-api-impl/src/main
parent53293c67e569bb35667bc3c997e821f8fd6f70b2 (diff)
downloadsonarqube-ad082b3d7b15c604eabe253087d9c1a33464f637.tar.gz
sonarqube-ad082b3d7b15c604eabe253087d9c1a33464f637.zip
SONAR-12214 - order by created_at instead of technical id (#2029)
* SONAR-12214 - order by created_at instead of technical id
Diffstat (limited to 'sonar-plugin-api-impl/src/main')
-rw-r--r--sonar-plugin-api-impl/src/main/java/org/sonar/api/impl/utils/TestSystem2.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/sonar-plugin-api-impl/src/main/java/org/sonar/api/impl/utils/TestSystem2.java b/sonar-plugin-api-impl/src/main/java/org/sonar/api/impl/utils/TestSystem2.java
index b1005d5e186..23867e50a8d 100644
--- a/sonar-plugin-api-impl/src/main/java/org/sonar/api/impl/utils/TestSystem2.java
+++ b/sonar-plugin-api-impl/src/main/java/org/sonar/api/impl/utils/TestSystem2.java
@@ -32,12 +32,22 @@ public class TestSystem2 extends System2 {
return this;
}
+ public TestSystem2 tick() {
+ throwExceptionIfNowLesserOrEqualZero();
+ this.now = this.now + 1;
+ return this;
+ }
+
@Override
public long now() {
+ throwExceptionIfNowLesserOrEqualZero();
+ return now;
+ }
+
+ private void throwExceptionIfNowLesserOrEqualZero() {
if (now <= 0L) {
throw new IllegalStateException("Method setNow() was not called by test");
}
- return now;
}
public TestSystem2 setDefaultTimeZone(TimeZone defaultTimeZone) {