aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-telemetry/src/test/java/org
diff options
context:
space:
mode:
authorlukasz-jarocki-sonarsource <lukasz.jarocki@sonarsource.com>2024-07-15 16:33:09 +0200
committersonartech <sonartech@sonarsource.com>2024-07-24 20:02:48 +0000
commit34cf59a340ea31410cbb60019e6e445e9d8d2929 (patch)
tree0306dfe0d482cb8526b5c74d883ca083595fdc41 /server/sonar-telemetry/src/test/java/org
parentc9d48b7138e2f73637da4ead7ee9c54c78447381 (diff)
downloadsonarqube-34cf59a340ea31410cbb60019e6e445e9d8d2929.tar.gz
sonarqube-34cf59a340ea31410cbb60019e6e445e9d8d2929.zip
SONAR-22479 moved 'user_enabled' metric to sonar-telemetry
Diffstat (limited to 'server/sonar-telemetry/src/test/java/org')
-rw-r--r--server/sonar-telemetry/src/test/java/org/sonar/telemetry/user/TelemetryUserEnabledProviderTest.java44
1 files changed, 44 insertions, 0 deletions
diff --git a/server/sonar-telemetry/src/test/java/org/sonar/telemetry/user/TelemetryUserEnabledProviderTest.java b/server/sonar-telemetry/src/test/java/org/sonar/telemetry/user/TelemetryUserEnabledProviderTest.java
new file mode 100644
index 00000000000..032065828ec
--- /dev/null
+++ b/server/sonar-telemetry/src/test/java/org/sonar/telemetry/user/TelemetryUserEnabledProviderTest.java
@@ -0,0 +1,44 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2024 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.sonar.telemetry.user;
+
+import org.junit.jupiter.api.Test;
+import org.sonar.db.DbClient;
+import org.sonar.telemetry.Dimension;
+import org.sonar.telemetry.Granularity;
+import org.sonar.telemetry.TelemetryDataType;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.mockito.Mockito.mock;
+
+class TelemetryUserEnabledProviderTest {
+
+ private final DbClient dbClient = mock(DbClient.class);
+
+ private final TelemetryUserEnabledProvider underTest = new TelemetryUserEnabledProvider(dbClient);
+
+ @Test
+ void testGetters() {
+ assertThat(underTest.getDimension()).isEqualTo(Dimension.USER);
+ assertThat(underTest.getGranularity()).isEqualTo(Granularity.DAILY);
+ assertThat(underTest.getMetricKey()).isEqualTo("user_enabled");
+ assertThat(underTest.getType()).isEqualTo(TelemetryDataType.BOOLEAN);
+ }
+}