@Test public void testInsert() { when(certificateNumberService.generateCertificateNumber()).thenReturn("certificateNumber"); when(jdbcTemplate.update(any(String.class), Matchers.<Object[]>any())).thenReturn(1); marriageCertRepository.insert(getMarriageRegn()); }
public void insert(MarriageRegn marriageRegn) { String certificateNo = certificateNumberService.generateCertificateNumber(); Object[] obj = new Object[] {marriageRegn.getId(), certificateNo, new Date().getTime(), CertificateType.REGISTRATION.toString(), marriageRegn.getRegnNumber(), marriageRegn.getBridegroom().getPhoto(), marriageRegn.getBride().getPhoto(), marriageRegn.getBridegroom().getName(), marriageRegn.getBridegroom().getResidenceAddress(), marriageRegn.getBride().getName(), marriageRegn.getBride().getResidenceAddress(), marriageRegn.getMarriageDate(), marriageRegn.getPlaceOfMarriage(), marriageRegn.getRegnDate(), marriageRegn.getSerialNo(), marriageRegn.getVolumeNo(), 1, new Date().getTime(), 1, new Date().getTime(), marriageRegn.getApplicationNumber(), marriageRegn.getTenantId() }; jdbcTemplate.update(CERTIFICATE_INSERT_QUERY, obj); }
MarriageCertRepository { public void insert(MarriageRegn marriageRegn) { String certificateNo = certificateNumberService.generateCertificateNumber(); Object[] obj = new Object[] {marriageRegn.getId(), certificateNo, new Date().getTime(), CertificateType.REGISTRATION.toString(), marriageRegn.getRegnNumber(), marriageRegn.getBridegroom().getPhoto(), marriageRegn.getBride().getPhoto(), marriageRegn.getBridegroom().getName(), marriageRegn.getBridegroom().getResidenceAddress(), marriageRegn.getBride().getName(), marriageRegn.getBride().getResidenceAddress(), marriageRegn.getMarriageDate(), marriageRegn.getPlaceOfMarriage(), marriageRegn.getRegnDate(), marriageRegn.getSerialNo(), marriageRegn.getVolumeNo(), 1, new Date().getTime(), 1, new Date().getTime(), marriageRegn.getApplicationNumber(), marriageRegn.getTenantId() }; jdbcTemplate.update(CERTIFICATE_INSERT_QUERY, obj); } }
MarriageCertRepository { public void insert(MarriageRegn marriageRegn) { String certificateNo = certificateNumberService.generateCertificateNumber(); Object[] obj = new Object[] {marriageRegn.getId(), certificateNo, new Date().getTime(), CertificateType.REGISTRATION.toString(), marriageRegn.getRegnNumber(), marriageRegn.getBridegroom().getPhoto(), marriageRegn.getBride().getPhoto(), marriageRegn.getBridegroom().getName(), marriageRegn.getBridegroom().getResidenceAddress(), marriageRegn.getBride().getName(), marriageRegn.getBride().getResidenceAddress(), marriageRegn.getMarriageDate(), marriageRegn.getPlaceOfMarriage(), marriageRegn.getRegnDate(), marriageRegn.getSerialNo(), marriageRegn.getVolumeNo(), 1, new Date().getTime(), 1, new Date().getTime(), marriageRegn.getApplicationNumber(), marriageRegn.getTenantId() }; jdbcTemplate.update(CERTIFICATE_INSERT_QUERY, obj); }  }
MarriageCertRepository { public void insert(MarriageRegn marriageRegn) { String certificateNo = certificateNumberService.generateCertificateNumber(); Object[] obj = new Object[] {marriageRegn.getId(), certificateNo, new Date().getTime(), CertificateType.REGISTRATION.toString(), marriageRegn.getRegnNumber(), marriageRegn.getBridegroom().getPhoto(), marriageRegn.getBride().getPhoto(), marriageRegn.getBridegroom().getName(), marriageRegn.getBridegroom().getResidenceAddress(), marriageRegn.getBride().getName(), marriageRegn.getBride().getResidenceAddress(), marriageRegn.getMarriageDate(), marriageRegn.getPlaceOfMarriage(), marriageRegn.getRegnDate(), marriageRegn.getSerialNo(), marriageRegn.getVolumeNo(), 1, new Date().getTime(), 1, new Date().getTime(), marriageRegn.getApplicationNumber(), marriageRegn.getTenantId() }; jdbcTemplate.update(CERTIFICATE_INSERT_QUERY, obj); }  void insert(MarriageRegn marriageRegn); List<ReissueCertAppl> findForCriteria(MarriageCertCriteria marriageCertCriteria); void createDoc(ReissueCertRequest reissueAppRequest); void updateDoc(ReissueCertRequest reissueAppRequest); void createReissue(ReissueCertRequest reissueAppRequest); void updateReissue(ReissueCertRequest reissueAppRequest); void createCert(ReissueCertAppl reissueApp); }
MarriageCertRepository { public void insert(MarriageRegn marriageRegn) { String certificateNo = certificateNumberService.generateCertificateNumber(); Object[] obj = new Object[] {marriageRegn.getId(), certificateNo, new Date().getTime(), CertificateType.REGISTRATION.toString(), marriageRegn.getRegnNumber(), marriageRegn.getBridegroom().getPhoto(), marriageRegn.getBride().getPhoto(), marriageRegn.getBridegroom().getName(), marriageRegn.getBridegroom().getResidenceAddress(), marriageRegn.getBride().getName(), marriageRegn.getBride().getResidenceAddress(), marriageRegn.getMarriageDate(), marriageRegn.getPlaceOfMarriage(), marriageRegn.getRegnDate(), marriageRegn.getSerialNo(), marriageRegn.getVolumeNo(), 1, new Date().getTime(), 1, new Date().getTime(), marriageRegn.getApplicationNumber(), marriageRegn.getTenantId() }; jdbcTemplate.update(CERTIFICATE_INSERT_QUERY, obj); }  void insert(MarriageRegn marriageRegn); List<ReissueCertAppl> findForCriteria(MarriageCertCriteria marriageCertCriteria); void createDoc(ReissueCertRequest reissueAppRequest); void updateDoc(ReissueCertRequest reissueAppRequest); void createReissue(ReissueCertRequest reissueAppRequest); void updateReissue(ReissueCertRequest reissueAppRequest); void createCert(ReissueCertAppl reissueApp); static final String CERTIFICATE_INSERT_QUERY; final String GET_APPLICATION_NO_QUERY; final String create_Certificate_Query; }