@SuppressWarnings({ "unchecked", "rawtypes" }) @Test public void getPurposeTest() { String url = "host/service"; Map map = new HashMap<>(); map.put("map", "map"); when(propertiesManager.getPurposeService()).thenReturn("service"); when(restTemplate.getForObject(url, Map.class)).thenReturn(map); }
public Map getPurpose(String tenantId) { Map purpose = null; try { String url = applicationProperties.getHostNameForMonolith(tenantId) + propertiesManager.getPurposeService(); LOGGER.info("url>>>>>>>>>>" + url); purpose = restTemplate.getForObject(url, Map.class); } catch (RestClientException e) { e.printStackTrace(); } LOGGER.info("Purpose>>>>>>>>>>" + purpose); return purpose; }
BillRepository { public Map getPurpose(String tenantId) { Map purpose = null; try { String url = applicationProperties.getHostNameForMonolith(tenantId) + propertiesManager.getPurposeService(); LOGGER.info("url>>>>>>>>>>" + url); purpose = restTemplate.getForObject(url, Map.class); } catch (RestClientException e) { e.printStackTrace(); } LOGGER.info("Purpose>>>>>>>>>>" + purpose); return purpose; } }
BillRepository { public Map getPurpose(String tenantId) { Map purpose = null; try { String url = applicationProperties.getHostNameForMonolith(tenantId) + propertiesManager.getPurposeService(); LOGGER.info("url>>>>>>>>>>" + url); purpose = restTemplate.getForObject(url, Map.class); } catch (RestClientException e) { e.printStackTrace(); } LOGGER.info("Purpose>>>>>>>>>>" + purpose); return purpose; }  }
BillRepository { public Map getPurpose(String tenantId) { Map purpose = null; try { String url = applicationProperties.getHostNameForMonolith(tenantId) + propertiesManager.getPurposeService(); LOGGER.info("url>>>>>>>>>>" + url); purpose = restTemplate.getForObject(url, Map.class); } catch (RestClientException e) { e.printStackTrace(); } LOGGER.info("Purpose>>>>>>>>>>" + purpose); return purpose; }  String createBillAndGetXml(List<BillInfo> billInfos, RequestInfo requestInfo); BillResponse updateBill(List<BillInfo> billInfos, RequestInfo requestInfo); BillInfo searchBill(BillSearchCriteria billSearchCriteria, RequestInfo requestInfo); Map getPurpose(String tenantId); }
BillRepository { public Map getPurpose(String tenantId) { Map purpose = null; try { String url = applicationProperties.getHostNameForMonolith(tenantId) + propertiesManager.getPurposeService(); LOGGER.info("url>>>>>>>>>>" + url); purpose = restTemplate.getForObject(url, Map.class); } catch (RestClientException e) { e.printStackTrace(); } LOGGER.info("Purpose>>>>>>>>>>" + purpose); return purpose; }  String createBillAndGetXml(List<BillInfo> billInfos, RequestInfo requestInfo); BillResponse updateBill(List<BillInfo> billInfos, RequestInfo requestInfo); BillInfo searchBill(BillSearchCriteria billSearchCriteria, RequestInfo requestInfo); Map getPurpose(String tenantId);  }