]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-8727 add IT that shows, that scm accounts >255 chars are an issue
authorDaniel Schwarz <daniel.schwarz@sonarsource.com>
Fri, 13 Oct 2017 15:20:36 +0000 (17:20 +0200)
committerJulien HENRY <julien.henry@sonarsource.com>
Fri, 20 Oct 2017 09:38:56 +0000 (19:38 +1000)
tests/projects/issue/AutoAssignTest/src/sample.xoo
tests/projects/issue/AutoAssignTest/src/sample.xoo.measures
tests/projects/issue/AutoAssignTest/src/sample.xoo.scm
tests/src/test/java/org/sonarqube/tests/issue/AutoAssignTest.java

index 83572801d71facd6ce780badf11d6ddf50ec0681..98a1bd444c1fcc44f12a07bfdb4cdf52efdf3973 100644 (file)
@@ -6,3 +6,4 @@ line
 line
 line
 line
+line
index d469fe05994664f557f41152c554f3cd7946a6ef..6e0823ab5e5efb3ee9901c1a4bc7ad2f56443da2 100644 (file)
@@ -7,3 +7,4 @@
 7,user7ScmAccount,2015-12-04
 8,user8ScmAccount,2015-12-04
 9,user8ScmAccount,2015-12-04
+10,ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss,2015-12-04
index 7b6f2caf80a13aea6f98118dc74b09273053f80f..5cb2b79f54867354a8702e9c327b3441db21733c 100644 (file)
@@ -21,6 +21,8 @@ package org.sonarqube.tests.issue;
 
 import java.util.Arrays;
 import java.util.List;
+import java.util.stream.Collectors;
+import java.util.stream.IntStream;
 import javax.annotation.Nullable;
 import org.junit.After;
 import org.junit.Before;
@@ -79,6 +81,8 @@ public class AutoAssignTest extends AbstractIssueTest {
     // verify that SCM account matches, case-insensitive
     createUser("user7", "User 7", "user7@email.com", "user7ScmAccount");
     createUser("user8", "User 8", "user8@email.com", "user8SCMaccOUNT");
+    // SCM accounts long then 255 chars will be ignored
+    createUser("user9", "User 9", "user9@email.com", IntStream.range(0,256).mapToObj(i -> "s").collect(Collectors.joining()));
 
     projectAnalysis.run();
 
@@ -95,6 +99,8 @@ public class AutoAssignTest extends AbstractIssueTest {
     // SCM account match, case-insensitive
     verifyIssueAssignee(issues, 7, "user7");
     verifyIssueAssignee(issues, 8, "user8");
+    // SCM accounts long then 255 chars will be ignored
+    verifyIssueAssignee(issues, 10, null);
   }
 
   private static void verifyIssueAssignee(List<Issue> issues, int line, @Nullable String expectedAssignee) {