Skip to content

Commit

Permalink
do not randomize test data
Browse files Browse the repository at this point in the history
  • Loading branch information
PacoVK committed Dec 31, 2024
1 parent d2cf5ba commit 62b5550
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ void testGetDeployKeyByValue() throws Exception {
repository.saveDeployKey(deployKey);

String deployKeyValue = deployKey.getKey();
Random random = new Random();
int end = random.nextInt(deployKeyValue.length());
String deployKeyValueSub = deployKeyValue.substring(0, end + 1); // +1 to include the end character
String deployKeyValueSub = deployKeyValue.substring(0, 4); // first 4 characters

assertDoesNotThrow(() -> repository.getDeployKeyByValue(deployKeyValue));
assertThrows(DeployKeyNotFoundException.class, () -> repository.getDeployKeyByValue(deployKeyValueSub));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ void testGetDeployKeyByValue() throws Exception {
repository.saveDeployKey(deployKey);

String deployKeyValue = deployKey.getKey();
Random random = new Random();
int end = random.nextInt(deployKeyValue.length() - 1);
String deployKeyValueSub = deployKeyValue.substring(0, end);
String deployKeyValueSub = deployKeyValue.substring(0, 4); // first 4 characters

assertDoesNotThrow(() -> repository.getDeployKeyByValue(deployKeyValue));
assertThrows(DeployKeyNotFoundException.class, () -> repository.getDeployKeyByValue(deployKeyValueSub));
Expand Down

0 comments on commit 62b5550

Please sign in to comment.