Skip to content

Commit 8bfd144

Browse files
committed
Remove deprecated API usage in MongoDBJobRepositoryIntegrationTests
1 parent 3f5a793 commit 8bfd144

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

spring-batch-core/src/test/java/org/springframework/batch/core/repository/support/MongoDBJobRepositoryIntegrationTests.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ public class MongoDBJobRepositoryIntegrationTests {
5050
@Autowired
5151
private MongoTemplate mongoTemplate;
5252

53-
@SuppressWarnings("removal")
5453
@BeforeEach
5554
public void setUp() {
5655
// collections
@@ -67,21 +66,21 @@ public void setUp() {
6766
.insertOne(new Document(Map.of("_id", "BATCH_STEP_EXECUTION_SEQ", "count", 0L)));
6867
// indices
6968
mongoTemplate.indexOps("BATCH_JOB_INSTANCE")
70-
.ensureIndex(new Index().on("jobName", Sort.Direction.ASC).named("job_name_idx"));
69+
.createIndex(new Index().on("jobName", Sort.Direction.ASC).named("job_name_idx"));
7170
mongoTemplate.indexOps("BATCH_JOB_INSTANCE")
72-
.ensureIndex(new Index().on("jobName", Sort.Direction.ASC)
71+
.createIndex(new Index().on("jobName", Sort.Direction.ASC)
7372
.on("jobKey", Sort.Direction.ASC)
7473
.named("job_name_key_idx"));
7574
mongoTemplate.indexOps("BATCH_JOB_INSTANCE")
76-
.ensureIndex(new Index().on("jobInstanceId", Sort.Direction.DESC).named("job_instance_idx"));
75+
.createIndex(new Index().on("jobInstanceId", Sort.Direction.DESC).named("job_instance_idx"));
7776
mongoTemplate.indexOps("BATCH_JOB_EXECUTION")
78-
.ensureIndex(new Index().on("jobInstanceId", Sort.Direction.ASC).named("job_instance_idx"));
77+
.createIndex(new Index().on("jobInstanceId", Sort.Direction.ASC).named("job_instance_idx"));
7978
mongoTemplate.indexOps("BATCH_JOB_EXECUTION")
80-
.ensureIndex(new Index().on("jobInstanceId", Sort.Direction.ASC)
79+
.createIndex(new Index().on("jobInstanceId", Sort.Direction.ASC)
8180
.on("status", Sort.Direction.ASC)
8281
.named("job_instance_status_idx"));
8382
mongoTemplate.indexOps("BATCH_STEP_EXECUTION")
84-
.ensureIndex(new Index().on("stepExecutionId", Sort.Direction.ASC).named("step_execution_idx"));
83+
.createIndex(new Index().on("stepExecutionId", Sort.Direction.ASC).named("step_execution_idx"));
8584
}
8685

8786
@Test

0 commit comments

Comments
 (0)