Cannot deserialize representation model to include links inside. These is useful for inside tests to ensure that HATEOAS works properly with the correct links.
See code to show that it doesn't work. Links is empty array on deserializing on representation model class.
// mapper.registerModule(new Jackson2HalModule()); // ???
BookItemDTO bookItemDTO1 =
mapper.readValue(book1.getResponse().getContentAsString(), BookItemDTO.class);
System.out.println(bookItemDTO1);
System.out.println(mapper.readValue(book1.getResponse().getContentAsString(), RepresentationModel.class));
//???
final JavaType entityModelType = mapper.getTypeFactory().constructParametricType(RepresentationModel.class,
BookItemDTO.class );
Conversations in spring-hateoas gitter might be helpful. https://gitter.im/spring-projects/spring-hateoas
As a workaround for now, the DTO will include uuid so that it makes it easy to read and construct the links in the test.
Cannot deserialize representation model to include links inside. These is useful for inside tests to ensure that HATEOAS works properly with the correct links.
See code to show that it doesn't work. Links is empty array on deserializing on representation model class.
Conversations in spring-hateoas gitter might be helpful. https://gitter.im/spring-projects/spring-hateoas
As a workaround for now, the DTO will include uuid so that it makes it easy to read and construct the links in the test.