### Question:
InsidePaymentServiceImpl implements InsidePaymentService { @Override public Response createAccount(AccountInfo info, HttpHeaders headers) { List<Money> list = addMoneyRepository.findByUserId(info.getUserId()); if (list.isEmpty()) { Money addMoney = new Money(); addMoney.setMoney(info.getMoney()); addMoney.setUserId(info.getUserId()); addMoney.setType(MoneyType.A); addMoneyRepository.save(addMoney); return new Response<>(1, "Create Account Success", null); } else { return new Response<>(0, "Create Account Failed, Account already Exists", 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 testCreateAccount1() { AccountInfo info = new AccountInfo(); List<Money> list = new ArrayList<>(); Mockito.when(addMoneyRepository.findByUserId(Mockito.anyString())).thenReturn(list); Mockito.when(addMoneyRepository.save(Mockito.any(Money.class))).thenReturn(null); Response result = insidePaymentServiceImpl.createAccount(info, headers); Assert.assertEquals(new Response<>(1, "Create Account Success", null), result); }
@Test public void testCreateAccount2() { AccountInfo info = new AccountInfo(); List<Money> list = new ArrayList<>(); list.add(new Money()); Mockito.when(addMoneyRepository.findByUserId(Mockito.anyString())).thenReturn(list); Response result = insidePaymentServiceImpl.createAccount(info, headers); Assert.assertEquals(new Response<>(0, "Create Account Failed, Account already Exists", null), result); }