job scope bean doesn't cleanup in unit test #1288
Labels
for: backport-to-4.3.x
Issues that will be back-ported to the 4.3.x line
for: backport-to-5.0.x
Issues that will be back-ported to the 5.0.x line
in: test
type: bug
Milestone
Clockrun Ren opened BATCH-2314 and commented
By using JobScopeTestExecutionListener in my test case (base on testng), I was able to instantiate job scope bean. however, after test method is executed, destroy() in job scope bean is never called.
After some investigation, I find there are issues in class JobScopeTestExecutionListener.
In method afterTestMethod, it will do JobSynchronizationManager.close(). which only remove scoped bean from context, without invoke of destroy(). if we use JobSynchronizationManager.release(), then everything is fine.
Affects: 3.0.1
The text was updated successfully, but these errors were encountered: