package com.izouma.wenlvju.web;

import com.izouma.wenlvju.ApplicationTests;
import com.izouma.wenlvju.domain.User;
import com.izouma.wenlvju.exception.BusinessException;
import com.izouma.wenlvju.repo.UserRepo;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;


public class UserControllerTest extends ApplicationTests {

    @Autowired
    private UserController userController;
    @Autowired
    private UserRepo       userRepo;

    @Test
    public void save() {
        User user = userRepo.findById(21L).orElseThrow(new BusinessException("www"));
        user.setPhone("18205083565");
        userController.save(user);
    }
}