Page extends AbstractPage implements HasUUID { @JsonView({JsonViewPersistence.class}) public String getDescription() { return description; }  @JsonView({JsonViewLight.class, JsonViewPersistence.class}) String getType(); void setType(String type); @JsonView({JsonViewLight.class, JsonViewPersistence.class}) String getUUID(); void setUUID(String uuid); @JsonView({JsonViewPersistence.class}) String getDescription(); void setDescription(String description); @JsonView({JsonViewPersistence.class}) String getDisplayName(); void setDisplayName(String displayName);  }
@Test public void jsonview_persitence_should_manage_all_fields() throws Exception { Page pageInitial = createAFilledPage(); Page pageAfterJsonProcessing = objectMapper.readValue( objectMapper.writeValueAsString(pageInitial), Page.class); assertThat(pageAfterJsonProcessing.getName()).isNotNull(); assertThat(pageAfterJsonProcessing.getId()).isNotNull(); assertThat(pageAfterJsonProcessing.getVariables()).isNotEmpty(); assertThat(pageAfterJsonProcessing.getRows()).isNotNull(); assertThat(((Component) ((Container) pageAfterJsonProcessing.getRows().get(0).get(1)).getRows().get(1).get(1)).getDescription()).isNotNull().isNotEmpty(); }
@Test public void jsonview_persitence_should_persist_component_name_and_description() throws Exception { Page pageInitial = PageBuilder.aPage().with(anInput().withDescription("A mandatory name input").build()).build(); Page pageAfterJsonProcessing = objectMapper.readValue( objectMapper.writeValueAsString(pageInitial), Page.class); Component component = (Component) pageAfterJsonProcessing.getRows().get(0).get(0); assertThat(component.getDescription()).isNotNull().isNotEmpty(); }