Commit 4b32afcd authored by Antoine Mottier's avatar Antoine Mottier
Browse files

Fix fetchMKTMetrics to use dynamic project name instead of ASM

The SQL query in `fetchMKTMetrics` method was using hard-coded project name (`asm`) instead of using the `DatasetFactory` `project` attribute.

Also update JUnit and MariaDB version.
parent 2d5717ba
Pipeline #11083 passed with stages
in 4 minutes and 53 seconds
......@@ -32,8 +32,8 @@
<!-- Jetty target version (Debian package) is 9.4
So we need to use Java EE 7 features and Servlet version 3.1 -->
......@@ -185,7 +185,7 @@ public class DatasetFactory {
Connection connection = DatasetFactory.connectDB();
try (Statement statement = connection.createStatement()) {
ResultSet resultSet = statement.executeQuery("SELECT * FROM (SELECT Project, Date, MetricName, Value, row_number() over(partition by MetricName order by Date desc) AS rn " +
"FROM RawData WHERE Project = 'asm' AND MetricName LIKE 'MKT_%') t WHERE t.rn = 1;");
"FROM RawData WHERE Project = '" + project + "' AND MetricName LIKE 'MKT_%') t WHERE t.rn = 1;");
while ( {
Metric m = new Metric(project, resultSet.getString("MetricName"), resultSet.getDouble("Value"));
metrics.putIfAbsent(m.getName(), m);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment