@Test public void givenAnEmployee_whenProcessEmployee_thenJobExecutionIdIsSetOnPaycheck() throws Exception { PayCheck payCheck = sendPaycheckProcessor.process(taxWebserviceCallResult); assertThat(payCheck.getJobExecutionId()).isEqualTo(jobExecutionId); }
@Override public PayCheck process(TaxWebserviceCallResult taxWebserviceCallResult) throws EmailSenderException, PDFGenerationException { Resource resource = resourceLoader.getResource(paycheckTemplateFileName); TaxCalculation taxCalculation = taxWebserviceCallResult.getTaxCalculation(); byte[] pdfBytes = pdfGeneratorService.generatePdfAsByteArray(resource, getPayCheckPdfContext(taxCalculation)); emailSenderService.send(getEmailTO(taxCalculation, pdfBytes)); return PayCheck.from(stepExecution.getJobExecutionId(), taxCalculation, pdfBytes); }
SendPaycheckProcessor implements ItemProcessor<TaxWebserviceCallResult, PayCheck> { @Override public PayCheck process(TaxWebserviceCallResult taxWebserviceCallResult) throws EmailSenderException, PDFGenerationException { Resource resource = resourceLoader.getResource(paycheckTemplateFileName); TaxCalculation taxCalculation = taxWebserviceCallResult.getTaxCalculation(); byte[] pdfBytes = pdfGeneratorService.generatePdfAsByteArray(resource, getPayCheckPdfContext(taxCalculation)); emailSenderService.send(getEmailTO(taxCalculation, pdfBytes)); return PayCheck.from(stepExecution.getJobExecutionId(), taxCalculation, pdfBytes); } }
SendPaycheckProcessor implements ItemProcessor<TaxWebserviceCallResult, PayCheck> { @Override public PayCheck process(TaxWebserviceCallResult taxWebserviceCallResult) throws EmailSenderException, PDFGenerationException { Resource resource = resourceLoader.getResource(paycheckTemplateFileName); TaxCalculation taxCalculation = taxWebserviceCallResult.getTaxCalculation(); byte[] pdfBytes = pdfGeneratorService.generatePdfAsByteArray(resource, getPayCheckPdfContext(taxCalculation)); emailSenderService.send(getEmailTO(taxCalculation, pdfBytes)); return PayCheck.from(stepExecution.getJobExecutionId(), taxCalculation, pdfBytes); }  }
SendPaycheckProcessor implements ItemProcessor<TaxWebserviceCallResult, PayCheck> { @Override public PayCheck process(TaxWebserviceCallResult taxWebserviceCallResult) throws EmailSenderException, PDFGenerationException { Resource resource = resourceLoader.getResource(paycheckTemplateFileName); TaxCalculation taxCalculation = taxWebserviceCallResult.getTaxCalculation(); byte[] pdfBytes = pdfGeneratorService.generatePdfAsByteArray(resource, getPayCheckPdfContext(taxCalculation)); emailSenderService.send(getEmailTO(taxCalculation, pdfBytes)); return PayCheck.from(stepExecution.getJobExecutionId(), taxCalculation, pdfBytes); }  @Override PayCheck process(TaxWebserviceCallResult taxWebserviceCallResult); String getEmailBodyForEmployee(TaxCalculation taxCalculation); }
SendPaycheckProcessor implements ItemProcessor<TaxWebserviceCallResult, PayCheck> { @Override public PayCheck process(TaxWebserviceCallResult taxWebserviceCallResult) throws EmailSenderException, PDFGenerationException { Resource resource = resourceLoader.getResource(paycheckTemplateFileName); TaxCalculation taxCalculation = taxWebserviceCallResult.getTaxCalculation(); byte[] pdfBytes = pdfGeneratorService.generatePdfAsByteArray(resource, getPayCheckPdfContext(taxCalculation)); emailSenderService.send(getEmailTO(taxCalculation, pdfBytes)); return PayCheck.from(stepExecution.getJobExecutionId(), taxCalculation, pdfBytes); }  @Override PayCheck process(TaxWebserviceCallResult taxWebserviceCallResult); String getEmailBodyForEmployee(TaxCalculation taxCalculation);  }