@Test public void testShouldUpdate() { doNothing().when(marriageRegnRepository).update(any(MarriageRegn.class)); doNothing().when(marryingPersonRepository).update(any(MarryingPerson.class), any(String.class)); doNothing().when(marryingPersonRepository).update(any(MarryingPerson.class), any(String.class)); marriageRegnService.update(MarriageRegnRequest.builder().marriageRegn(getMarriageRegn().get(0)).build()); }
@Transactional public void update(MarriageRegnRequest marriageRegnRequest) { MarriageRegn marriageRegn = marriageRegnRequest.getMarriageRegn(); marriageRegnRepository.update(marriageRegn); marryingPersonRepository.update(marriageRegn.getBridegroom(), marriageRegn.getTenantId()); marryingPersonRepository.update(marriageRegn.getBride(), marriageRegn.getTenantId()); if (marriageRegn.getStatus().toString().equals("REGISTERED")) marriageCertRepository.insert(marriageRegn); }
MarriageRegnService { @Transactional public void update(MarriageRegnRequest marriageRegnRequest) { MarriageRegn marriageRegn = marriageRegnRequest.getMarriageRegn(); marriageRegnRepository.update(marriageRegn); marryingPersonRepository.update(marriageRegn.getBridegroom(), marriageRegn.getTenantId()); marryingPersonRepository.update(marriageRegn.getBride(), marriageRegn.getTenantId()); if (marriageRegn.getStatus().toString().equals("REGISTERED")) marriageCertRepository.insert(marriageRegn); } }
MarriageRegnService { @Transactional public void update(MarriageRegnRequest marriageRegnRequest) { MarriageRegn marriageRegn = marriageRegnRequest.getMarriageRegn(); marriageRegnRepository.update(marriageRegn); marryingPersonRepository.update(marriageRegn.getBridegroom(), marriageRegn.getTenantId()); marryingPersonRepository.update(marriageRegn.getBride(), marriageRegn.getTenantId()); if (marriageRegn.getStatus().toString().equals("REGISTERED")) marriageCertRepository.insert(marriageRegn); }  }
MarriageRegnService { @Transactional public void update(MarriageRegnRequest marriageRegnRequest) { MarriageRegn marriageRegn = marriageRegnRequest.getMarriageRegn(); marriageRegnRepository.update(marriageRegn); marryingPersonRepository.update(marriageRegn.getBridegroom(), marriageRegn.getTenantId()); marryingPersonRepository.update(marriageRegn.getBride(), marriageRegn.getTenantId()); if (marriageRegn.getStatus().toString().equals("REGISTERED")) marriageCertRepository.insert(marriageRegn); }  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 update(MarriageRegnRequest marriageRegnRequest) { MarriageRegn marriageRegn = marriageRegnRequest.getMarriageRegn(); marriageRegnRepository.update(marriageRegn); marryingPersonRepository.update(marriageRegn.getBridegroom(), marriageRegn.getTenantId()); marryingPersonRepository.update(marriageRegn.getBride(), marriageRegn.getTenantId()); if (marriageRegn.getStatus().toString().equals("REGISTERED")) marriageCertRepository.insert(marriageRegn); }  MarriageRegnResponse getMarriageRegns(MarriageRegnCriteria marriageRegnCriteria, RequestInfo requestInfo); @Transactional void create(MarriageRegnRequest marriageRegnRequest); MarriageRegnResponse createAsync(MarriageRegnRequest marriageRegnRequest); MarriageRegnResponse updateAsync(MarriageRegnRequest marriageRegnRequest); @Transactional void update(MarriageRegnRequest marriageRegnRequest);  }