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 spring-projects#4755
  • Loading branch information
fmbenhassine committed Jan 31, 2025
1 parent 8e91adb commit f888ebb
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 f888ebb

Please sign in to comment.