Skip to content

Commit

Permalink
Add test cases to cover key generation for empty identifying job para…
Browse files Browse the repository at this point in the history
…meters set

Related to #4755

Signed-off-by: Fabrice Bibonne <[email protected]>
  • Loading branch information
fmbenhassine authored and FBibonne committed Feb 2, 2025
1 parent 0a530e0 commit 1c28dac
Showing 1 changed file with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2013-2022 the original author or authors.
* Copyright 2013-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -65,4 +65,22 @@ void testCreateJobKeyOrdering() {
assertEquals(key1, key2);
}

@Test
public void testCreateJobKeyForEmptyParameters() {
JobParameters jobParameters1 = new JobParameters();
JobParameters jobParameters2 = new JobParameters();
String key1 = jobKeyGenerator.generateKey(jobParameters1);
String key2 = jobKeyGenerator.generateKey(jobParameters2);
assertEquals(key1, key2);
}

@Test
public void testCreateJobKeyForEmptyParametersAndNonIdentifying() {
JobParameters jobParameters1 = new JobParameters();
JobParameters jobParameters2 = new JobParametersBuilder().addString("name", "foo", false).toJobParameters();
String key1 = jobKeyGenerator.generateKey(jobParameters1);
String key2 = jobKeyGenerator.generateKey(jobParameters2);
assertEquals(key1, key2);
}

}

0 comments on commit 1c28dac

Please sign in to comment.