### Question:
InsidePaymentServiceImpl implements InsidePaymentService { @Override public Response queryPayment(HttpHeaders headers) { List<Payment> payments = paymentRepository.findAll(); if (payments != null && !payments.isEmpty()) { return new Response<>(1, "Query Payment Success", payments); }else { return new Response<>(0, "Query Payment Failed", null); } }  @Override Response pay(PaymentInfo info, HttpHeaders headers); @Override Response createAccount(AccountInfo info, HttpHeaders headers); @Override Response addMoney(String userId, String money, HttpHeaders headers); @Override Response queryAccount(HttpHeaders headers); String queryAccount(String userId, HttpHeaders headers); @Override Response queryPayment(HttpHeaders headers); @Override Response drawBack(String userId, String money, HttpHeaders headers); @Override Response payDifference(PaymentInfo info, HttpHeaders headers); @Override Response queryAddMoney(HttpHeaders headers); @Override void initPayment(Payment payment, HttpHeaders headers); @Autowired
    public AddMoneyRepository addMoneyRepository; @Autowired
    public PaymentRepository paymentRepository; @Autowired
    public RestTemplate restTemplate; }### Answer:
@Test public void testQueryPayment1() { List<Payment> payments = new ArrayList<>(); payments.add(new Payment()); Mockito.when(paymentRepository.findAll()).thenReturn(payments); Response result = insidePaymentServiceImpl.queryPayment(headers); Assert.assertEquals(new Response<>(1, "Query Payment Success", payments), result); }
@Test public void testQueryPayment2() { Mockito.when(paymentRepository.findAll()).thenReturn(null); Response result = insidePaymentServiceImpl.queryPayment(headers); Assert.assertEquals(new Response<>(0, "Query Payment Failed", null), result); }