-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Conversation
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
There was a problem hiding this 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. |
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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...
Thanks for the review. I updated the PR. |
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.