org.junit.vintage.engine.descriptor.RunnerTestDescriptor warnAboutUnfilterableRunner

吴陆奇

关注

阅读 49

2023-03-24

测试代码:

package com.qzcsbj.demo;

import org.junit.jupiter.api.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.test.context.junit4.SpringRunner;

/**
 * @description : <描述>
 */
@RunWith(SpringRunner.class)
@SpringBootTest
public class MyTest {
    @Autowired
    private StringRedisTemplate stringRedisTemplate;

    // 使用StringRedisTemplate对象
    @Test
    public void test1(){
        stringRedisTemplate.opsForValue().set("job","dev");
        System.out.println("set字符串完成。");
        String job = stringRedisTemplate.opsForValue().get("job");
        System.out.println("获取到的job: " + job);
    }
}

 

结果

org.junit.vintage.engine.descriptor.RunnerTestDescriptor warnAboutUnfilterableRunner_System

 

方案:

把@Test导包:import org.junit.jupiter.api.Test;

改为:import org.junit.Test;

 

 

__EOF__


本文作者:持之以恒(韧)
关于博主:擅长性能、全链路、自动化、企业级自动化持续集成(DevOps/TestOps)、测开等


精彩评论(0)

0 0 举报