Skip to content

Override SimpleStepBuilder.faultTolerant() in FaultTolerantStepBuilder #3840

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,14 @@ public AbstractTaskletStepBuilder<SimpleStepBuilder<I, O>> stream(ItemStream str
}
return this;
}

/**
* Override parent method to prevent creation of a new FaultTolerantStepBuilder
*/
@Override
public FaultTolerantStepBuilder<I, O> faultTolerant() {
return this;
}

protected ChunkProvider<I> createChunkProvider() {

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package org.springframework.batch.core.step.builder;

import org.junit.Test;

import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This import is not used, I will remove it on merge.


public class FaultTolerantStepBuilderTests {

@Test
public void faultTolerantReturnsSameInstance() {
FaultTolerantStepBuilder<Object, Object> builder = new FaultTolerantStepBuilder<>(new StepBuilder("test"));
assertEquals(builder, builder.faultTolerant());
}
}