@Test public void testShouldCreate() { doNothing().when(marriageRegnRepository).save(any(MarriageRegn.class)); doNothing().when(marryingPersonRepository).save(any(MarryingPerson.class), any(String.class)); marriageRegnService.create(MarriageRegnRequest.builder().marriageRegn(getMarriageRegn().get(0)).build()); }
@Transactional public void create(MarriageRegnRequest marriageRegnRequest) { MarriageRegn marriageRegn = marriageRegnRequest.getMarriageRegn(); marriageRegnRepository.save(marriageRegn); marryingPersonRepository.save(marriageRegn.getBridegroom(), marriageRegn.getTenantId()); marryingPersonRepository.save(marriageRegn.getBride(), marriageRegn.getTenantId()); }
MarriageRegnService { @Transactional public void create(MarriageRegnRequest marriageRegnRequest) { MarriageRegn marriageRegn = marriageRegnRequest.getMarriageRegn(); marriageRegnRepository.save(marriageRegn); marryingPersonRepository.save(marriageRegn.getBridegroom(), marriageRegn.getTenantId()); marryingPersonRepository.save(marriageRegn.getBride(), marriageRegn.getTenantId()); } }
MarriageRegnService { @Transactional public void create(MarriageRegnRequest marriageRegnRequest) { MarriageRegn marriageRegn = marriageRegnRequest.getMarriageRegn(); marriageRegnRepository.save(marriageRegn); marryingPersonRepository.save(marriageRegn.getBridegroom(), marriageRegn.getTenantId()); marryingPersonRepository.save(marriageRegn.getBride(), marriageRegn.getTenantId()); }  }
MarriageRegnService { @Transactional public void create(MarriageRegnRequest marriageRegnRequest) { MarriageRegn marriageRegn = marriageRegnRequest.getMarriageRegn(); marriageRegnRepository.save(marriageRegn); marryingPersonRepository.save(marriageRegn.getBridegroom(), marriageRegn.getTenantId()); marryingPersonRepository.save(marriageRegn.getBride(), marriageRegn.getTenantId()); }  MarriageRegnResponse getMarriageRegns(MarriageRegnCriteria marriageRegnCriteria, RequestInfo requestInfo); @Transactional void create(MarriageRegnRequest marriageRegnRequest); MarriageRegnResponse createAsync(MarriageRegnRequest marriageRegnRequest); MarriageRegnResponse updateAsync(MarriageRegnRequest marriageRegnRequest); @Transactional void update(MarriageRegnRequest marriageRegnRequest); }
MarriageRegnService { @Transactional public void create(MarriageRegnRequest marriageRegnRequest) { MarriageRegn marriageRegn = marriageRegnRequest.getMarriageRegn(); marriageRegnRepository.save(marriageRegn); marryingPersonRepository.save(marriageRegn.getBridegroom(), marriageRegn.getTenantId()); marryingPersonRepository.save(marriageRegn.getBride(), marriageRegn.getTenantId()); }  MarriageRegnResponse getMarriageRegns(MarriageRegnCriteria marriageRegnCriteria, RequestInfo requestInfo); @Transactional void create(MarriageRegnRequest marriageRegnRequest); MarriageRegnResponse createAsync(MarriageRegnRequest marriageRegnRequest); MarriageRegnResponse updateAsync(MarriageRegnRequest marriageRegnRequest); @Transactional void update(MarriageRegnRequest marriageRegnRequest);  }