SpringBoot---2.SpringBoot整合其他框架

一、SpringBoot整合Junit

image

点击查看代码
package com.huawei;

import com.huawei.hello.SpringbootTestApplication;
import com.huawei.hello.service.UserService;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

/**
 * 功能描述
 *
 * @author n00568290
 * @since 2022-03-01
 */
@RunWith(SpringRunner.class)
@SpringBootTest(classes = SpringbootTestApplication.class)
public class UserServiceTest {
    @Autowired
    private UserService userService;

    @Test
    public void testAdd() {
        userService.add();
    }
}

二、SpringBoot整合Redis

、、
posted @ 2022-02-27 22:16  nxf_rabbit75  阅读(56)  评论(0)    收藏  举报