diff options
author | Léo Geoffroy <leo.geoffroy@sonarsource.com> | 2024-11-07 17:07:37 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2024-11-08 20:02:47 +0000 |
commit | bdd5959fa8f2589d305a8f5f22b19ee9d9fbdcc0 (patch) | |
tree | 7433b5cb057d03e37203e62bc762ca13c162de15 /server/sonar-db-migration | |
parent | 540abf1c8339006b9235a2e335320e464854a6dc (diff) | |
download | sonarqube-bdd5959fa8f2589d305a8f5f22b19ee9d9fbdcc0.tar.gz sonarqube-bdd5959fa8f2589d305a8f5f22b19ee9d9fbdcc0.zip |
SGB-214 Fix measure_data type on tests
Diffstat (limited to 'server/sonar-db-migration')
-rw-r--r-- | server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v108/MigrateBranchesLiveMeasuresToMeasuresIT.java | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v108/MigrateBranchesLiveMeasuresToMeasuresIT.java b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v108/MigrateBranchesLiveMeasuresToMeasuresIT.java index 74813eea032..b41e0d02246 100644 --- a/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v108/MigrateBranchesLiveMeasuresToMeasuresIT.java +++ b/server/sonar-db-migration/src/it/java/org/sonar/server/platform/db/migration/version/v108/MigrateBranchesLiveMeasuresToMeasuresIT.java @@ -202,7 +202,7 @@ class MigrateBranchesLiveMeasuresToMeasuresIT { insertNotMigratedBranch(branch); String component1 = uuidFactory.create(); metricsToMigrate.forEach(metricUuid -> insertMeasure(branch, component1, metricUuid, - Map.of("measure_data", "{\"LOW\":3,\"MEDIUM\":0,\"HIGH\":4,\"total\":7}"))); + Map.of("measure_data", "{\"LOW\":3,\"MEDIUM\":0,\"HIGH\":4,\"total\":7}".getBytes(StandardCharsets.UTF_8)))); underTest.execute(); @@ -236,12 +236,12 @@ class MigrateBranchesLiveMeasuresToMeasuresIT { String component1 = uuidFactory.create(); insertMeasure(branch, component1, nclocMetricUuid, Map.of("value", 120)); // total is not a number - insertMeasure(branch, component1, maintainabilityMetricUuid, Map.of("measure_data", "{\"LOW\":3,\"MEDIUM\":0,\"HIGH\":4," + - "\"total\":\"ABC\"}")); + insertMeasure(branch, component1, maintainabilityMetricUuid, Map.of("measure_data", "{\"LOW\":3,\"MEDIUM\":0,\"HIGH\":4,\"total\":\"ABC\"}" + .getBytes(StandardCharsets.UTF_8))); // total cannot fit in a long - insertMeasure(branch, component1, reliabilityMetricUuid, Map.of("measure_data", "{\"LOW\":3,\"MEDIUM\":0,\"HIGH\":4," + - "\"total\":98723987498723987429874928748748}")); - insertMeasure(branch, component1, securityMetricUuid, Map.of("measure_data", "{\"LOW\":3,\"MEDIUM\":0,\"HIGH\":4,\"total\":37}")); + insertMeasure(branch, component1, reliabilityMetricUuid, Map.of("measure_data", "{\"LOW\":3,\"MEDIUM\":0,\"HIGH\":4,\"total\":98723987498723987429874928748748}" + .getBytes(StandardCharsets.UTF_8))); + insertMeasure(branch, component1, securityMetricUuid, Map.of("measure_data", "{\"LOW\":3,\"MEDIUM\":0,\"HIGH\":4,\"total\":37}".getBytes(StandardCharsets.UTF_8))); logTester.setLevel(Level.DEBUG); underTest.execute(); @@ -259,8 +259,7 @@ class MigrateBranchesLiveMeasuresToMeasuresIT { "ncloc", 120.0, CoreMetrics.MAINTAINABILITY_ISSUES_KEY, "{\"LOW\":3,\"MEDIUM\":0,\"HIGH\":4,\"total\":\"ABC\"}", CoreMetrics.RELIABILITY_ISSUES_KEY, "{\"LOW\":3,\"MEDIUM\":0,\"HIGH\":4,\"total\":98723987498723987429874928748748}", - CoreMetrics.SECURITY_ISSUES_KEY, "{\"LOW\":3,\"MEDIUM\":0,\"HIGH\":4,\"total\":37}" - ); + CoreMetrics.SECURITY_ISSUES_KEY, "{\"LOW\":3,\"MEDIUM\":0,\"HIGH\":4,\"total\":37}"); Map<String, Object> expectedNewMetrics = Map.of(SoftwareQualitiesMetrics.SOFTWARE_QUALITY_SECURITY_ISSUES_KEY, 37.0); |