@Test public void testShouldUpdateAsync() { FeeResponse feeResponse = FeeResponse.builder().fees(getFees()).build(); FeeRequest feeRequest = FeeRequest.builder().fees(getFees()).requestInfo(new RequestInfo()).build(); when(propertiesManager.getUpdateFeeTopicName()).thenReturn("egov-update"); when(kafkaTemplate.send(Matchers.any(String.class), Matchers.any(Object.class))) .thenReturn(new SendResult<>(null, null)); assertTrue(feeResponse.toString().equals(feeService.updateAsync(feeRequest).toString())); }
public FeeResponse updateAsync(FeeRequest feeRequest) { try { kafkaTemplate.send(propertiesManager.getUpdateFeeTopicName(), feeRequest); } catch (Exception e) { e.printStackTrace(); } return getFeeResponse(feeRequest.getFees(), feeRequest.getRequestInfo()); }
FeeService { public FeeResponse updateAsync(FeeRequest feeRequest) { try { kafkaTemplate.send(propertiesManager.getUpdateFeeTopicName(), feeRequest); } catch (Exception e) { e.printStackTrace(); } return getFeeResponse(feeRequest.getFees(), feeRequest.getRequestInfo()); } }
FeeService { public FeeResponse updateAsync(FeeRequest feeRequest) { try { kafkaTemplate.send(propertiesManager.getUpdateFeeTopicName(), feeRequest); } catch (Exception e) { e.printStackTrace(); } return getFeeResponse(feeRequest.getFees(), feeRequest.getRequestInfo()); }  }
FeeService { public FeeResponse updateAsync(FeeRequest feeRequest) { try { kafkaTemplate.send(propertiesManager.getUpdateFeeTopicName(), feeRequest); } catch (Exception e) { e.printStackTrace(); } return getFeeResponse(feeRequest.getFees(), feeRequest.getRequestInfo()); }  FeeResponse getFee(FeeCriteria feeCriteria, RequestInfo requestInfo); FeeResponse createAsync(FeeRequest feeRequest); FeeResponse updateAsync(FeeRequest feeRequest); void createFee(FeeRequest feeRequest); void updateFee(FeeRequest feeRequest); }
FeeService { public FeeResponse updateAsync(FeeRequest feeRequest) { try { kafkaTemplate.send(propertiesManager.getUpdateFeeTopicName(), feeRequest); } catch (Exception e) { e.printStackTrace(); } return getFeeResponse(feeRequest.getFees(), feeRequest.getRequestInfo()); }  FeeResponse getFee(FeeCriteria feeCriteria, RequestInfo requestInfo); FeeResponse createAsync(FeeRequest feeRequest); FeeResponse updateAsync(FeeRequest feeRequest); void createFee(FeeRequest feeRequest); void updateFee(FeeRequest feeRequest);  }