ImportOptionsPreProcessor implements Processor { @Override public void process( Event event, WorkContext ctx ) { ImportOptions importOptions = ctx.getImportOptions(); if ( importOptions == null ) { throw new UnrecoverableImportException( "The event process import cannot continue without ImportOptions set" ); } }  @Override void process( Event event, WorkContext ctx );  }
@Test public void verifyExceptionIsThrownOnMissingImportOptions() { thrown.expect( UnrecoverableImportException.class ); WorkContext wc = WorkContext.builder().build(); subject.process( new Event(), wc ); }