private RestTemplate restTemplate = new RestTemplate();
@Test
public void getUser() {
UserDTO user = restTemplate.getForObject(resourceUrl + "/{id}.xml", UserDTO.class, 1L);
assertThat(user.getLoginName()).isEqualTo("admin");
assertThat(user.getName()).isEqualTo("管理员");
assertThat(user.getTeamId()).isEqualTo(1);
try {
user = restTemplate.getForObject(resourceUrl + "/{id}.json", UserDTO.class, 1L);
} catch (HttpStatusCodeException e) {
fail(e.getMessage());
}
assertThat(user.getLoginName()).isEqualTo("admin");
assertThat(user.getName()).isEqualTo("管理员");
assertThat(user.getTeamId()).isEqualTo(1);
}