Skip to content

Commit 154a7d3

Browse files
committed
Bump spring-boot-starter-parent from 3.5.6 to 4.0.0-RC2
Signed-off-by: Stefano Cordio <[email protected]>
1 parent 343db3f commit 154a7d3

File tree

4 files changed

+28
-29
lines changed

4 files changed

+28
-29
lines changed

spring-batch-notion/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>org.springframework.boot</groupId>
77
<artifactId>spring-boot-starter-parent</artifactId>
8-
<version>3.5.6</version>
8+
<version>4.0.0-RC2</version>
99
<relativePath/>
1010
</parent>
1111

spring-batch-notion/src/main/java/org/springframework/batch/extensions/notion/NotionDatabaseItemReader.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,13 @@
2626
import notion.api.v1.model.pages.PageProperty.RichText;
2727
import notion.api.v1.request.databases.QueryDatabaseRequest;
2828
import org.springframework.batch.extensions.notion.mapping.PropertyMapper;
29-
import org.springframework.batch.item.ExecutionContext;
30-
import org.springframework.batch.item.ItemReader;
31-
import org.springframework.batch.item.data.AbstractPaginatedDataItemReader;
29+
import org.springframework.batch.infrastructure.item.ExecutionContext;
30+
import org.springframework.batch.infrastructure.item.ItemReader;
31+
import org.springframework.batch.infrastructure.item.data.AbstractPaginatedDataItemReader;
3232
import org.springframework.beans.factory.InitializingBean;
3333
import org.springframework.util.Assert;
3434

