}
@Test
public void convertValid() {
PageTemplate template = new PageTemplateImpl("1");
template.setName("name");
template.setSubPageTemplates(new ArrayList<PageTemplate>());
template.setDefaultTemplate(true);
template.setRenderSequence(1);
template.setPageTemplateRegions(new ArrayList<PageTemplateRegion>());
template.setPageLayout(new PageLayoutImpl());
template.setParentPageTemplate(new PageTemplateImpl("1"));
template.setDescription("Description");
template.setPageType(PageType.USER);
JpaPageTemplate jpaTemplate = converter.convert(template);
assertThat(jpaTemplate, is(not(sameInstance(template))));
assertThat(jpaTemplate, is(instanceOf(JpaPageTemplate.class)));
assertThat(jpaTemplate.getId().toString(), is(equalTo(template.getId())));
assertThat(jpaTemplate.getPageType(), is(equalTo(template.getPageType())));
assertThat(jpaTemplate.getName(), is(equalTo(template.getName())));
assertThat(jpaTemplate.getDescription(), is(equalTo(template.getDescription())));
assertThat(jpaTemplate.getParentPageTemplate(), is(instanceOf(JpaPageTemplate.class)));
assertThat(jpaTemplate.getPageLayout(), is(instanceOf(JpaPageLayout.class)));
assertThat(jpaTemplate.getPageTemplateRegions(), is(equalTo(template.getPageTemplateRegions())));
assertThat(jpaTemplate.getRenderSequence(), is(equalTo(template.getRenderSequence())));
assertThat(jpaTemplate.isDefaultTemplate(), is(equalTo(template.isDefaultTemplate())));
assertThat(jpaTemplate.getSubPageTemplates(), is(equalTo(template.getSubPageTemplates())));
}