diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2015-12-07 16:24:42 +0100 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@sonarsource.com> | 2015-12-07 16:24:53 +0100 |
commit | 541c15654fc024534c45710b30b9cfc8ec551d96 (patch) | |
tree | eb6ec20b21e0bef6184436c4ce1b03842974e514 | |
parent | 68c809b94360916af455282ad8c8a76d4b05e24d (diff) | |
download | sonarqube-541c15654fc024534c45710b30b9cfc8ec551d96.tar.gz sonarqube-541c15654fc024534c45710b30b9cfc8ec551d96.zip |
Fix randomly failing UT
Remove random generation of hash and resource id
-rw-r--r-- | server/sonar-server/src/test/java/org/sonar/server/computation/duplication/IntegrateCrossProjectDuplicationsTest.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/duplication/IntegrateCrossProjectDuplicationsTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/duplication/IntegrateCrossProjectDuplicationsTest.java index 6cbcdb319ab..557426a572d 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/duplication/IntegrateCrossProjectDuplicationsTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/duplication/IntegrateCrossProjectDuplicationsTest.java @@ -33,6 +33,7 @@ import org.sonar.duplications.block.ByteArray; import org.sonar.server.computation.component.Component; import org.sonar.server.computation.component.FileAttributes; +import static com.google.common.base.Strings.padStart; import static java.util.Arrays.asList; import static java.util.Collections.singletonList; import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric; @@ -342,7 +343,7 @@ public class IntegrateCrossProjectDuplicationsTest { // Generate more than 100 duplication on different files for (int i = 0; i < 110; i++) { - String hash = randomAlphanumeric(16); + String hash = padStart("hash" + i, 16, 'a'); originBlocks.add( blockBuilder .setResourceId(ORIGIN_FILE_KEY) @@ -350,7 +351,7 @@ public class IntegrateCrossProjectDuplicationsTest { .build()); duplicatedBlocks.add( blockBuilder - .setResourceId(randomAlphanumeric(16)) + .setResourceId("resource" + i) .setBlockHash(new ByteArray(hash)) .build() ); |