reader = new LayoutMetadataReaderFromJson();
}
@Test
public void happyCase() throws Exception {
final LayoutMetadata metadata = reader.asLayoutMetadata(ExampleDomainObject.class);
assertThat(metadata, is(not(nullValue())));
assertThat(metadata.getColumns(), is(not(nullValue())));
assertThat(metadata.getColumns().size(), is(4));
assertThat(metadata.getColumns().get(0).span, is(3));
assertThat(metadata.getColumns().get(1).span, is(4));
assertThat(metadata.getColumns().get(2).span, is(0));
assertThat(metadata.getColumns().get(3).span, is(5));
assertThat(metadata.getColumns().get(0).memberGroups, is(not(nullValue())));
assertThat(metadata.getColumns().get(0).memberGroups.size(), is(2));
assertThat(metadata.getColumns().get(0).memberGroups.containsKey("General"), is(true));
assertThat(metadata.getColumns().get(0).memberGroups.get("General").members, is(not(nullValue())));
assertThat(metadata.getColumns().get(0).memberGroups.get("General").members.size(), is(3));
assertThat(metadata.getColumns().get(0).memberGroups.get("General").members.containsKey("complete"), is(true));
assertThat(metadata.getColumns().get(0).memberGroups.get("General").members.get("complete").actions, is(not(nullValue())));
assertThat(metadata.getColumns().get(0).memberGroups.get("General").members.get("complete").actions.size(), is(2));
assertThat(metadata.getColumns().get(0).memberGroups.get("General").members.get("complete").actions.containsKey("completed"), is(true));
assertThat(metadata.getColumns().get(3).collections, is(not(nullValue())));
assertThat(metadata.getColumns().get(3).collections.containsKey("dependencies"), is(true));
assertThat(metadata.getColumns().get(3).collections.get("dependencies").actions, is(not(nullValue())));
assertThat(metadata.getColumns().get(3).collections.get("dependencies").actions.size(), is(2));
assertThat(metadata.getColumns().get(3).collections.get("dependencies").actions.containsKey("add"), is(true));
assertThat(metadata.getColumns().get(3).collections.get("dependencies").paged, is(not(nullValue())));
assertThat(metadata.getColumns().get(3).collections.get("dependencies").paged, is(not(nullValue())));
assertThat(metadata.getColumns().get(3).collections.get("dependencies").render, is(not(nullValue())));
assertThat(metadata.getColumns().get(3).collections.get("dependencies").render.value, is(nullValue()));
assertThat(metadata.getColumns().get(3).collections.containsKey("similarItems"), is(true));
assertThat(metadata.getColumns().get(3).collections.get("similarItems").render, is(not(nullValue())));
assertThat(metadata.getColumns().get(3).collections.get("similarItems").render.value, is(Render.Type.LAZILY));
assertThat(metadata.getActions(), is(not(nullValue())));
assertThat(metadata.getActions().size(), is(2));
assertThat(metadata.getActions().containsKey("delete"), is(true));
}