@Test public void test_for_search_by_agreement() { final AgreementCriteria agreementCriteria = getAgreementCriteria(); when(agreementRepository.findByAgreement(any(), any())) .thenReturn(getAgreementsList()); final List<Agreement> agreements = agreementService.searchAgreement(agreementCriteria, getRequestInfo()); assertEquals("454", agreements.get(0).getCouncilNumber()); assertEquals(2000.0, agreements.get(0).getRent(), 0.0); }
public List<Agreement> searchAgreement(final AgreementCriteria agreementCriteria, final RequestInfo requestInfo) { if (agreementCriteria.getToDate() != null) agreementCriteria.setToDate(setToTime(agreementCriteria.getToDate())); if (agreementCriteria.isAgreementAndAssetAndAllotteeNotNull()) { log.info("agreementRepository.findByAllotee"); return agreementRepository.findByAllotee(agreementCriteria, requestInfo); } else if (agreementCriteria.isAssetOnlyNull()) { log.info("agreementRepository.findByAllotee"); return agreementRepository.findByAgreementAndAllotee(agreementCriteria, requestInfo); } else if (agreementCriteria.isAllotteeOnlyNull()) { log.info("agreementRepository.findByAgreementAndAsset : both agreement and "); return agreementRepository.findByAgreementAndAsset(agreementCriteria, requestInfo); } else if (agreementCriteria.isAgreementAndAssetNull() || agreementCriteria.isAgreementOnlyNull()) { log.info("agreementRepository.findByAllotee : only allottee || allotte and asset"); return agreementRepository.findByAllotee(agreementCriteria, requestInfo); } else if (agreementCriteria.isAgreementAndAllotteeNull()) { log.info("agreementRepository.findByAsset : only asset"); return agreementRepository.findByAsset(agreementCriteria, requestInfo); } else if (agreementCriteria.isAssetAndAllotteeNull()) { log.info("agreementRepository.findByAgreement : only agreement"); return agreementRepository.findByAgreement(agreementCriteria, requestInfo); } else { log.info("agreementRepository.findByAgreement : all values null"); return agreementRepository.findByAgreement(agreementCriteria, requestInfo); } }
AgreementService { public List<Agreement> searchAgreement(final AgreementCriteria agreementCriteria, final RequestInfo requestInfo) { if (agreementCriteria.getToDate() != null) agreementCriteria.setToDate(setToTime(agreementCriteria.getToDate())); if (agreementCriteria.isAgreementAndAssetAndAllotteeNotNull()) { log.info("agreementRepository.findByAllotee"); return agreementRepository.findByAllotee(agreementCriteria, requestInfo); } else if (agreementCriteria.isAssetOnlyNull()) { log.info("agreementRepository.findByAllotee"); return agreementRepository.findByAgreementAndAllotee(agreementCriteria, requestInfo); } else if (agreementCriteria.isAllotteeOnlyNull()) { log.info("agreementRepository.findByAgreementAndAsset : both agreement and "); return agreementRepository.findByAgreementAndAsset(agreementCriteria, requestInfo); } else if (agreementCriteria.isAgreementAndAssetNull() || agreementCriteria.isAgreementOnlyNull()) { log.info("agreementRepository.findByAllotee : only allottee || allotte and asset"); return agreementRepository.findByAllotee(agreementCriteria, requestInfo); } else if (agreementCriteria.isAgreementAndAllotteeNull()) { log.info("agreementRepository.findByAsset : only asset"); return agreementRepository.findByAsset(agreementCriteria, requestInfo); } else if (agreementCriteria.isAssetAndAllotteeNull()) { log.info("agreementRepository.findByAgreement : only agreement"); return agreementRepository.findByAgreement(agreementCriteria, requestInfo); } else { log.info("agreementRepository.findByAgreement : all values null"); return agreementRepository.findByAgreement(agreementCriteria, requestInfo); } } }
AgreementService { public List<Agreement> searchAgreement(final AgreementCriteria agreementCriteria, final RequestInfo requestInfo) { if (agreementCriteria.getToDate() != null) agreementCriteria.setToDate(setToTime(agreementCriteria.getToDate())); if (agreementCriteria.isAgreementAndAssetAndAllotteeNotNull()) { log.info("agreementRepository.findByAllotee"); return agreementRepository.findByAllotee(agreementCriteria, requestInfo); } else if (agreementCriteria.isAssetOnlyNull()) { log.info("agreementRepository.findByAllotee"); return agreementRepository.findByAgreementAndAllotee(agreementCriteria, requestInfo); } else if (agreementCriteria.isAllotteeOnlyNull()) { log.info("agreementRepository.findByAgreementAndAsset : both agreement and "); return agreementRepository.findByAgreementAndAsset(agreementCriteria, requestInfo); } else if (agreementCriteria.isAgreementAndAssetNull() || agreementCriteria.isAgreementOnlyNull()) { log.info("agreementRepository.findByAllotee : only allottee || allotte and asset"); return agreementRepository.findByAllotee(agreementCriteria, requestInfo); } else if (agreementCriteria.isAgreementAndAllotteeNull()) { log.info("agreementRepository.findByAsset : only asset"); return agreementRepository.findByAsset(agreementCriteria, requestInfo); } else if (agreementCriteria.isAssetAndAllotteeNull()) { log.info("agreementRepository.findByAgreement : only agreement"); return agreementRepository.findByAgreement(agreementCriteria, requestInfo); } else { log.info("agreementRepository.findByAgreement : all values null"); return agreementRepository.findByAgreement(agreementCriteria, requestInfo); } }  }
AgreementService { public List<Agreement> searchAgreement(final AgreementCriteria agreementCriteria, final RequestInfo requestInfo) { if (agreementCriteria.getToDate() != null) agreementCriteria.setToDate(setToTime(agreementCriteria.getToDate())); if (agreementCriteria.isAgreementAndAssetAndAllotteeNotNull()) { log.info("agreementRepository.findByAllotee"); return agreementRepository.findByAllotee(agreementCriteria, requestInfo); } else if (agreementCriteria.isAssetOnlyNull()) { log.info("agreementRepository.findByAllotee"); return agreementRepository.findByAgreementAndAllotee(agreementCriteria, requestInfo); } else if (agreementCriteria.isAllotteeOnlyNull()) { log.info("agreementRepository.findByAgreementAndAsset : both agreement and "); return agreementRepository.findByAgreementAndAsset(agreementCriteria, requestInfo); } else if (agreementCriteria.isAgreementAndAssetNull() || agreementCriteria.isAgreementOnlyNull()) { log.info("agreementRepository.findByAllotee : only allottee || allotte and asset"); return agreementRepository.findByAllotee(agreementCriteria, requestInfo); } else if (agreementCriteria.isAgreementAndAllotteeNull()) { log.info("agreementRepository.findByAsset : only asset"); return agreementRepository.findByAsset(agreementCriteria, requestInfo); } else if (agreementCriteria.isAssetAndAllotteeNull()) { log.info("agreementRepository.findByAgreement : only agreement"); return agreementRepository.findByAgreement(agreementCriteria, requestInfo); } else { log.info("agreementRepository.findByAgreement : all values null"); return agreementRepository.findByAgreement(agreementCriteria, requestInfo); } }  boolean isAgreementExist(final String code); List<Agreement> getAgreementsForAssetId(final Long assetId); List<Agreement> getAgreementsForAssetIdAndFloor(final Agreement agreement, final Long assetId); List<Agreement> getAllHistoryAgreementsForAsset(final Agreement agreement); Agreement createAgreement(final AgreementRequest agreementRequest); Agreement modifyAgreement(final AgreementRequest agreementRequest); Agreement createEviction(final AgreementRequest agreementRequest); Agreement createCancellation(final AgreementRequest agreementRequest); Agreement createRenewal(final AgreementRequest agreementRequest); Agreement createObjection(final AgreementRequest agreementRequest); Agreement createJudgement(final AgreementRequest agreementRequest); Agreement createRemission(final AgreementRequest agreementRequest); Agreement updateAgreement(final AgreementRequest agreementRequest); Agreement updateCancellation(final AgreementRequest agreementRequest); Agreement updateEviction(final AgreementRequest agreementRequest); Agreement updateObjectionAndJudgement(final AgreementRequest agreementRequest); Agreement updateRenewal(final AgreementRequest agreementRequest); Agreement updateRemission(final AgreementRequest agreementRequest); Agreement saveRemission(final AgreementRequest agreementRequest); List<Agreement> searchAgreement(final AgreementCriteria agreementCriteria, final RequestInfo requestInfo); List<Agreement> searchAgreementByAgreementNo(final AgreementCriteria agreementCriteria, final RequestInfo requestInfo); List<Agreement> getAgreementsByAgreementNumber(final AgreementCriteria agreementCriteria,
            final RequestInfo requestInfo); List<Demand> prepareLegacyDemands(final AgreementRequest agreementRequest); List<Demand> prepareDemands(final AgreementRequest agreementRequest); List<Demand> getDemands(final AgreementRequest agreementRequest); void updateAdvanceFlag(final Agreement agreement); Date getExpiryDate(final Agreement agreement); String checkRenewalStatus(final AgreementRequest agreementRequest); String checkObjectionStatus(final AgreementRequest agreementRequest); void setDetailsByAssetCategory(final Agreement agreement); Date getEffectiveFinYearToDate(); }
