DesaServices { public List<ValueMap> getValueMap(Nomenclatures n, String pluginId) { ArrayList<ValueMap> maps = new ArrayList<ValueMap>(); if (n == null) { return maps; } if (n.getACollects() != null) { maps.add(new ValueMap<ACollect>(pluginId + ".a-collect", n.getACollects().getACollect())); } if (n.getAFunds() != null) { maps.add(new ValueMap<AFund>(pluginId + ".a-fund", n.getAFunds().getAFund())); } if (n.getCreCntrls() != null) { maps.add(new ValueMap<CreCntrl>(pluginId + ".cre-cntrl", n.getCreCntrls().getCreCntrl())); } if (n.getDocTypes() != null) { maps.add(new ValueMap<DocType>(pluginId + ".doc-type", n.getDocTypes().getDocType())); } if (n.getLocs() != null) { maps.add(new ValueMap<Loc>(pluginId + ".loc", n.getLocs().getLoc())); } if (n.getPronoms() != null) { maps.add(new ValueMap<Pronom>(pluginId + ".pronom", n.getPronoms().getPronom())); } if (n.getRdCntrls() != null) { maps.add(new ValueMap<RdCntrl>(pluginId + ".rd-cntrl", n.getRdCntrls().getRdCntrl())); } if (n.getRecCls() != null) { maps.add(new ValueMap<RecCl>(pluginId + ".rec-cl", n.getRecCls().getRecCl())); } if (n.getRecTypes() != null) { maps.add(new ValueMap<RecType>(pluginId + ".rec-type", n.getRecTypes().getRecType())); } return maps; } DesaServices(Configuration config); List<ValueMap> getValueMap(Nomenclatures n, String pluginId); Nomenclatures getNomenclatures(DesaConfiguration dc, UserProfile user); DesaClient getDesaClient(DesaConfiguration dc); String getOperatorName(UserProfile operator, DesaConfiguration dc); String getProducerCode(UserProfile operator, DesaConfiguration dc); DesaConfiguration findConfiguration(MetaModel model); DesaConfiguration findConfiguration(String serviceId); DesaConfiguration findConfigurationWithModel(String... modelIds); List<DesaConfiguration> getConfigurations(); static final String PROPERTY_DESASERVICES; static final String PREFIX_DESA; static final String REMOTE_USER_TYPE; }
@Test public void testGetValueMap() { Nomenclatures n = new Nomenclatures(); n.setRecCls(new RecCls()); List<RecCl> recCls = n.getRecCls().getRecCl(); recCls.add(new RecCl()); List<ValueMap> result = desaServices.getValueMap(n, "test"); assertNotNull(result); assertEquals("test.rec-cl", result.get(0).getMapId()); }