35+
import java.util.Collections;
3536
import java.util.Iterator;
3637
import java.util.List;
3738
import java.util.Map;
@@ -180,7 +181,7 @@ public void setPageSize(int pageSize) {
180181
@Override
181182
protected Iterator<T> doPageRead() {
182183
if (!hasMore) {
183-
return null;
184+
return Collections.emptyIterator();
184185
}
185186

186187
QueryDatabaseRequest request = new QueryDatabaseRequest(databaseId);

spring-batch-notion/src/test/java/org/springframework/batch/extensions/notion/it/pagination/MultiplePagesDescendingTests.java

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,22 @@
1717

1818
import org.json.JSONObject;
1919
import org.junit.jupiter.api.Test;
20-
import org.springframework.batch.core.Job;
21-
import org.springframework.batch.core.JobExecution;
22-
import org.springframework.batch.core.Step;
20+
import org.springframework.batch.core.job.Job;
21+
import org.springframework.batch.core.job.JobExecution;
2322
import org.springframework.batch.core.job.builder.JobBuilder;
2423
import org.springframework.batch.core.repository.JobRepository;
24+
import org.springframework.batch.core.step.Step;
2525
import org.springframework.batch.core.step.builder.StepBuilder;
2626
import org.springframework.batch.extensions.notion.NotionDatabaseItemReader;
2727
import org.springframework.batch.extensions.notion.Sort;
2828
import org.springframework.batch.extensions.notion.it.IntegrationTest;
2929
import org.springframework.batch.extensions.notion.mapping.RecordPropertyMapper;
30-
import org.springframework.batch.item.support.ListItemWriter;
31-
import org.springframework.batch.test.JobLauncherTestUtils;
30+
import org.springframework.batch.infrastructure.item.support.ListItemWriter;
31+
import org.springframework.batch.test.JobOperatorTestUtils;
3232
import org.springframework.beans.factory.annotation.Autowired;
3333
import org.springframework.beans.factory.annotation.Value;
3434
import org.springframework.boot.autoconfigure.SpringBootApplication;
3535
import org.springframework.context.annotation.Bean;
36-
import org.springframework.transaction.PlatformTransactionManager;
3736

3837
import java.util.Map;
3938
import java.util.UUID;
@@ -72,7 +71,7 @@ class MultiplePagesDescendingTests {
7271
private static final int PAGE_SIZE = 2;
7372

7473
@Autowired
75-
JobLauncherTestUtils launcher;
74+
JobOperatorTestUtils jobOperator;
7675

7776
@Autowired
7877
ListItemWriter<PaginatedDescendingJob.Item> itemWriter;
@@ -104,7 +103,7 @@ void should_succeed() throws Exception {
104103
.willReturn(okJson(queryResponse(thirdResult))));
105104

106105
// WHEN
107-
JobExecution jobExecution = launcher.launchJob();
106+
JobExecution jobExecution = jobOperator.startJob();
108107

109108
// THEN
110109
then(jobExecution.getExitStatus()).isEqualTo(COMPLETED);
@@ -124,13 +123,13 @@ static class PaginatedDescendingJob {
124123

125124
@Bean
126125
Job job(JobRepository jobRepository, Step step) {
127-
return new JobBuilder("TEST-JOB", jobRepository).start(step).build();
126+
return new JobBuilder(jobRepository).start(step).build();
128127
}
129128

130129
@Bean
131-
Step step(JobRepository jobRepository, PlatformTransactionManager transactionManager) {
132-
return new StepBuilder("TEST-STEP", jobRepository) //
133-
.<Item, Item>chunk(PAGE_SIZE, transactionManager) //
130+
Step step(JobRepository jobRepository) {
131+
return new StepBuilder(jobRepository) //
132+
.<Item, Item>chunk(PAGE_SIZE) //
134133
.reader(itemReader()) //
135134
.writer(itemWriter()) //
136135
.build();

spring-batch-notion/src/test/java/org/springframework/batch/extensions/notion/it/pagination/MultiplePagesTests.java

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,21 @@
1717

1818
import org.json.JSONObject;
1919
import org.junit.jupiter.api.Test;
20-
import org.springframework.batch.core.Job;
21-
import org.springframework.batch.core.JobExecution;
22-
import org.springframework.batch.core.Step;
20+
import org.springframework.batch.core.job.Job;
21+
import org.springframework.batch.core.job.JobExecution;
2322
import org.springframework.batch.core.job.builder.JobBuilder;
2423
import org.springframework.batch.core.repository.JobRepository;
24+
import org.springframework.batch.core.step.Step;
2525
import org.springframework.batch.core.step.builder.StepBuilder;
2626
import org.springframework.batch.extensions.notion.NotionDatabaseItemReader;
2727
import org.springframework.batch.extensions.notion.it.IntegrationTest;
2828
import org.springframework.batch.extensions.notion.mapping.RecordPropertyMapper;
29-
import org.springframework.batch.item.support.ListItemWriter;
30-
import org.springframework.batch.test.JobLauncherTestUtils;
29+
import org.springframework.batch.infrastructure.item.support.ListItemWriter;
30+
import org.springframework.batch.test.JobOperatorTestUtils;
3131
import org.springframework.beans.factory.annotation.Autowired;
3232
import org.springframework.beans.factory.annotation.Value;
3333
import org.springframework.boot.autoconfigure.SpringBootApplication;
3434
import org.springframework.context.annotation.Bean;
35-
import org.springframework.transaction.PlatformTransactionManager;
3635

3736
import java.util.Map;
3837
import java.util.UUID;
@@ -69,7 +68,7 @@ class MultiplePagesTests {
6968
private static final int PAGE_SIZE = 2;
7069

7170
@Autowired
72-
JobLauncherTestUtils launcher;
71+
JobOperatorTestUtils jobOperator;
7372

7473
@Autowired
7574
ListItemWriter<PaginatedJob.Item> itemWriter;
@@ -101,7 +100,7 @@ void should_succeed() throws Exception {
101100
.willReturn(okJson(queryResponse(thirdResult))));
102101

103102
// WHEN
104-
JobExecution jobExecution = launcher.launchJob();
103+
JobExecution jobExecution = jobOperator.startJob();
105104

106105
// THEN
107106
then(jobExecution.getExitStatus()).isEqualTo(COMPLETED);
@@ -121,13 +120,13 @@ static class PaginatedJob {
121120

122121
@Bean
123122
Job job(JobRepository jobRepository, Step step) {
124-
return new JobBuilder("TEST-JOB", jobRepository).start(step).build();
123+
return new JobBuilder(jobRepository).start(step).build();
125124
}
126125

127126
@Bean
128-
Step step(JobRepository jobRepository, PlatformTransactionManager transactionManager) {
129-
return new StepBuilder("TEST-STEP", jobRepository) //
130-
.<Item, Item>chunk(PAGE_SIZE, transactionManager) //
127+
Step step(JobRepository jobRepository) {
128+
return new StepBuilder(jobRepository) //
129+
.<Item, Item>chunk(PAGE_SIZE) //
131130
.reader(itemReader()) //
132131
.writer(itemWriter()) //
133132
.build();

0 commit comments

Comments
 (0)