class UserController {

    @PostMapping("/create/user")
    public CreateUserResponse createUser(@RequestBody CreateUserRequest request) throws AdException {
        log.info("ad-sponsor: createUser -> {}", JSON.toJSONString(request));
        return iUserService.createUser(request);
    }

}

class UserControllerTest {

    @Autowired
    private RestTemplate template;
    @Autowired
    private IUserService iUserService;

    @Test
    public void testCreateUser() {

        Map<String, String> map = new HashMap<>();
        map.put("username", "qinyi");
        HttpHeaders headers = new HttpHeaders();
        headers.setContentType(MediaType.APPLICATION_JSON);
        HttpEntity<Map<String, String>> entity = new HttpEntity<>(map, headers);
        CommonResponse response = template.postForEntity("http://127.0.0.1:7000/ad-sponsor/create/user",
                entity,
                CommonResponse.class).getBody();
        log.debug(JSON.toJSONString(response));
    }

}