PNCRegistrationOAHandler implements FormSubmissionHandler { @Override public void handle(FormSubmission submission) { pncService.pncRegistrationOA(submission); childService.pncOAChildRegistration(submission); } @Autowired  PNCRegistrationOAHandler(PNCService pncService, ChildService childService); @Override void handle(FormSubmission submission);  }
@Test public void shouldDelegateFormSubmissionHandlingToPNCService() throws Exception { FormSubmission submission = new FormSubmission("anm id 1", "instance id 1", "pnc_registration_oa", "entity id 1", 0L, "1", null, 0L); handler.handle(submission); verify(pncService).pncRegistrationOA(submission); verify(childService).pncOAChildRegistration(submission); }