Using @MockBean to mock an ItemReader with @BeforeStep Throws Exception to many methods with @Beforestep anotation. How do I solve it?
Clash Royale CLAN TAG #URR8PPP Using @MockBean to mock an ItemReader with @BeforeStep Throws Exception to many methods with @Beforestep anotation. How do I solve it? I have my own Implementation of an ItemReader with two methods. public class Reader implements ItemReader<Integer> { private final Logger logger = LoggerFactory.getLogger(getClass()); private Iterator<Integer> iterator; @Override public Integer read() throws UnexpectedInputException, ParseException, NonTransientResourceException { if(iterator.hasNext()){ return iterator.next(); } return null; } @BeforeStep public void init(StepExecution stepExecution){ List<Integer> integerList = (List<Integer>)stepExecution.getJobExecution().getExecutionContext().get(CKEY_ERROREVENT_IDS); this.iterator = integerList.iterator(); } } When I try to run this within a spring-batch context and mocking the ItemReader with @MockBean the ap...