@Test public void testCreateDemand() { MarriageRegnRequest marriageRegnRequest=MarriageRegnRequest.builder().marriageRegn(getMarriageRegnFromDB().get(0)).build(); DemandResponse demandResponse= new DemandResponse(); demandResponse.setDemands(getDemand()); DemandRequest demandRequest= new DemandRequest(); when(propertiesManager.getBillingServiceHostName()).thenReturn(StringUtils.EMPTY); when(propertiesManager.getDemandBusinessService()).thenReturn(StringUtils.EMPTY); when(restTemplate.postForObject(any(URI.class), any(DemandRequest.class),any(Class.class))).thenReturn(demandResponse); }
public DemandResponse createDemand(List<Demand> demands, RequestInfo requestInfo) { log.info(" DemandServiceRepository createDemand requestInfo" + requestInfo); DemandRequest demandRequest = new DemandRequest(); demandRequest.setRequestInfo(requestInfo); demandRequest.setDemands(demands); log.info("DemandServiceRepository createDemand(), demands --> " + demands); String url = propertiesManager.getBillingServiceHostName() + propertiesManager.getBillingServiceCreatedDemand(); log.info("DemandServiceRepository createDemand(), URL - > " + url + " \n demandRequest --> " + demandRequest); return restTemplate.postForObject(url, demandRequest, DemandResponse.class); }
DemandServiceRepository { public DemandResponse createDemand(List<Demand> demands, RequestInfo requestInfo) { log.info(" DemandServiceRepository createDemand requestInfo" + requestInfo); DemandRequest demandRequest = new DemandRequest(); demandRequest.setRequestInfo(requestInfo); demandRequest.setDemands(demands); log.info("DemandServiceRepository createDemand(), demands --> " + demands); String url = propertiesManager.getBillingServiceHostName() + propertiesManager.getBillingServiceCreatedDemand(); log.info("DemandServiceRepository createDemand(), URL - > " + url + " \n demandRequest --> " + demandRequest); return restTemplate.postForObject(url, demandRequest, DemandResponse.class); } }
DemandServiceRepository { public DemandResponse createDemand(List<Demand> demands, RequestInfo requestInfo) { log.info(" DemandServiceRepository createDemand requestInfo" + requestInfo); DemandRequest demandRequest = new DemandRequest(); demandRequest.setRequestInfo(requestInfo); demandRequest.setDemands(demands); log.info("DemandServiceRepository createDemand(), demands --> " + demands); String url = propertiesManager.getBillingServiceHostName() + propertiesManager.getBillingServiceCreatedDemand(); log.info("DemandServiceRepository createDemand(), URL - > " + url + " \n demandRequest --> " + demandRequest); return restTemplate.postForObject(url, demandRequest, DemandResponse.class); }  }
DemandServiceRepository { public DemandResponse createDemand(List<Demand> demands, RequestInfo requestInfo) { log.info(" DemandServiceRepository createDemand requestInfo" + requestInfo); DemandRequest demandRequest = new DemandRequest(); demandRequest.setRequestInfo(requestInfo); demandRequest.setDemands(demands); log.info("DemandServiceRepository createDemand(), demands --> " + demands); String url = propertiesManager.getBillingServiceHostName() + propertiesManager.getBillingServiceCreatedDemand(); log.info("DemandServiceRepository createDemand(), URL - > " + url + " \n demandRequest --> " + demandRequest); return restTemplate.postForObject(url, demandRequest, DemandResponse.class); }  List<Demand> prepareDemand(MarriageRegnRequest marriageRegnRequest); DemandResponse createDemand(List<Demand> demands, RequestInfo requestInfo); }
DemandServiceRepository { public DemandResponse createDemand(List<Demand> demands, RequestInfo requestInfo) { log.info(" DemandServiceRepository createDemand requestInfo" + requestInfo); DemandRequest demandRequest = new DemandRequest(); demandRequest.setRequestInfo(requestInfo); demandRequest.setDemands(demands); log.info("DemandServiceRepository createDemand(), demands --> " + demands); String url = propertiesManager.getBillingServiceHostName() + propertiesManager.getBillingServiceCreatedDemand(); log.info("DemandServiceRepository createDemand(), URL - > " + url + " \n demandRequest --> " + demandRequest); return restTemplate.postForObject(url, demandRequest, DemandResponse.class); }  List<Demand> prepareDemand(MarriageRegnRequest marriageRegnRequest); DemandResponse createDemand(List<Demand> demands, RequestInfo requestInfo);  }