From: Daniel Schwarz Date: Fri, 13 Oct 2017 15:20:36 +0000 (+0200) Subject: SONAR-8727 add IT that shows, that scm accounts >255 chars are an issue X-Git-Tag: 6.7-RC1~146 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=21f0afdda1f33200e90d96a06972ffa77e0ee8b5;p=sonarqube.git SONAR-8727 add IT that shows, that scm accounts >255 chars are an issue --- diff --git a/tests/projects/issue/AutoAssignTest/src/sample.xoo b/tests/projects/issue/AutoAssignTest/src/sample.xoo index 83572801d71..98a1bd444c1 100644 --- a/tests/projects/issue/AutoAssignTest/src/sample.xoo +++ b/tests/projects/issue/AutoAssignTest/src/sample.xoo @@ -6,3 +6,4 @@ line line line line +line diff --git a/tests/projects/issue/AutoAssignTest/src/sample.xoo.measures b/tests/projects/issue/AutoAssignTest/src/sample.xoo.measures index 7bb5f438500..56acf8077d6 100644 --- a/tests/projects/issue/AutoAssignTest/src/sample.xoo.measures +++ b/tests/projects/issue/AutoAssignTest/src/sample.xoo.measures @@ -1 +1 @@ -ncloc:8 +ncloc:9 diff --git a/tests/projects/issue/AutoAssignTest/src/sample.xoo.scm b/tests/projects/issue/AutoAssignTest/src/sample.xoo.scm index d469fe05994..6e0823ab5e5 100644 --- a/tests/projects/issue/AutoAssignTest/src/sample.xoo.scm +++ b/tests/projects/issue/AutoAssignTest/src/sample.xoo.scm @@ -7,3 +7,4 @@ 7,user7ScmAccount,2015-12-04 8,user8ScmAccount,2015-12-04 9,user8ScmAccount,2015-12-04 +10,ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss,2015-12-04 diff --git a/tests/src/test/java/org/sonarqube/tests/issue/AutoAssignTest.java b/tests/src/test/java/org/sonarqube/tests/issue/AutoAssignTest.java index 7b6f2caf80a..5cb2b79f548 100644 --- a/tests/src/test/java/org/sonarqube/tests/issue/AutoAssignTest.java +++ b/tests/src/test/java/org/sonarqube/tests/issue/AutoAssignTest.java @@ -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 issues, int line, @Nullable String expectedAssignee) {