@RunWith(SpringRunner.class)
@SpringBootTest(classes = Application.class,webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class TestUserController {
@Autowired
private TestRestTemplate restTemplate;
@Test
public void get() throws Exception {
MultiValueMap<String, Object> map = new LinkedMultiValueMap<>();
map.add("phone", "xxx");
String result = restTemplate.postForObject("/my/sendCode", map, String.class);
System.out.println(result);
}
}