AgreementService { public List<Agreement> searchAgreement(final AgreementCriteria agreementCriteria, final RequestInfo requestInfo) { if (agreementCriteria.getToDate() != null) agreementCriteria.setToDate(setToTime(agreementCriteria.getToDate())); if (agreementCriteria.isAgreementAndAssetAndAllotteeNotNull()) { log.info("agreementRepository.findByAllotee"); return agreementRepository.findByAllotee(agreementCriteria, requestInfo); } else if (agreementCriteria.isAssetOnlyNull()) { log.info("agreementRepository.findByAllotee"); return agreementRepository.findByAgreementAndAllotee(agreementCriteria, requestInfo); } else if (agreementCriteria.isAllotteeOnlyNull()) { log.info("agreementRepository.findByAgreementAndAsset : both agreement and "); return agreementRepository.findByAgreementAndAsset(agreementCriteria, requestInfo); } else if (agreementCriteria.isAgreementAndAssetNull() || agreementCriteria.isAgreementOnlyNull()) { log.info("agreementRepository.findByAllotee : only allottee || allotte and asset"); return agreementRepository.findByAllotee(agreementCriteria, requestInfo); } else if (agreementCriteria.isAgreementAndAllotteeNull()) { log.info("agreementRepository.findByAsset : only asset"); return agreementRepository.findByAsset(agreementCriteria, requestInfo); } else if (agreementCriteria.isAssetAndAllotteeNull()) { log.info("agreementRepository.findByAgreement : only agreement"); return agreementRepository.findByAgreement(agreementCriteria, requestInfo); } else { log.info("agreementRepository.findByAgreement : all values null"); return agreementRepository.findByAgreement(agreementCriteria, requestInfo); } }  boolean isAgreementExist(final String code); List<Agreement> getAgreementsForAssetId(final Long assetId); List<Agreement> getAgreementsForAssetIdAndFloor(final Agreement agreement, final Long assetId); List<Agreement> getAllHistoryAgreementsForAsset(final Agreement agreement); Agreement createAgreement(final AgreementRequest agreementRequest); Agreement modifyAgreement(final AgreementRequest agreementRequest); Agreement createEviction(final AgreementRequest agreementRequest); Agreement createCancellation(final AgreementRequest agreementRequest); Agreement createRenewal(final AgreementRequest agreementRequest); Agreement createObjection(final AgreementRequest agreementRequest); Agreement createJudgement(final AgreementRequest agreementRequest); Agreement createRemission(final AgreementRequest agreementRequest); Agreement updateAgreement(final AgreementRequest agreementRequest); Agreement updateCancellation(final AgreementRequest agreementRequest); Agreement updateEviction(final AgreementRequest agreementRequest); Agreement updateObjectionAndJudgement(final AgreementRequest agreementRequest); Agreement updateRenewal(final AgreementRequest agreementRequest); Agreement updateRemission(final AgreementRequest agreementRequest); Agreement saveRemission(final AgreementRequest agreementRequest); List<Agreement> searchAgreement(final AgreementCriteria agreementCriteria, final RequestInfo requestInfo); List<Agreement> searchAgreementByAgreementNo(final AgreementCriteria agreementCriteria, final RequestInfo requestInfo); List<Agreement> getAgreementsByAgreementNumber(final AgreementCriteria agreementCriteria,
            final RequestInfo requestInfo); List<Demand> prepareLegacyDemands(final AgreementRequest agreementRequest); List<Demand> prepareDemands(final AgreementRequest agreementRequest); List<Demand> getDemands(final AgreementRequest agreementRequest); void updateAdvanceFlag(final Agreement agreement); Date getExpiryDate(final Agreement agreement); String checkRenewalStatus(final AgreementRequest agreementRequest); String checkObjectionStatus(final AgreementRequest agreementRequest); void setDetailsByAssetCategory(final Agreement agreement); Date getEffectiveFinYearToDate(); static final String WF_ACTION_APPROVE; static final String WF_ACTION_REJECT; static final String WF_ACTION_CANCEL; static final String WF_ACTION_FORWARD; static final String WF_ACTION_PRINT_NOTICE; static final String LAMS_WORKFLOW_INITIATOR_DESIGNATION; }