springboot 测试类

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;

import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RunWith(SpringRunner.class)
@SpringBootTest
public class StaticsServiceImplTest {

@Autowired
private TesterviceImpl service;

@Test
public void ff() {
Map map = new HashMap();
map.put("CXLX","1");
List<Map> list = service.test();
System.out.println(Arrays.toString(list.toArray()));
}

@Test
void fff() {
}
}
原文地址:https://www.cnblogs.com/shihx/p/12577605.html