敏捷工具
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
876 B

2 years ago
  1. package com.whn.hellospring;
  2. import com.whn.hellospring.model.CustomerDO;
  3. import com.whn.hellospring.repository.CustomerRepository;
  4. import lombok.extern.slf4j.Slf4j;
  5. import org.junit.jupiter.api.Test;
  6. import org.springframework.beans.factory.annotation.Autowired;
  7. import org.springframework.boot.test.context.SpringBootTest;
  8. import java.util.List;
  9. @SpringBootTest
  10. @Slf4j
  11. public class CustomerTest {
  12. @Autowired
  13. CustomerRepository customerRepository;
  14. /**
  15. * 新增一个顾客
  16. */
  17. @Test
  18. void createCustomer(){
  19. CustomerDO customerDO = CustomerDO.builder().age(18).name("李四").phone("18657545213").pass_word("123456").build();
  20. customerRepository.save(customerDO);
  21. }
  22. /**
  23. * 获取顾客列表
  24. */
  25. @Test
  26. void queryCustomerList(){
  27. log.info("CustomerList{}",customerRepository.findAll());
  28. }
  29. }