@RunWith注释时报错的问题

写个一个UserServicetest放在test包中
UserserviceTest:

package com.itheima.test;

import org.apache.catalina.User;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

@RunWith(SpringRunner.class)
@SpringBootTest(classes = SpringbootTestApplication.class)
public class UserServiceTest {
    @Autowired
    private UserService userService;
    @Test
    public void testAdd(){
        userService.add();
    }
}

img

目录:

img

其中RunWith报错,尝试了网上的方法,修改了配置文件pom
但还是报错,请问怎么解决呢?

测试类 要同启动类类名加Test 且在test资源包下 只要一个@SpringBootTest注解就好了