@SuppressWarnings("unchecked") @Test public void test_Depreciate_Asset() { final DepreciationResponse depreciationResponse = getDepreciationReponse(); final DepreciationRequest depreciationRequest = DepreciationRequest.builder().requestInfo(new RequestInfo()) .depreciationCriteria(getDepreciationCriteria()).build(); final HttpHeaders headers = getHttpHeaders(); final FinancialYearContractResponse financialYearContractResponse = getFinancialYearContractResponse(); when(restTemplate.postForObject(any(String.class), any(Object.class), any(Class.class))) .thenReturn(financialYearContractResponse); assertNotEquals(depreciationResponse.toString(), depreciationService.saveDepreciateAsset(depreciationRequest, headers).toString()); }
public Depreciation saveDepreciateAsset(final DepreciationRequest depreciationRequest, final HttpHeaders headers) { final RequestInfo requestInfo = depreciationRequest.getRequestInfo(); getFinancialYearData(depreciationRequest, requestInfo); final Depreciation depreciation = depreciateAssets(depreciationRequest, headers); depreciation.setAuditDetails(assetCommonService.getAuditDetails(requestInfo)); persistDepreciation(depreciation); return depreciation; }
DepreciationService { public Depreciation saveDepreciateAsset(final DepreciationRequest depreciationRequest, final HttpHeaders headers) { final RequestInfo requestInfo = depreciationRequest.getRequestInfo(); getFinancialYearData(depreciationRequest, requestInfo); final Depreciation depreciation = depreciateAssets(depreciationRequest, headers); depreciation.setAuditDetails(assetCommonService.getAuditDetails(requestInfo)); persistDepreciation(depreciation); return depreciation; } }
DepreciationService { public Depreciation saveDepreciateAsset(final DepreciationRequest depreciationRequest, final HttpHeaders headers) { final RequestInfo requestInfo = depreciationRequest.getRequestInfo(); getFinancialYearData(depreciationRequest, requestInfo); final Depreciation depreciation = depreciateAssets(depreciationRequest, headers); depreciation.setAuditDetails(assetCommonService.getAuditDetails(requestInfo)); persistDepreciation(depreciation); return depreciation; }  }
DepreciationService { public Depreciation saveDepreciateAsset(final DepreciationRequest depreciationRequest, final HttpHeaders headers) { final RequestInfo requestInfo = depreciationRequest.getRequestInfo(); getFinancialYearData(depreciationRequest, requestInfo); final Depreciation depreciation = depreciateAssets(depreciationRequest, headers); depreciation.setAuditDetails(assetCommonService.getAuditDetails(requestInfo)); persistDepreciation(depreciation); return depreciation; }  Depreciation saveDepreciateAsset(final DepreciationRequest depreciationRequest,
            final HttpHeaders headers); Depreciation depreciateAssets(final DepreciationRequest depreciationRequest, final HttpHeaders headers); void validationAndGenerationDepreciationVoucherDetails(final List<DepreciationInputs> depreciationInputsList,
            final List<DepreciationDetail> depreciationDetailsList, final List<AssetCurrentValue> currValList,
            final String tenantId,
            final HttpHeaders headers, final RequestInfo requestInfo); void persistDepreciation(final Depreciation depreciation); DepreciationReportResponse getDepreciationReport(final RequestInfo requestInfo,
            final DepreciationReportCriteria depreciationReportCriteria); List<DepreciationReportCriteria> getDepreciation(final String tenantId, final Long assetId,
            final RequestInfo requestInfo); }
DepreciationService { public Depreciation saveDepreciateAsset(final DepreciationRequest depreciationRequest, final HttpHeaders headers) { final RequestInfo requestInfo = depreciationRequest.getRequestInfo(); getFinancialYearData(depreciationRequest, requestInfo); final Depreciation depreciation = depreciateAssets(depreciationRequest, headers); depreciation.setAuditDetails(assetCommonService.getAuditDetails(requestInfo)); persistDepreciation(depreciation); return depreciation; }  Depreciation saveDepreciateAsset(final DepreciationRequest depreciationRequest,
            final HttpHeaders headers); Depreciation depreciateAssets(final DepreciationRequest depreciationRequest, final HttpHeaders headers); void validationAndGenerationDepreciationVoucherDetails(final List<DepreciationInputs> depreciationInputsList,
            final List<DepreciationDetail> depreciationDetailsList, final List<AssetCurrentValue> currValList,
            final String tenantId,
            final HttpHeaders headers, final RequestInfo requestInfo); void persistDepreciation(final Depreciation depreciation); DepreciationReportResponse getDepreciationReport(final RequestInfo requestInfo,
            final DepreciationReportCriteria depreciationReportCriteria); List<DepreciationReportCriteria> getDepreciation(final String tenantId, final Long assetId,
            final RequestInfo requestInfo);  }