Override SimpleStepBuilder.faultTolerant() in FaultTolerantStepBuilder

Override SimpleStepBuilder.faultTolerant() in FaultTolerantStepBuilder
to prevent creation of a new FaultTolerantStepBuilder when calling
faultTolerant() on an existing FaultTolerantStepBuilder. Otherwise
configuration, like chunkListeners, are lost.

Issue #3840
This commit is contained in:
Mark Bonnekessel
2021-01-28 20:22:04 +01:00
committed by Mahmoud Ben Hassine
parent 58e82a56e7
commit a43d3a5ab7
2 changed files with 38 additions and 1 deletions

View File

@@ -0,0 +1,29 @@
/*
* Copyright 2021 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.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.core.step.builder;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
public class FaultTolerantStepBuilderTests {
@Test
public void faultTolerantReturnsSameInstance() {
FaultTolerantStepBuilder<Object, Object> builder = new FaultTolerantStepBuilder<>(new StepBuilder("test"));
assertEquals(builder, builder.faultTolerant());
}
}