@Test public final void testNoKey() { HashMap<String, Serializable> inParams = new HashMap<String, Serializable>(); PersonPropertiesResponse ppr = sut.getPersonProperties(inParams); context.assertIsSatisfied(); assertEquals(1, ppr.getTabTemplates().size()); }
@SuppressWarnings("unchecked") @Override public PersonPropertiesResponse getPersonProperties(final Map<String, Serializable> inParameters) { ArrayList<TabTemplate> tabTemplateResults = new ArrayList<TabTemplate>(); Theme themeResult = null; if (inParameters.containsKey(sourceListKey) && !((ArrayList<String>) inParameters.get(sourceListKey)).isEmpty()) { ArrayList<String> sourceList = (ArrayList<String>) inParameters.get(sourceListKey); List<MembershipCriteria> membershipCriteria = membershipCriteriaDAO.execute(null); for (MembershipCriteria mc : membershipCriteria) { for (String source : sourceList) { if (StringUtils.containsIgnoreCase(source, mc.getCriteria())) { if (mc.getGalleryTabTemplate() != null) { tabTemplateResults.add(new TabTemplate(mc.getGalleryTabTemplate().getTabTemplate())); } themeResult = mc.getTheme(); } } } } if (tabTemplateResults.size() == 0) { tabTemplateResults.add(getDefaultTabTemplate()); } return new PersonPropertiesResponse(tabTemplateResults, themeResult); }
MembershipCriteriaPersonPropertyGenerator implements PersonPropertiesGenerator { @SuppressWarnings("unchecked") @Override public PersonPropertiesResponse getPersonProperties(final Map<String, Serializable> inParameters) { ArrayList<TabTemplate> tabTemplateResults = new ArrayList<TabTemplate>(); Theme themeResult = null; if (inParameters.containsKey(sourceListKey) && !((ArrayList<String>) inParameters.get(sourceListKey)).isEmpty()) { ArrayList<String> sourceList = (ArrayList<String>) inParameters.get(sourceListKey); List<MembershipCriteria> membershipCriteria = membershipCriteriaDAO.execute(null); for (MembershipCriteria mc : membershipCriteria) { for (String source : sourceList) { if (StringUtils.containsIgnoreCase(source, mc.getCriteria())) { if (mc.getGalleryTabTemplate() != null) { tabTemplateResults.add(new TabTemplate(mc.getGalleryTabTemplate().getTabTemplate())); } themeResult = mc.getTheme(); } } } } if (tabTemplateResults.size() == 0) { tabTemplateResults.add(getDefaultTabTemplate()); } return new PersonPropertiesResponse(tabTemplateResults, themeResult); } }
MembershipCriteriaPersonPropertyGenerator implements PersonPropertiesGenerator { @SuppressWarnings("unchecked") @Override public PersonPropertiesResponse getPersonProperties(final Map<String, Serializable> inParameters) { ArrayList<TabTemplate> tabTemplateResults = new ArrayList<TabTemplate>(); Theme themeResult = null; if (inParameters.containsKey(sourceListKey) && !((ArrayList<String>) inParameters.get(sourceListKey)).isEmpty()) { ArrayList<String> sourceList = (ArrayList<String>) inParameters.get(sourceListKey); List<MembershipCriteria> membershipCriteria = membershipCriteriaDAO.execute(null); for (MembershipCriteria mc : membershipCriteria) { for (String source : sourceList) { if (StringUtils.containsIgnoreCase(source, mc.getCriteria())) { if (mc.getGalleryTabTemplate() != null) { tabTemplateResults.add(new TabTemplate(mc.getGalleryTabTemplate().getTabTemplate())); } themeResult = mc.getTheme(); } } } } if (tabTemplateResults.size() == 0) { tabTemplateResults.add(getDefaultTabTemplate()); } return new PersonPropertiesResponse(tabTemplateResults, themeResult); } @SuppressWarnings("unchecked")  MembershipCriteriaPersonPropertyGenerator(final String inDefaultTabName, final Layout inDefaultTabLayout,
            final DomainMapper<MapperRequest, List<MembershipCriteria>> inMembershipCriteriaDAO); }
MembershipCriteriaPersonPropertyGenerator implements PersonPropertiesGenerator { @SuppressWarnings("unchecked") @Override public PersonPropertiesResponse getPersonProperties(final Map<String, Serializable> inParameters) { ArrayList<TabTemplate> tabTemplateResults = new ArrayList<TabTemplate>(); Theme themeResult = null; if (inParameters.containsKey(sourceListKey) && !((ArrayList<String>) inParameters.get(sourceListKey)).isEmpty()) { ArrayList<String> sourceList = (ArrayList<String>) inParameters.get(sourceListKey); List<MembershipCriteria> membershipCriteria = membershipCriteriaDAO.execute(null); for (MembershipCriteria mc : membershipCriteria) { for (String source : sourceList) { if (StringUtils.containsIgnoreCase(source, mc.getCriteria())) { if (mc.getGalleryTabTemplate() != null) { tabTemplateResults.add(new TabTemplate(mc.getGalleryTabTemplate().getTabTemplate())); } themeResult = mc.getTheme(); } } } } if (tabTemplateResults.size() == 0) { tabTemplateResults.add(getDefaultTabTemplate()); } return new PersonPropertiesResponse(tabTemplateResults, themeResult); } @SuppressWarnings("unchecked")  MembershipCriteriaPersonPropertyGenerator(final String inDefaultTabName, final Layout inDefaultTabLayout,
            final DomainMapper<MapperRequest, List<MembershipCriteria>> inMembershipCriteriaDAO); @SuppressWarnings("unchecked") @Override PersonPropertiesResponse getPersonProperties(final Map<String, Serializable> inParameters); }
MembershipCriteriaPersonPropertyGenerator implements PersonPropertiesGenerator { @SuppressWarnings("unchecked") @Override public PersonPropertiesResponse getPersonProperties(final Map<String, Serializable> inParameters) { ArrayList<TabTemplate> tabTemplateResults = new ArrayList<TabTemplate>(); Theme themeResult = null; if (inParameters.containsKey(sourceListKey) && !((ArrayList<String>) inParameters.get(sourceListKey)).isEmpty()) { ArrayList<String> sourceList = (ArrayList<String>) inParameters.get(sourceListKey); List<MembershipCriteria> membershipCriteria = membershipCriteriaDAO.execute(null); for (MembershipCriteria mc : membershipCriteria) { for (String source : sourceList) { if (StringUtils.containsIgnoreCase(source, mc.getCriteria())) { if (mc.getGalleryTabTemplate() != null) { tabTemplateResults.add(new TabTemplate(mc.getGalleryTabTemplate().getTabTemplate())); } themeResult = mc.getTheme(); } } } } if (tabTemplateResults.size() == 0) { tabTemplateResults.add(getDefaultTabTemplate()); } return new PersonPropertiesResponse(tabTemplateResults, themeResult); } @SuppressWarnings("unchecked")  MembershipCriteriaPersonPropertyGenerator(final String inDefaultTabName, final Layout inDefaultTabLayout,
            final DomainMapper<MapperRequest, List<MembershipCriteria>> inMembershipCriteriaDAO); @SuppressWarnings("unchecked") @Override PersonPropertiesResponse getPersonProperties(final Map<String, Serializable> inParameters);  }