@@ -72,7 +72,6 @@ public class IssueLifecycle { | |||
raw.setCreationDate(base.creationDate()); | |||
raw.setUpdateDate(base.updateDate()); | |||
raw.setCloseDate(base.closeDate()); | |||
raw.setActionPlanKey(base.actionPlanKey()); | |||
raw.setResolution(base.resolution()); | |||
raw.setStatus(base.status()); | |||
raw.setAssignee(base.assignee()); |
@@ -1,35 +0,0 @@ | |||
/* | |||
* SonarQube | |||
* Copyright (C) 2009-2016 SonarSource SA | |||
* mailto:contact AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | |||
* version 3 of the License, or (at your option) any later version. | |||
* | |||
* This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* Lesser General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU Lesser General Public License | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.dashboard.widget; | |||
import org.sonar.api.web.WidgetCategory; | |||
import org.sonar.api.web.WidgetProperties; | |||
import org.sonar.api.web.WidgetProperty; | |||
import org.sonar.api.web.WidgetPropertyType; | |||
@WidgetCategory({"Issues"}) | |||
@WidgetProperties({ | |||
@WidgetProperty(key = "showResolvedIssues", type = WidgetPropertyType.BOOLEAN, defaultValue = "true") | |||
}) | |||
public class ActionPlansWidget extends CoreWidget { | |||
public ActionPlansWidget() { | |||
super("action_plans", "Issues action plans", "/org/sonar/server/dashboard/widget/action_plans.html.erb"); | |||
} | |||
} |
@@ -25,16 +25,13 @@ import com.google.common.base.Strings; | |||
import com.google.common.collect.ImmutableMap; | |||
import com.google.common.collect.Maps; | |||
import java.util.Collection; | |||
import java.util.Date; | |||
import java.util.List; | |||
import java.util.Map; | |||
import javax.annotation.CheckForNull; | |||
import javax.annotation.Nonnull; | |||
import org.sonar.api.issue.ActionPlan; | |||
import org.sonar.api.issue.Issue; | |||
import org.sonar.api.issue.IssueComment; | |||
import org.sonar.api.server.ServerSide; | |||
import org.sonar.api.utils.SonarException; | |||
import org.sonar.api.web.UserRole; | |||
import org.sonar.core.issue.DefaultIssueComment; | |||
import org.sonar.db.issue.IssueFilterDto; | |||
@@ -149,22 +146,6 @@ public class InternalRubyIssueService { | |||
return commentService.findComment(commentKey); | |||
} | |||
private static Date checkAndReturnDeadline(String deadLineParam, Result<ActionPlan> result) { | |||
Date deadLine = null; | |||
if (!Strings.isNullOrEmpty(deadLineParam)) { | |||
try { | |||
deadLine = RubyUtils.toDate(deadLineParam); | |||
Date today = new Date(); | |||
if (deadLine != null && deadLine.before(today) && !org.apache.commons.lang.time.DateUtils.isSameDay(deadLine, today)) { | |||
result.addError(Result.Message.ofL10n("action_plans.date_cant_be_in_past")); | |||
} | |||
} catch (SonarException e) { | |||
result.addError(Result.Message.ofL10n("errors.is_not_valid", "date")); | |||
} | |||
} | |||
return deadLine; | |||
} | |||
public List<String> listActions(String issueKey) { | |||
return actionService.listAvailableActions(issueKey); | |||
} |
@@ -32,7 +32,6 @@ import java.util.Set; | |||
import javax.annotation.Nullable; | |||
import org.apache.commons.lang.StringUtils; | |||
import org.apache.commons.lang.time.DateUtils; | |||
import org.sonar.api.issue.ActionPlan; | |||
import org.sonar.api.rules.RuleType; | |||
import org.sonar.api.server.ServerSide; | |||
import org.sonar.api.server.rule.RuleTagFormat; | |||
@@ -307,23 +306,6 @@ public class IssueUpdater { | |||
return false; | |||
} | |||
public boolean plan(DefaultIssue issue, @Nullable ActionPlan actionPlan, IssueChangeContext context) { | |||
String sanitizedActionPlanKey = null; | |||
if (actionPlan != null) { | |||
sanitizedActionPlanKey = StringUtils.defaultIfBlank(actionPlan.key(), null); | |||
} | |||
if (!Objects.equal(sanitizedActionPlanKey, issue.actionPlanKey())) { | |||
String newActionPlanName = actionPlan != null ? actionPlan.name() : null; | |||
issue.setFieldChange(context, ACTION_PLAN, UNUSED, newActionPlanName); | |||
issue.setActionPlanKey(sanitizedActionPlanKey); | |||
issue.setUpdateDate(context.date()); | |||
issue.setChanged(true); | |||
issue.setSendNotifications(true); | |||
return true; | |||
} | |||
return false; | |||
} | |||
public boolean setTags(DefaultIssue issue, Collection<String> tags, IssueChangeContext context) { | |||
Set<String> newTags = Sets.newHashSet(Collections2.transform( | |||
Collections2.filter(tags, new Predicate<String>() { |
@@ -55,7 +55,6 @@ import org.sonar.server.component.ws.ComponentsWsModule; | |||
import org.sonar.server.config.ws.PropertiesWs; | |||
import org.sonar.server.dashboard.template.GlobalDefaultDashboard; | |||
import org.sonar.server.dashboard.template.ProjectCustomDashboard; | |||
import org.sonar.server.dashboard.widget.ActionPlansWidget; | |||
import org.sonar.server.dashboard.widget.AlertsWidget; | |||
import org.sonar.server.dashboard.widget.BubbleChartWidget; | |||
import org.sonar.server.dashboard.widget.ComplexityWidget; | |||
@@ -371,7 +370,6 @@ public class PlatformLevel4 extends PlatformLevel { | |||
MeasureFilterAsBubbleChartWidget.class, | |||
ProjectFileCloudWidget.class, | |||
DebtOverviewWidget.class, | |||
ActionPlansWidget.class, | |||
IssueFilterWidget.class, | |||
ProjectIssueFilterWidget.class, | |||
IssueTagCloudWidget.class, |
@@ -1,97 +0,0 @@ | |||
<% | |||
# This widget should only be display on root projects | |||
if @project.qualifier == 'TRK' && has_role?(:user, @project) | |||
action_plans = Internal.issues.findActionPlanStats(@resource.key) | |||
open_action_plans = action_plans.select {|plan| plan.isOpen()} | |||
div_id = "issues-action-plan-widget-#{widget.id.to_s}" | |||
%> | |||
<div class="line-block"> | |||
<% if has_role?(:admin, @project) %> | |||
<div style="float:right"> | |||
<a href="<%= url_for :controller => 'action_plans', :action => 'index', :id => @project.id -%>"> | |||
<%= message('widgets.more') -%> | |||
</a> | |||
</div> | |||
<% end %> | |||
<h3><%= message('widget.action_plans.title') -%></h3> | |||
</div> | |||
<div id="<%= div_id -%>"> | |||
<% if open_action_plans.size ==0 %> | |||
<span class="empty_widget"><%= message('widget.action_plans.no_action_plan') -%></span> | |||
<% | |||
else | |||
show_resolved_issues = widget_properties["showResolvedIssues"] | |||
if show_resolved_issues | |||
line_class = "top" | |||
else | |||
line_class = "middle" | |||
max_unresolved_issues = open_action_plans.map {|plan| plan.unresolvedIssues()}.max | |||
end | |||
%> | |||
<table class="width100 <%= show_resolved_issues ? 'actionPlans' : 'data' -%>"> | |||
<thead> | |||
<tr> | |||
<th colspan="<%= show_resolved_issues ? '3' : '4' %>"></th> | |||
</tr> | |||
</thead> | |||
<tbody> | |||
<% | |||
open_action_plans.each do |plan| | |||
%> | |||
<tr class="<%= show_resolved_issues ? '' : cycle("even", "odd", :name => "action_plan_" + widget.id.to_s) -%>"> | |||
<td class="nowrap <%= line_class -%>"><%= h(plan.name) -%></td> | |||
<td class="nowrap small <%= line_class -%> <%= 'over-due' if plan.overDue() -%>" style="text-align: right; padding-left:10px"><%= format_date(plan.deadLine()) -%></td> | |||
<% if show_resolved_issues %> | |||
<% if plan.totalIssues()==0 %> | |||
<td class="noprogress nowrap <%= line_class -%>"><%= message('action_plans.no_issues_linked_to_action_plan') -%></td> | |||
<% else %> | |||
<td class="progress <%= line_class -%>"> | |||
<%= render :partial => 'action_plans/progress', :locals => {:action_plan => plan} -%> | |||
</td> | |||
<% end %> | |||
<% | |||
else | |||
unresolved_issues_size = plan.unresolvedIssues() | |||
%> | |||
<td class="right <%= line_class -%>" style="padding-left:20px"> | |||
<% if unresolved_issues_size == 0 %> | |||
<%= unresolved_issues_size -%> | |||
<% else %> | |||
<% | |||
search_options = {} | |||
search_options['actionPlans'] = plan.key | |||
search_options['resolved'] = false | |||
%> | |||
<a href="<%= url_for_component_issues(@project, search_options) -%>" | |||
title="<%= message('widget.action_plans.x_unresolved_issues', :params => unresolved_issues_size.to_s) -%>"><%= unresolved_issues_size -%></a> | |||
<% end %> | |||
</td> | |||
<td class="<%= line_class -%>" style="padding: 0 40px 0 10px; width: 300px;"> | |||
<div class="barchart" style="width: 100%"> | |||
<div style="width: <%= max_unresolved_issues > 0 ? 100 * unresolved_issues_size / max_unresolved_issues : 0 -%>%;background-color:#777;"></div> | |||
</div> | |||
</td> | |||
<% end %> | |||
</tr> | |||
<% | |||
end | |||
%> | |||
</tbody> | |||
</table> | |||
<% end %> | |||
</div> | |||
<% end %> |
@@ -181,7 +181,7 @@ public class IssueAssignerTest { | |||
underTest.onIssue(FILE, issue); | |||
assertThat(logTester.logs(LoggerLevel.WARN)).containsOnly( | |||
"No SCM info has been found for issue DefaultIssue[key=<null>,type=VULNERABILITY,componentUuid=<null>,componentKey=<null>,moduleUuid=<null>,moduleUuidPath=<null>,projectUuid=<null>,projectKey=<null>,ruleKey=<null>,language=<null>,severity=<null>,manualSeverity=false,message=<null>,line=2,gap=<null>,effort=<null>,status=<null>,resolution=<null>,reporter=<null>,assignee=<null>,checksum=<null>,attributes=<null>,authorLogin=<null>,actionPlanKey=<null>,comments=<null>,tags=<null>,locations=<null>,creationDate=<null>,updateDate=<null>,closeDate=<null>,currentChange=<null>,changes=<null>,isNew=true,beingClosed=false,onDisabledRule=false,isChanged=false,sendNotifications=false,selectedAt=<null>]"); | |||
"No SCM info has been found for issue DefaultIssue[key=<null>,type=VULNERABILITY,componentUuid=<null>,componentKey=<null>,moduleUuid=<null>,moduleUuidPath=<null>,projectUuid=<null>,projectKey=<null>,ruleKey=<null>,language=<null>,severity=<null>,manualSeverity=false,message=<null>,line=2,gap=<null>,effort=<null>,status=<null>,resolution=<null>,reporter=<null>,assignee=<null>,checksum=<null>,attributes=<null>,authorLogin=<null>,comments=<null>,tags=<null>,locations=<null>,creationDate=<null>,updateDate=<null>,closeDate=<null>,currentChange=<null>,changes=<null>,isNew=true,beingClosed=false,onDisabledRule=false,isChanged=false,sendNotifications=false,selectedAt=<null>]"); | |||
} | |||
private void setSingleChangeset(String author, Long date, String revision) { |
@@ -110,7 +110,6 @@ public class IssueLifecycleTest { | |||
.setCreationDate(parseDate("2015-01-01")) | |||
.setUpdateDate(parseDate("2015-01-02")) | |||
.setCloseDate(parseDate("2015-01-03")) | |||
.setActionPlanKey("BASE_ACTION_PLAN_KEY") | |||
.setResolution(RESOLUTION_FIXED) | |||
.setStatus(STATUS_CLOSED) | |||
.setSeverity(BLOCKER) | |||
@@ -135,7 +134,6 @@ public class IssueLifecycleTest { | |||
assertThat(raw.creationDate()).isEqualTo(base.creationDate()); | |||
assertThat(raw.updateDate()).isEqualTo(base.updateDate()); | |||
assertThat(raw.closeDate()).isEqualTo(base.closeDate()); | |||
assertThat(raw.actionPlanKey()).isEqualTo("BASE_ACTION_PLAN_KEY"); | |||
assertThat(raw.resolution()).isEqualTo(RESOLUTION_FIXED); | |||
assertThat(raw.status()).isEqualTo(STATUS_CLOSED); | |||
assertThat(raw.assignee()).isEqualTo("base assignee"); |
@@ -154,7 +154,6 @@ public class TrackerRawInputFactoryTest { | |||
assertThat(issue.resolution()).isNull(); | |||
assertThat(issue.status()).isEqualTo(Issue.STATUS_OPEN); | |||
assertThat(issue.key()).isNull(); | |||
assertThat(issue.actionPlanKey()).isNull(); | |||
assertThat(issue.authorLogin()).isNull(); | |||
assertThat(issue.debt()).isNull(); | |||
} |
@@ -82,7 +82,6 @@ public class UpdateConflictResolverTest { | |||
// Before starting scan | |||
issue.setAssignee(null); | |||
issue.setActionPlanKey("PLAN-1"); | |||
issue.setCreationDate(DateUtils.parseDate("2012-01-01")); | |||
issue.setUpdateDate(DateUtils.parseDate("2012-02-02")); | |||
@@ -123,7 +122,6 @@ public class UpdateConflictResolverTest { | |||
assertThat(issue.assignee()).isEqualTo("arthur"); | |||
assertThat(issue.resolution()).isEqualTo(Issue.RESOLUTION_FALSE_POSITIVE); | |||
assertThat(issue.status()).isEqualTo(Issue.STATUS_RESOLVED); | |||
assertThat(issue.actionPlanKey()).isEqualTo("PLAN-2"); | |||
} | |||
@Test |
@@ -24,17 +24,14 @@ import org.junit.Before; | |||
import org.junit.Rule; | |||
import org.junit.Test; | |||
import org.junit.rules.ExpectedException; | |||
import org.sonar.api.issue.ActionPlan; | |||
import org.sonar.api.user.User; | |||
import org.sonar.api.utils.Duration; | |||
import org.sonar.core.issue.DefaultActionPlan; | |||
import org.sonar.core.issue.DefaultIssue; | |||
import org.sonar.core.issue.FieldDiffs; | |||
import org.sonar.core.issue.IssueChangeContext; | |||
import org.sonar.core.user.DefaultUser; | |||
import static org.assertj.core.api.Assertions.assertThat; | |||
import static org.sonar.server.issue.IssueUpdater.ACTION_PLAN; | |||
import static org.sonar.server.issue.IssueUpdater.ASSIGNEE; | |||
import static org.sonar.server.issue.IssueUpdater.RESOLUTION; | |||
import static org.sonar.server.issue.IssueUpdater.SEVERITY; | |||
@@ -353,62 +350,6 @@ public class IssueUpdaterTest { | |||
assertThat(issue.mustSendNotifications()).isFalse(); | |||
} | |||
@Test | |||
public void plan_with_no_existing_plan() { | |||
ActionPlan newActionPlan = DefaultActionPlan.create("newName"); | |||
boolean updated = updater.plan(issue, newActionPlan, context); | |||
assertThat(updated).isTrue(); | |||
assertThat(issue.actionPlanKey()).isEqualTo(newActionPlan.key()); | |||
FieldDiffs.Diff diff = issue.currentChange().get(ACTION_PLAN); | |||
assertThat(diff.oldValue()).isEqualTo(UNUSED); | |||
assertThat(diff.newValue()).isEqualTo("newName"); | |||
assertThat(issue.mustSendNotifications()).isTrue(); | |||
} | |||
@Test | |||
public void plan_with_existing_plan() { | |||
issue.setActionPlanKey("formerActionPlan"); | |||
ActionPlan newActionPlan = DefaultActionPlan.create("newName").setKey("newKey"); | |||
boolean updated = updater.plan(issue, newActionPlan, context); | |||
assertThat(updated).isTrue(); | |||
assertThat(issue.actionPlanKey()).isEqualTo(newActionPlan.key()); | |||
FieldDiffs.Diff diff = issue.currentChange().get(ACTION_PLAN); | |||
assertThat(diff.oldValue()).isEqualTo(UNUSED); | |||
assertThat(diff.newValue()).isEqualTo("newName"); | |||
assertThat(issue.mustSendNotifications()).isTrue(); | |||
} | |||
@Test | |||
public void unplan() { | |||
issue.setActionPlanKey("formerActionPlan"); | |||
boolean updated = updater.plan(issue, null, context); | |||
assertThat(updated).isTrue(); | |||
assertThat(issue.actionPlanKey()).isNull(); | |||
FieldDiffs.Diff diff = issue.currentChange().get(ACTION_PLAN); | |||
assertThat(diff.oldValue()).isEqualTo(UNUSED); | |||
assertThat(diff.newValue()).isNull(); | |||
assertThat(issue.mustSendNotifications()).isTrue(); | |||
} | |||
@Test | |||
public void not_plan_again() { | |||
issue.setActionPlanKey("existingActionPlan"); | |||
ActionPlan newActionPlan = DefaultActionPlan.create("existingActionPlan").setKey("existingActionPlan"); | |||
boolean updated = updater.plan(issue, newActionPlan, context); | |||
assertThat(updated).isFalse(); | |||
assertThat(issue.currentChange()).isNull(); | |||
assertThat(issue.mustSendNotifications()).isFalse(); | |||
} | |||
@Test | |||
public void set_effort_to_fix() { | |||
boolean updated = updater.setGap(issue, 3.14, context); |
@@ -1,145 +0,0 @@ | |||
/* | |||
* SonarQube | |||
* Copyright (C) 2009-2016 SonarSource SA | |||
* mailto:contact AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | |||
* version 3 of the License, or (at your option) any later version. | |||
* | |||
* This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* Lesser General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU Lesser General Public License | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.core.issue; | |||
import java.util.Date; | |||
import javax.annotation.CheckForNull; | |||
import javax.annotation.Nullable; | |||
import org.sonar.api.issue.ActionPlan; | |||
import org.sonar.core.util.Uuids; | |||
public class DefaultActionPlan implements ActionPlan { | |||
private String key; | |||
private String name; | |||
private String projectKey; | |||
private String description; | |||
private String userLogin; | |||
private String status; | |||
private Date deadLine; | |||
private Date createdAt; | |||
private Date updatedAt; | |||
public DefaultActionPlan() { | |||
} | |||
public static DefaultActionPlan create(String name) { | |||
DefaultActionPlan actionPlan = new DefaultActionPlan(); | |||
actionPlan.setKey(Uuids.create()); | |||
Date now = new Date(); | |||
actionPlan.setName(name); | |||
actionPlan.setStatus(ActionPlan.STATUS_OPEN); | |||
actionPlan.setCreatedAt(now).setUpdatedAt(now); | |||
return actionPlan; | |||
} | |||
@Override | |||
public String key() { | |||
return key; | |||
} | |||
public DefaultActionPlan setKey(String key) { | |||
this.key = key; | |||
return this; | |||
} | |||
@Override | |||
public String name() { | |||
return name; | |||
} | |||
public DefaultActionPlan setName(String name) { | |||
this.name = name; | |||
return this; | |||
} | |||
@Override | |||
public String projectKey() { | |||
return projectKey; | |||
} | |||
public DefaultActionPlan setProjectKey(String projectKey) { | |||
this.projectKey = projectKey; | |||
return this; | |||
} | |||
@Override | |||
@CheckForNull | |||
public String description() { | |||
return description; | |||
} | |||
public DefaultActionPlan setDescription(@Nullable String description) { | |||
this.description = description; | |||
return this; | |||
} | |||
@Override | |||
public String userLogin() { | |||
return userLogin; | |||
} | |||
public DefaultActionPlan setUserLogin(String userLogin) { | |||
this.userLogin = userLogin; | |||
return this; | |||
} | |||
@Override | |||
public String status() { | |||
return status; | |||
} | |||
public DefaultActionPlan setStatus(String status) { | |||
this.status = status; | |||
return this; | |||
} | |||
@Override | |||
@CheckForNull | |||
public Date deadLine() { | |||
return deadLine != null ? new Date(deadLine.getTime()) : null; | |||
} | |||
public DefaultActionPlan setDeadLine(@Nullable Date deadLine) { | |||
this.deadLine = deadLine != null ? new Date(deadLine.getTime()) : null; | |||
return this; | |||
} | |||
@Override | |||
public Date createdAt() { | |||
return createdAt; | |||
} | |||
public DefaultActionPlan setCreatedAt(Date createdAt) { | |||
this.createdAt = createdAt; | |||
return this; | |||
} | |||
@Override | |||
public Date updatedAt() { | |||
return updatedAt; | |||
} | |||
public DefaultActionPlan setUpdatedAt(Date updatedAt) { | |||
this.updatedAt = updatedAt; | |||
return this; | |||
} | |||
} |
@@ -80,7 +80,6 @@ public class DefaultIssue implements Issue, Trackable, org.sonar.api.ce.measure. | |||
private String checksum; | |||
private Map<String, String> attributes = null; | |||
private String authorLogin = null; | |||
private String actionPlanKey; | |||
private List<IssueComment> comments = null; | |||
private Set<String> tags = null; | |||
// temporarily an Object as long as DefaultIssue is used by sonar-batch | |||
@@ -507,12 +506,8 @@ public class DefaultIssue implements Issue, Trackable, org.sonar.api.ce.measure. | |||
@Override | |||
@CheckForNull | |||
public String actionPlanKey() { | |||
return actionPlanKey; | |||
} | |||
public DefaultIssue setActionPlanKey(@Nullable String actionPlanKey) { | |||
this.actionPlanKey = actionPlanKey; | |||
return this; | |||
// In 5.5, action plan is dropped. | |||
return null; | |||
} | |||
public DefaultIssue setFieldChange(IssueChangeContext context, String field, @Nullable Serializable oldValue, @Nullable Serializable newValue) { |
@@ -51,7 +51,6 @@ public class DefaultIssueTest { | |||
.setLine(7) | |||
.setGap(1.2d) | |||
.setEffort(Duration.create(28800L)) | |||
.setActionPlanKey("BCDE") | |||
.setStatus(Issue.STATUS_CLOSED) | |||
.setResolution(Issue.RESOLUTION_FIXED) | |||
.setReporter("simon") | |||
@@ -79,7 +78,6 @@ public class DefaultIssueTest { | |||
assertThat(issue.line()).isEqualTo(7); | |||
assertThat(issue.effortToFix()).isEqualTo(1.2d); | |||
assertThat(issue.debt()).isEqualTo(Duration.create(28800L)); | |||
assertThat(issue.actionPlanKey()).isEqualTo("BCDE"); | |||
assertThat(issue.status()).isEqualTo(Issue.STATUS_CLOSED); | |||
assertThat(issue.resolution()).isEqualTo(Issue.RESOLUTION_FIXED); | |||
assertThat(issue.reporter()).isEqualTo("simon"); |
@@ -1,58 +0,0 @@ | |||
/* | |||
* SonarQube | |||
* Copyright (C) 2009-2016 SonarSource SA | |||
* mailto:contact AT sonarsource DOT com | |||
* | |||
* This program is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | |||
* version 3 of the License, or (at your option) any later version. | |||
* | |||
* This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* Lesser General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU Lesser General Public License | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.api.issue; | |||
import javax.annotation.CheckForNull; | |||
import java.io.Serializable; | |||
import java.util.Date; | |||
/** | |||
* @since 3.6 | |||
*/ | |||
public interface ActionPlan extends Serializable { | |||
String STATUS_OPEN = "OPEN"; | |||
String STATUS_CLOSED = "CLOSED"; | |||
/** | |||
* Unique generated key | |||
*/ | |||
String key(); | |||
String name(); | |||
String projectKey(); | |||
@CheckForNull | |||
String description(); | |||
String userLogin(); | |||
String status(); | |||
@CheckForNull | |||
Date deadLine() ; | |||
Date createdAt(); | |||
Date updatedAt(); | |||
} |
@@ -176,6 +176,10 @@ public interface Issue extends Serializable { | |||
@CheckForNull | |||
String authorLogin(); | |||
/** | |||
* @deprecated since 5.5 Action plans are dropped in 5.5. This field has no effect | |||
*/ | |||
@Deprecated | |||
@CheckForNull | |||
String actionPlanKey(); | |||
@@ -103,13 +103,6 @@ public class DeprecatedIssueAdapterForFilterTest { | |||
assertThat(e).isExactlyInstanceOf(UnsupportedOperationException.class).hasMessage("Not available for issues filters"); | |||
} | |||
try { | |||
issue.actionPlanKey(); | |||
fail("Should be unsupported"); | |||
} catch (Exception e) { | |||
assertThat(e).isExactlyInstanceOf(UnsupportedOperationException.class).hasMessage("Not available for issues filters"); | |||
} | |||
try { | |||
issue.comments(); | |||
fail("Should be unsupported"); |
@@ -65,7 +65,6 @@ public class TrackedIssueAdapterTest { | |||
assertThat(issue.updateDate()).isNull(); | |||
assertThat(issue.closeDate()).isNull(); | |||
assertThat(issue.authorLogin()).isNull(); | |||
assertThat(issue.actionPlanKey()).isNull(); | |||
assertThat(issue.comments()).isEmpty(); | |||
assertThat(issue.debt()).isNull(); | |||
assertThat(issue.projectKey()).isNull(); |