@Test public void testDefaultThemeAndGttIds() { final Long defaultId = -1L; final MembershipCriteriaDTO mcdto = new MembershipCriteriaDTO(); mcdto.setCriteria(criteria); mcdto.setThemeId(defaultId); mcdto.setGalleryTabTemplateId(defaultId); context.checking(new Expectations() { { oneOf(ac).getParams(); will(returnValue(mcdto)); } }); PersistenceRequest<MembershipCriteria> result = sut.transform(ac); assertEquals(criteria, result.getDomainEnity().getCriteria()); assertNull(result.getDomainEnity().getTheme()); assertNull(result.getDomainEnity().getGalleryTabTemplate()); context.assertIsSatisfied(); }
@Override public PersistenceRequest<MembershipCriteria> transform(final ActionContext inTransformType) { MembershipCriteriaDTO mcdto = (MembershipCriteriaDTO) inTransformType.getParams(); Long themeId = mcdto.getThemeId(); Long gttId = mcdto.getGalleryTabTemplateId(); MembershipCriteria mc = new MembershipCriteria(); mc.setTheme(themeId == null || themeId == -1 ? null : themeProxyMapper.execute(themeId)); mc.setGalleryTabTemplate(gttId == null || gttId == -1 ? null : galleryTabTemplateProxyMapper.execute(gttId)); mc.setCriteria(mcdto.getCriteria()); return new PersistenceRequest<MembershipCriteria>(mc); }
ActionContextMembershipCriteriaDTOToMembershipCriteriaPersistenceRequestTransformer implements
        Transformer<ActionContext, PersistenceRequest<MembershipCriteria>> { @Override public PersistenceRequest<MembershipCriteria> transform(final ActionContext inTransformType) { MembershipCriteriaDTO mcdto = (MembershipCriteriaDTO) inTransformType.getParams(); Long themeId = mcdto.getThemeId(); Long gttId = mcdto.getGalleryTabTemplateId(); MembershipCriteria mc = new MembershipCriteria(); mc.setTheme(themeId == null || themeId == -1 ? null : themeProxyMapper.execute(themeId)); mc.setGalleryTabTemplate(gttId == null || gttId == -1 ? null : galleryTabTemplateProxyMapper.execute(gttId)); mc.setCriteria(mcdto.getCriteria()); return new PersistenceRequest<MembershipCriteria>(mc); } }
ActionContextMembershipCriteriaDTOToMembershipCriteriaPersistenceRequestTransformer implements
        Transformer<ActionContext, PersistenceRequest<MembershipCriteria>> { @Override public PersistenceRequest<MembershipCriteria> transform(final ActionContext inTransformType) { MembershipCriteriaDTO mcdto = (MembershipCriteriaDTO) inTransformType.getParams(); Long themeId = mcdto.getThemeId(); Long gttId = mcdto.getGalleryTabTemplateId(); MembershipCriteria mc = new MembershipCriteria(); mc.setTheme(themeId == null || themeId == -1 ? null : themeProxyMapper.execute(themeId)); mc.setGalleryTabTemplate(gttId == null || gttId == -1 ? null : galleryTabTemplateProxyMapper.execute(gttId)); mc.setCriteria(mcdto.getCriteria()); return new PersistenceRequest<MembershipCriteria>(mc); } ActionContextMembershipCriteriaDTOToMembershipCriteriaPersistenceRequestTransformer(
            final DomainMapper<Long, Theme> inThemeProxyMapper,
            final DomainMapper<Long, GalleryTabTemplate> inGalleryTabTemplateProxyMappery); }
ActionContextMembershipCriteriaDTOToMembershipCriteriaPersistenceRequestTransformer implements
        Transformer<ActionContext, PersistenceRequest<MembershipCriteria>> { @Override public PersistenceRequest<MembershipCriteria> transform(final ActionContext inTransformType) { MembershipCriteriaDTO mcdto = (MembershipCriteriaDTO) inTransformType.getParams(); Long themeId = mcdto.getThemeId(); Long gttId = mcdto.getGalleryTabTemplateId(); MembershipCriteria mc = new MembershipCriteria(); mc.setTheme(themeId == null || themeId == -1 ? null : themeProxyMapper.execute(themeId)); mc.setGalleryTabTemplate(gttId == null || gttId == -1 ? null : galleryTabTemplateProxyMapper.execute(gttId)); mc.setCriteria(mcdto.getCriteria()); return new PersistenceRequest<MembershipCriteria>(mc); } ActionContextMembershipCriteriaDTOToMembershipCriteriaPersistenceRequestTransformer(
            final DomainMapper<Long, Theme> inThemeProxyMapper,
            final DomainMapper<Long, GalleryTabTemplate> inGalleryTabTemplateProxyMappery); @Override PersistenceRequest<MembershipCriteria> transform(final ActionContext inTransformType); }
ActionContextMembershipCriteriaDTOToMembershipCriteriaPersistenceRequestTransformer implements
        Transformer<ActionContext, PersistenceRequest<MembershipCriteria>> { @Override public PersistenceRequest<MembershipCriteria> transform(final ActionContext inTransformType) { MembershipCriteriaDTO mcdto = (MembershipCriteriaDTO) inTransformType.getParams(); Long themeId = mcdto.getThemeId(); Long gttId = mcdto.getGalleryTabTemplateId(); MembershipCriteria mc = new MembershipCriteria(); mc.setTheme(themeId == null || themeId == -1 ? null : themeProxyMapper.execute(themeId)); mc.setGalleryTabTemplate(gttId == null || gttId == -1 ? null : galleryTabTemplateProxyMapper.execute(gttId)); mc.setCriteria(mcdto.getCriteria()); return new PersistenceRequest<MembershipCriteria>(mc); } ActionContextMembershipCriteriaDTOToMembershipCriteriaPersistenceRequestTransformer(
            final DomainMapper<Long, Theme> inThemeProxyMapper,
            final DomainMapper<Long, GalleryTabTemplate> inGalleryTabTemplateProxyMappery); @Override PersistenceRequest<MembershipCriteria> transform(final ActionContext inTransformType);  }