aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorDuarte Meneses <duarte.meneses@sonarsource.com>2022-09-14 10:52:04 -0500
committersonartech <sonartech@sonarsource.com>2022-09-16 20:03:14 +0000
commit6f2881c71996715ba3a9a7b2451f008c2239d7eb (patch)
tree3a3a293815a30d7d61899c866118431d3c8a6318 /server
parente302f298b39c133f7290571b13db668610867fa1 (diff)
downloadsonarqube-6f2881c71996715ba3a9a7b2451f008c2239d7eb.tar.gz
sonarqube-6f2881c71996715ba3a9a7b2451f008c2239d7eb.zip
SONAR-17287 Return optional flow description and type in WS responses
Diffstat (limited to 'server')
-rw-r--r--server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/TextRangeResponseFormatter.java2
-rw-r--r--server/sonar-webserver-webapi/src/test/java/org/sonar/server/hotspot/ws/ShowActionTest.java4
2 files changed, 3 insertions, 3 deletions
diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/TextRangeResponseFormatter.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/TextRangeResponseFormatter.java
index 42473599f39..aec7338ca63 100644
--- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/TextRangeResponseFormatter.java
+++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/TextRangeResponseFormatter.java
@@ -59,7 +59,7 @@ public class TextRangeResponseFormatter {
targetFlow.setDescription(flow.getDescription());
}
if (flow.hasType()) {
- convertFlowType(flow.getType()).ifPresent(targetFlow::setFlowType);
+ convertFlowType(flow.getType()).ifPresent(targetFlow::setType);
}
return targetFlow.build();
}).collect(Collectors.toList());
diff --git a/server/sonar-webserver-webapi/src/test/java/org/sonar/server/hotspot/ws/ShowActionTest.java b/server/sonar-webserver-webapi/src/test/java/org/sonar/server/hotspot/ws/ShowActionTest.java
index cfcced32b9c..84c1849a4f2 100644
--- a/server/sonar-webserver-webapi/src/test/java/org/sonar/server/hotspot/ws/ShowActionTest.java
+++ b/server/sonar-webserver-webapi/src/test/java/org/sonar/server/hotspot/ws/ShowActionTest.java
@@ -260,7 +260,7 @@ public class ShowActionTest {
assertThat(response.getKey()).isEqualTo(hotspot.getKey());
assertThat(response.getFlowsCount()).isEqualTo(2);
assertThat(response.getFlows(0).getDescription()).isEqualTo("FLOW DESCRIPTION");
- assertThat(response.getFlows(0).getFlowType()).isEqualTo(Common.FlowType.DATA);
+ assertThat(response.getFlows(0).getType()).isEqualTo(Common.FlowType.DATA);
assertThat(response.getFlows(0).getLocationsList())
.extracting(Location::getMsg, Location::getComponent)
.containsExactlyInAnyOrder(
@@ -269,7 +269,7 @@ public class ShowActionTest {
tuple("FLOW MESSAGE WITHOUT FILE UUID", file.getKey()));
assertThat(response.getFlows(1).getDescription()).isEmpty();
- assertThat(response.getFlows(1).hasFlowType()).isFalse();
+ assertThat(response.getFlows(1).hasType()).isFalse();
}
@Test