]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-17287 Return optional flow description and type in WS responses
authorDuarte Meneses <duarte.meneses@sonarsource.com>
Wed, 14 Sep 2022 15:52:04 +0000 (10:52 -0500)
committersonartech <sonartech@sonarsource.com>
Fri, 16 Sep 2022 20:03:14 +0000 (20:03 +0000)
server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/TextRangeResponseFormatter.java
server/sonar-webserver-webapi/src/test/java/org/sonar/server/hotspot/ws/ShowActionTest.java
sonar-ws/src/main/protobuf/ws-commons.proto

index 42473599f39570afbc68d0c61776ca3bd9485d8b..aec7338ca63ced06a8778567fe0751dda353bc66 100644 (file)
@@ -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());
index cfcced32b9c516b72839106c4ae89824d41ee967..84c1849a4f2ac9aac4d64bc3c057a16387f6bd24 100644 (file)
@@ -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
index 71a564212a08ae6c6d05ea0a6ab2cf8c549f30c0..c24c1d5d5e63dda028f6f5ee9d54107b560bf209 100644 (file)
@@ -96,7 +96,7 @@ message TextRange {
 message Flow {
   repeated Location locations = 1;
   optional string description = 2;
-  optional FlowType flowType = 3;
+  optional FlowType type = 3;
 }
 
 enum FlowType {