Skip to content

BATCH-2624: Chunk oriented step builders must validate that an ItemWriter is provided #593

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

Merged
merged 2 commits into from
Apr 13, 2018

Conversation

fmbenhassine
Copy link
Contributor

This PR rebases #491 on the master branch and adds a test on the mandatory item writer.

I took the opportunity to also add a test on the mandatory item reader.

This commit aligns the XML and Java based validations.

When using XML to configure a chunk oriented step both an ItemReader and
ItemWriter are requied. However when using Java based configuration the
ItemWriter is optional if an ItemProcessor is present.

Having no ItemWriter and only an ItemProcessor lead to strange results
in one of our batch jobs, which was accidentily configured without an
ItemProcessor.

Related: BATCH-1520
Fixes: BATCH-2624
@fmbenhassine fmbenhassine changed the title BATCH-2624: add tests on mandatory item reader/writer BATCH-2624: Chunk oriented step builders must validate that an ItemWriter is provided Apr 5, 2018
@fmbenhassine fmbenhassine requested a review from mminella April 5, 2018 10:46
Copy link
Member

@mminella mminella left a comment

Choose a reason for hiding this comment

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

As long as you're ok with the comments I made, I can make the changes on merge.

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2014 the original author or authors.
* Copyright 2006-2017 the original author or authors.
Copy link
Member

Choose a reason for hiding this comment

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

2018

@@ -135,6 +140,28 @@ public void setUp() throws Exception {
repository.add(stepExecution);
}

@Test()
Copy link
Member

Choose a reason for hiding this comment

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

You don't need the parens if they are not used...

factory.getObject();
}

@Test()
Copy link
Member

Choose a reason for hiding this comment

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

You don't need the parens if they are not used...

@@ -92,6 +97,28 @@ public void testMandatoryProperties() throws Exception {
new SimpleStepFactoryBean<String, String>().getObject();
}

@Test()
Copy link
Member

Choose a reason for hiding this comment

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

You don't need the parens if they are not used...

factory.getObject();
}

@Test()
Copy link
Member

Choose a reason for hiding this comment

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

You don't need the parens if they are not used...

@fmbenhassine
Copy link
Contributor Author

Thanks for the review. I updated the PR.

@fmbenhassine fmbenhassine merged commit 2b0532e into spring-projects:master Apr 13, 2018
@fmbenhassine fmbenhassine deleted the BATCH-2624 branch April 13, 2018 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants