From 7652deb6f19e3bc4ed062a34f3a04b47cd89fbfe Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Thu, 30 May 2013 11:13:00 +0200 Subject: [PATCH] Fix some quality flaws --- .../SendIssueNotificationsPostJob.java | 5 ++- .../core/issue/tracking/SourceChecksum.java | 3 +- .../ViolationTrackingBlocksRecognizer.java | 6 ++- .../core/notifications/alerts/NewAlerts.java | 16 ++++--- .../SendIssueNotificationsPostJobTest.java | 43 ++++++++++++++++++ .../notifications/alerts/NewAlertsTest.java | 45 ++++++++----------- .../sonar/core/issue/IssueNotifications.java | 42 +++++++++-------- sonar-server/src/dev/web.xml | 2 +- .../server/issue/DefaultIssueFinder.java | 2 +- .../issue/InternalRubyIssueService.java | 2 +- .../server/issue/IssueCommentService.java | 2 +- .../org/sonar/server/issue/IssueService.java | 2 +- .../sonar/server/issue/IssueStatsFinder.java | 2 +- .../sonar/server/rule/RubyRuleService.java | 2 +- .../{platform => user}/UserSession.java | 7 ++- .../{platform => user}/UserSessionFilter.java | 5 ++- sonar-server/src/main/webapp/WEB-INF/web.xml | 2 +- .../server/rule/RubyRuleServiceTest.java | 2 +- .../UserSessionFilterTest.java | 3 +- .../{platform => user}/UserSessionTest.java | 3 +- 20 files changed, 127 insertions(+), 69 deletions(-) rename sonar-server/src/main/java/org/sonar/server/{platform => user}/UserSession.java (96%) rename sonar-server/src/main/java/org/sonar/server/{platform => user}/UserSessionFilter.java (96%) rename sonar-server/src/test/java/org/sonar/server/{platform => user}/UserSessionFilterTest.java (98%) rename sonar-server/src/test/java/org/sonar/server/{platform => user}/UserSessionTest.java (97%) diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/issue/notification/SendIssueNotificationsPostJob.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/issue/notification/SendIssueNotificationsPostJob.java index 7bfa21586c9..8f758e0ea1a 100644 --- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/issue/notification/SendIssueNotificationsPostJob.java +++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/issue/notification/SendIssueNotificationsPostJob.java @@ -58,7 +58,10 @@ public class SendIssueNotificationsPostJob implements PostJob { } if (issue.isChanged() && issue.diffs() != null) { Rule rule = ruleFinder.findByKey(issue.ruleKey()); - notifications.sendChanges(issue, context, rule, project, null); + // TODO warning - rules with status REMOVED are currently ignored, but should not + if (rule != null) { + notifications.sendChanges(issue, context, rule, project, null); + } } } if (newIssues > 0) { diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/issue/tracking/SourceChecksum.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/issue/tracking/SourceChecksum.java index b797bf4d1f2..5662276aee1 100644 --- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/issue/tracking/SourceChecksum.java +++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/issue/tracking/SourceChecksum.java @@ -23,6 +23,7 @@ import com.google.common.collect.Lists; import org.apache.commons.codec.digest.DigestUtils; import org.apache.commons.lang.StringUtils; +import javax.annotation.Nullable; import java.util.List; public final class SourceChecksum { @@ -37,7 +38,7 @@ public final class SourceChecksum { * @param line line number (first line has number 1) * @return checksum or null if checksum not exists for line */ - public static String getChecksumForLine(List checksums, Integer line) { + public static String getChecksumForLine(List checksums, @Nullable Integer line) { if (line == null || line < 1 || line > checksums.size()) { return null; } diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/issue/tracking/ViolationTrackingBlocksRecognizer.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/issue/tracking/ViolationTrackingBlocksRecognizer.java index b1965882a73..2a191e3d62e 100644 --- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/issue/tracking/ViolationTrackingBlocksRecognizer.java +++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/issue/tracking/ViolationTrackingBlocksRecognizer.java @@ -25,6 +25,8 @@ import org.sonar.plugins.core.issue.tracking.HashedSequenceComparator; import org.sonar.plugins.core.issue.tracking.StringText; import org.sonar.plugins.core.issue.tracking.StringTextComparator; +import javax.annotation.Nullable; + public class ViolationTrackingBlocksRecognizer { private final HashedSequence a; @@ -44,11 +46,11 @@ public class ViolationTrackingBlocksRecognizer { this.cmp = cmp; } - public boolean isValidLineInReference(Integer line) { + public boolean isValidLineInReference(@Nullable Integer line) { return (line != null) && (0 <= line - 1) && (line - 1 < a.length()); } - public boolean isValidLineInSource(Integer line) { + public boolean isValidLineInSource(@Nullable Integer line) { return (line != null) && (0 <= line - 1) && (line - 1 < b.length()); } diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/notifications/alerts/NewAlerts.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/notifications/alerts/NewAlerts.java index 1a521145516..606fd22a34a 100644 --- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/notifications/alerts/NewAlerts.java +++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/notifications/alerts/NewAlerts.java @@ -53,15 +53,17 @@ public class NewAlerts extends NotificationDispatcher { @Override public void dispatch(Notification notification, Context context) { - int projectId = Integer.parseInt(notification.getFieldValue("projectId")); - Multimap subscribedRecipients = notifications.findSubscribedRecipientsForDispatcher(this, projectId); + String projectIdString = notification.getFieldValue("projectId"); + if (projectIdString != null) { + int projectId = Integer.parseInt(projectIdString); + Multimap subscribedRecipients = notifications.findSubscribedRecipientsForDispatcher(this, projectId); - for (Map.Entry> channelsByRecipients : subscribedRecipients.asMap().entrySet()) { - String userLogin = channelsByRecipients.getKey(); - for (NotificationChannel channel : channelsByRecipients.getValue()) { - context.addUser(userLogin, channel); + for (Map.Entry> channelsByRecipients : subscribedRecipients.asMap().entrySet()) { + String userLogin = channelsByRecipients.getKey(); + for (NotificationChannel channel : channelsByRecipients.getValue()) { + context.addUser(userLogin, channel); + } } } } - } diff --git a/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/issue/notification/SendIssueNotificationsPostJobTest.java b/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/issue/notification/SendIssueNotificationsPostJobTest.java index 66943aa710b..2262e3e80f1 100644 --- a/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/issue/notification/SendIssueNotificationsPostJobTest.java +++ b/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/issue/notification/SendIssueNotificationsPostJobTest.java @@ -24,11 +24,16 @@ import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.runners.MockitoJUnitRunner; import org.sonar.api.batch.SensorContext; +import org.sonar.api.component.Component; +import org.sonar.api.issue.Issue; import org.sonar.api.resources.Project; +import org.sonar.api.rule.RuleKey; +import org.sonar.api.rules.Rule; import org.sonar.api.rules.RuleFinder; import org.sonar.api.utils.DateUtils; import org.sonar.batch.issue.IssueCache; import org.sonar.core.issue.DefaultIssue; +import org.sonar.core.issue.IssueChangeContext; import org.sonar.core.issue.IssueNotifications; import java.util.Arrays; @@ -78,4 +83,42 @@ public class SendIssueNotificationsPostJobTest { verifyZeroInteractions(notifications); } + + @Test + public void should_send_notif_if_issue_change() throws Exception { + + when(project.getAnalysisDate()).thenReturn(DateUtils.parseDate("2013-05-18")); + RuleKey ruleKey = RuleKey.of("squid", "AvoidCycles"); + Rule rule = new Rule("squid", "AvoidCycles"); + DefaultIssue issue = new DefaultIssue() + .setChanged(true) + .setFieldDiff(mock(IssueChangeContext.class), "severity", "MINOR", "BLOCKER") + .setRuleKey(ruleKey); + when(issueCache.all()).thenReturn(Arrays.asList(issue)); + when(ruleFinder.findByKey(ruleKey)).thenReturn(rule); + + SendIssueNotificationsPostJob job = new SendIssueNotificationsPostJob(issueCache, notifications, ruleFinder); + job.executeOn(project, sensorContext); + + verify(notifications).sendChanges(eq(issue), any(IssueChangeContext.class), eq(rule), any(Component.class), (Component)isNull()); + } + + @Test + public void should_not_send_notif_if_issue_change_on_removed_rule() throws Exception { + IssueChangeContext changeContext = mock(IssueChangeContext.class); + + when(project.getAnalysisDate()).thenReturn(DateUtils.parseDate("2013-05-18")); + RuleKey ruleKey = RuleKey.of("squid", "AvoidCycles"); + DefaultIssue issue = new DefaultIssue() + .setChanged(true) + .setFieldDiff(changeContext, "severity", "MINOR", "BLOCKER") + .setRuleKey(ruleKey); + when(issueCache.all()).thenReturn(Arrays.asList(issue)); + when(ruleFinder.findByKey(ruleKey)).thenReturn(null); + + SendIssueNotificationsPostJob job = new SendIssueNotificationsPostJob(issueCache, notifications, ruleFinder); + job.executeOn(project, sensorContext); + + verify(notifications, never()).sendChanges(eq(issue), eq(changeContext), any(Rule.class), any(Component.class), any(Component.class)); + } } diff --git a/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/notifications/alerts/NewAlertsTest.java b/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/notifications/alerts/NewAlertsTest.java index b1fa5976b2e..8fdab8da824 100644 --- a/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/notifications/alerts/NewAlertsTest.java +++ b/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/notifications/alerts/NewAlertsTest.java @@ -21,42 +21,22 @@ package org.sonar.plugins.core.notifications.alerts; import com.google.common.collect.HashMultimap; import com.google.common.collect.Multimap; -import org.junit.Before; import org.junit.Test; -import org.mockito.Mock; -import org.mockito.MockitoAnnotations; import org.sonar.api.notifications.Notification; import org.sonar.api.notifications.NotificationChannel; import org.sonar.api.notifications.NotificationDispatcher; import org.sonar.api.notifications.NotificationManager; import static org.mockito.Matchers.any; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.verifyNoMoreInteractions; -import static org.mockito.Mockito.when; +import static org.mockito.Mockito.*; public class NewAlertsTest { - @Mock - private NotificationManager notificationManager; - - @Mock - private NotificationDispatcher.Context context; - - @Mock - private NotificationChannel emailChannel; - - @Mock - private NotificationChannel twitterChannel; - - private NewAlerts dispatcher; - - @Before - public void init() { - MockitoAnnotations.initMocks(this); - dispatcher = new NewAlerts(notificationManager); - } + NotificationManager notificationManager = mock(NotificationManager.class); + NotificationDispatcher.Context context = mock(NotificationDispatcher.Context.class); + NotificationChannel emailChannel = mock(NotificationChannel.class); + NotificationChannel twitterChannel = mock(NotificationChannel.class); + NewAlerts dispatcher = new NewAlerts(notificationManager); @Test public void should_not_dispatch_if_not_alerts_notification() throws Exception { @@ -81,4 +61,17 @@ public class NewAlertsTest { verifyNoMoreInteractions(context); } + @Test + public void should_not_dispatch_if_missing_project_id() { + Multimap recipients = HashMultimap.create(); + recipients.put("user1", emailChannel); + recipients.put("user2", twitterChannel); + when(notificationManager.findSubscribedRecipientsForDispatcher(dispatcher, 34)).thenReturn(recipients); + + Notification notification = new Notification("alerts"); + dispatcher.performDispatch(notification, context); + + verifyNoMoreInteractions(context); + } + } diff --git a/sonar-core/src/main/java/org/sonar/core/issue/IssueNotifications.java b/sonar-core/src/main/java/org/sonar/core/issue/IssueNotifications.java index b57f001b3da..0fc2debfc09 100644 --- a/sonar-core/src/main/java/org/sonar/core/issue/IssueNotifications.java +++ b/sonar-core/src/main/java/org/sonar/core/issue/IssueNotifications.java @@ -30,6 +30,7 @@ import org.sonar.api.rules.Rule; import org.sonar.api.utils.DateUtils; import org.sonar.core.i18n.RuleI18nManager; +import javax.annotation.CheckForNull; import javax.annotation.Nullable; import java.util.Locale; import java.util.Map; @@ -58,31 +59,36 @@ public class IssueNotifications implements BatchComponent, ServerComponent { return notification; } + @CheckForNull public Notification sendChanges(DefaultIssue issue, IssueChangeContext context, IssueQueryResult queryResult) { return sendChanges(issue, context, queryResult.rule(issue), queryResult.project(issue), queryResult.component(issue)); } + @CheckForNull public Notification sendChanges(DefaultIssue issue, IssueChangeContext context, Rule rule, Component project, @Nullable Component component) { - Notification notification = newNotification(project, "issue-changes"); - notification.setFieldValue("key", issue.key()); - notification.setFieldValue("changeAuthor", context.login()); - notification.setFieldValue("reporter", issue.reporter()); - notification.setFieldValue("assignee", issue.assignee()); - notification.setFieldValue("message", issue.message()); - notification.setFieldValue("ruleName", ruleName(rule)); - notification.setFieldValue("componentKey", issue.componentKey()); - if (component != null) { - notification.setFieldValue("componentName", component.name()); - } + if (issue.diffs() != null) { + Notification notification = newNotification(project, "issue-changes"); + notification.setFieldValue("key", issue.key()); + notification.setFieldValue("changeAuthor", context.login()); + notification.setFieldValue("reporter", issue.reporter()); + notification.setFieldValue("assignee", issue.assignee()); + notification.setFieldValue("message", issue.message()); + notification.setFieldValue("ruleName", ruleName(rule)); + notification.setFieldValue("componentKey", issue.componentKey()); + if (component != null) { + notification.setFieldValue("componentName", component.name()); + } - for (Map.Entry entry : issue.diffs().diffs().entrySet()) { - String type = entry.getKey(); - FieldDiffs.Diff diff = entry.getValue(); - notification.setFieldValue("old." + type, diff.oldValue() != null ? diff.oldValue().toString() : null); - notification.setFieldValue("new." + type, diff.newValue() != null ? diff.newValue().toString() : null); + for (Map.Entry entry : issue.diffs().diffs().entrySet()) { + String type = entry.getKey(); + FieldDiffs.Diff diff = entry.getValue(); + notification.setFieldValue("old." + type, diff.oldValue() != null ? diff.oldValue().toString() : null); + notification.setFieldValue("new." + type, diff.newValue() != null ? diff.newValue().toString() : null); + } + notificationsManager.scheduleForSending(notification); + return notification; } - notificationsManager.scheduleForSending(notification); - return notification; + return null; } private String ruleName(@Nullable Rule rule) { diff --git a/sonar-server/src/dev/web.xml b/sonar-server/src/dev/web.xml index 73445144d8b..fef16ea1aaf 100644 --- a/sonar-server/src/dev/web.xml +++ b/sonar-server/src/dev/web.xml @@ -42,7 +42,7 @@ UserSessionFilter - org.sonar.server.platform.UserSessionFilter + org.sonar.server.user.UserSessionFilter RackFilter diff --git a/sonar-server/src/main/java/org/sonar/server/issue/DefaultIssueFinder.java b/sonar-server/src/main/java/org/sonar/server/issue/DefaultIssueFinder.java index 0f099d0f259..c983cac184d 100644 --- a/sonar-server/src/main/java/org/sonar/server/issue/DefaultIssueFinder.java +++ b/sonar-server/src/main/java/org/sonar/server/issue/DefaultIssueFinder.java @@ -40,7 +40,7 @@ import org.sonar.core.persistence.MyBatis; import org.sonar.core.resource.ResourceDao; import org.sonar.core.rule.DefaultRuleFinder; import org.sonar.core.user.AuthorizationDao; -import org.sonar.server.platform.UserSession; +import org.sonar.server.user.UserSession; import java.util.Collection; import java.util.List; diff --git a/sonar-server/src/main/java/org/sonar/server/issue/InternalRubyIssueService.java b/sonar-server/src/main/java/org/sonar/server/issue/InternalRubyIssueService.java index 1b4ac5a61b2..05ea65440dd 100644 --- a/sonar-server/src/main/java/org/sonar/server/issue/InternalRubyIssueService.java +++ b/sonar-server/src/main/java/org/sonar/server/issue/InternalRubyIssueService.java @@ -38,7 +38,7 @@ import org.sonar.core.issue.workflow.Transition; import org.sonar.core.resource.ResourceDao; import org.sonar.core.resource.ResourceDto; import org.sonar.core.resource.ResourceQuery; -import org.sonar.server.platform.UserSession; +import org.sonar.server.user.UserSession; import org.sonar.server.util.RubyUtils; import javax.annotation.Nullable; diff --git a/sonar-server/src/main/java/org/sonar/server/issue/IssueCommentService.java b/sonar-server/src/main/java/org/sonar/server/issue/IssueCommentService.java index 5095ce59d37..8a518028514 100644 --- a/sonar-server/src/main/java/org/sonar/server/issue/IssueCommentService.java +++ b/sonar-server/src/main/java/org/sonar/server/issue/IssueCommentService.java @@ -31,7 +31,7 @@ import org.sonar.core.issue.IssueUpdater; import org.sonar.core.issue.db.IssueChangeDao; import org.sonar.core.issue.db.IssueChangeDto; import org.sonar.core.issue.db.IssueStorage; -import org.sonar.server.platform.UserSession; +import org.sonar.server.user.UserSession; import java.util.Date; diff --git a/sonar-server/src/main/java/org/sonar/server/issue/IssueService.java b/sonar-server/src/main/java/org/sonar/server/issue/IssueService.java index b3f8b8521f6..27f0b0efbbc 100644 --- a/sonar-server/src/main/java/org/sonar/server/issue/IssueService.java +++ b/sonar-server/src/main/java/org/sonar/server/issue/IssueService.java @@ -34,7 +34,7 @@ import org.sonar.core.issue.IssueUpdater; import org.sonar.core.issue.db.IssueStorage; import org.sonar.core.issue.workflow.IssueWorkflow; import org.sonar.core.issue.workflow.Transition; -import org.sonar.server.platform.UserSession; +import org.sonar.server.user.UserSession; import javax.annotation.Nullable; diff --git a/sonar-server/src/main/java/org/sonar/server/issue/IssueStatsFinder.java b/sonar-server/src/main/java/org/sonar/server/issue/IssueStatsFinder.java index a19829113f0..561272244d4 100644 --- a/sonar-server/src/main/java/org/sonar/server/issue/IssueStatsFinder.java +++ b/sonar-server/src/main/java/org/sonar/server/issue/IssueStatsFinder.java @@ -29,7 +29,7 @@ import org.sonar.api.user.User; import org.sonar.api.user.UserFinder; import org.sonar.core.issue.db.IssueStatsColumn; import org.sonar.core.issue.db.IssueStatsDao; -import org.sonar.server.platform.UserSession; +import org.sonar.server.user.UserSession; import javax.annotation.CheckForNull; diff --git a/sonar-server/src/main/java/org/sonar/server/rule/RubyRuleService.java b/sonar-server/src/main/java/org/sonar/server/rule/RubyRuleService.java index 9a61e560eae..0bd88c37885 100644 --- a/sonar-server/src/main/java/org/sonar/server/rule/RubyRuleService.java +++ b/sonar-server/src/main/java/org/sonar/server/rule/RubyRuleService.java @@ -23,7 +23,7 @@ import org.picocontainer.Startable; import org.sonar.api.ServerComponent; import org.sonar.api.rules.Rule; import org.sonar.core.i18n.RuleI18nManager; -import org.sonar.server.platform.UserSession; +import org.sonar.server.user.UserSession; /** * Used through ruby code
Internal.rules
diff --git a/sonar-server/src/main/java/org/sonar/server/platform/UserSession.java b/sonar-server/src/main/java/org/sonar/server/user/UserSession.java similarity index 96% rename from sonar-server/src/main/java/org/sonar/server/platform/UserSession.java rename to sonar-server/src/main/java/org/sonar/server/user/UserSession.java index c81409d11cd..87fbe6a1368 100644 --- a/sonar-server/src/main/java/org/sonar/server/platform/UserSession.java +++ b/sonar-server/src/main/java/org/sonar/server/user/UserSession.java @@ -17,7 +17,7 @@ * 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.platform; +package org.sonar.server.user; import com.google.common.base.Objects; import org.sonar.server.ui.JRubyI18n; @@ -26,6 +26,11 @@ import javax.annotation.CheckForNull; import javax.annotation.Nullable; import java.util.Locale; +/** + * Part of the current HTTP session + * + * @since 3.6 + */ public class UserSession { private static final ThreadLocal THREAD_LOCAL = new ThreadLocal(); diff --git a/sonar-server/src/main/java/org/sonar/server/platform/UserSessionFilter.java b/sonar-server/src/main/java/org/sonar/server/user/UserSessionFilter.java similarity index 96% rename from sonar-server/src/main/java/org/sonar/server/platform/UserSessionFilter.java rename to sonar-server/src/main/java/org/sonar/server/user/UserSessionFilter.java index 87274425de7..80b6613a56c 100644 --- a/sonar-server/src/main/java/org/sonar/server/platform/UserSessionFilter.java +++ b/sonar-server/src/main/java/org/sonar/server/user/UserSessionFilter.java @@ -17,11 +17,14 @@ * 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.platform; +package org.sonar.server.user; import javax.servlet.*; import java.io.IOException; +/** + * @since 3.6 + */ public class UserSessionFilter implements Filter { @Override public void init(FilterConfig filterConfig) throws ServletException { diff --git a/sonar-server/src/main/webapp/WEB-INF/web.xml b/sonar-server/src/main/webapp/WEB-INF/web.xml index 55b93f2f7da..2249a67997a 100644 --- a/sonar-server/src/main/webapp/WEB-INF/web.xml +++ b/sonar-server/src/main/webapp/WEB-INF/web.xml @@ -42,7 +42,7 @@
UserSessionFilter - org.sonar.server.platform.UserSessionFilter + org.sonar.server.user.UserSessionFilter RackFilter diff --git a/sonar-server/src/test/java/org/sonar/server/rule/RubyRuleServiceTest.java b/sonar-server/src/test/java/org/sonar/server/rule/RubyRuleServiceTest.java index ec7e19e6fc9..be0cbdad32b 100644 --- a/sonar-server/src/test/java/org/sonar/server/rule/RubyRuleServiceTest.java +++ b/sonar-server/src/test/java/org/sonar/server/rule/RubyRuleServiceTest.java @@ -22,7 +22,7 @@ package org.sonar.server.rule; import org.junit.Test; import org.sonar.api.rules.Rule; import org.sonar.core.i18n.RuleI18nManager; -import org.sonar.server.platform.UserSession; +import org.sonar.server.user.UserSession; import java.util.Locale; diff --git a/sonar-server/src/test/java/org/sonar/server/platform/UserSessionFilterTest.java b/sonar-server/src/test/java/org/sonar/server/user/UserSessionFilterTest.java similarity index 98% rename from sonar-server/src/test/java/org/sonar/server/platform/UserSessionFilterTest.java rename to sonar-server/src/test/java/org/sonar/server/user/UserSessionFilterTest.java index edcc91f9c6f..496a8416292 100644 --- a/sonar-server/src/test/java/org/sonar/server/platform/UserSessionFilterTest.java +++ b/sonar-server/src/test/java/org/sonar/server/user/UserSessionFilterTest.java @@ -17,7 +17,7 @@ * 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.platform; +package org.sonar.server.user; import org.junit.Before; import org.junit.Test; @@ -26,7 +26,6 @@ import javax.servlet.FilterChain; import javax.servlet.FilterConfig; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; - import java.util.Locale; import static org.fest.assertions.Assertions.assertThat; diff --git a/sonar-server/src/test/java/org/sonar/server/platform/UserSessionTest.java b/sonar-server/src/test/java/org/sonar/server/user/UserSessionTest.java similarity index 97% rename from sonar-server/src/test/java/org/sonar/server/platform/UserSessionTest.java rename to sonar-server/src/test/java/org/sonar/server/user/UserSessionTest.java index 4a14af1b980..3c696a14201 100644 --- a/sonar-server/src/test/java/org/sonar/server/platform/UserSessionTest.java +++ b/sonar-server/src/test/java/org/sonar/server/user/UserSessionTest.java @@ -17,9 +17,10 @@ * 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.platform; +package org.sonar.server.user; import org.junit.Test; +import org.sonar.server.user.UserSession; import java.util.Locale; -- 2.39.5