Skip to content
Merged
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 @@ -22,6 +22,7 @@

import org.junit.jupiter.api.Test;

import org.junit.jupiter.api.function.Executable;
import org.springframework.batch.item.ExecutionContext;
import org.springframework.batch.item.file.FlatFileItemReader;
import org.springframework.batch.item.file.mapping.BeanWrapperFieldSetMapper;
Expand Down Expand Up @@ -556,13 +557,12 @@ void testErrorMessageWhenNoFieldSetMapperIsProvided() {

@Test
void testErrorMessageWhenNoLineTokenizerWasProvided() {
try {
new FlatFileItemReaderBuilder<Foo>().name("fooReader").resource(getResource("1;2;3")).build();
}
catch (IllegalStateException exception) {
String exceptionMessage = exception.getMessage();
assertEquals("No LineTokenizer implementation was provided.", exceptionMessage);
}
Executable builder = () -> new FlatFileItemReaderBuilder<Foo>().name("fooReader")
.resource(getResource("1;2;3"))
.build();
Exception exception = assertThrows(IllegalStateException.class, builder);
String message = exception.getMessage();
assertEquals("No LineTokenizer implementation was provided.", message);
}

@Test
Expand Down
Loading