import org.sonarqube.ws.Hotspots.ShowWsResponse;
import static com.google.common.base.Preconditions.checkArgument;
+import static com.google.common.base.Strings.emptyToNull;
import static com.google.common.base.Strings.nullToEmpty;
import static java.lang.String.format;
import static java.util.Collections.singleton;
.createAction("show")
.setHandler(this)
.setDescription("Provides the details of a Security Hotspot.")
- .setSince("8.1")
- .setInternal(true);
+ .setSince("8.1");
action.createParam(PARAM_HOTSPOT_KEY)
.setDescription("Key of the Security Hotspot")
ofNullable(hotspot.getStatus()).ifPresent(builder::setStatus);
ofNullable(hotspot.getResolution()).ifPresent(builder::setResolution);
ofNullable(hotspot.getLine()).ifPresent(builder::setLine);
+ ofNullable(emptyToNull(hotspot.getChecksum())).ifPresent(builder::setHash);
builder.setMessage(nullToEmpty(hotspot.getMessage()));
builder.setCreationDate(formatDateTime(hotspot.getIssueCreationDate()));
builder.setUpdateDate(formatDateTime(hotspot.getIssueUpdateDate()));
}
@Test
- public void ws_is_internal() {
- assertThat(actionTester.getDef().isInternal()).isTrue();
+ public void ws_is_public() {
+ assertThat(actionTester.getDef().isInternal()).isFalse();
}
@Test
.setAuthorLogin("joe")
.setMessage("message")
.setLine(10)
+ .setChecksum("a227e508d6646b55a086ee11d63b21e9")
.setIssueCreationTime(time)
.setIssueUpdateTime(time)
.setAuthorLogin(author.getLogin())
optional string status = 5;
optional string resolution = 6;
optional int32 line = 7;
+ optional string hash = 18;
optional string message = 8;
optional string assignee = 9;
optional string author = 10;