From f1dc2634c3920c5e2759f93ac1029dd67b94b561 Mon Sep 17 00:00:00 2001
From: cramakri <cramakri>
Date: Wed, 3 Aug 2011 09:12:14 +0000
Subject: [PATCH] MINOR: Added code to the testRegistrationDetailsAvailable to
 test vocabularies as well.

SVN: 22313
---
 .../api/v1/GeneralInformationServiceTest.java        | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/api/v1/GeneralInformationServiceTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/api/v1/GeneralInformationServiceTest.java
index 3592859f956..765313e05f2 100644
--- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/api/v1/GeneralInformationServiceTest.java
+++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/api/v1/GeneralInformationServiceTest.java
@@ -36,6 +36,7 @@ import org.testng.annotations.Test;
 
 import ch.systemsx.cisd.common.utilities.ToStringComparator;
 import ch.systemsx.cisd.openbis.generic.shared.api.v1.IGeneralInformationService;
+import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.ControlledVocabularyPropertyType.VocabularyTerm;
 import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.DataSet;
 import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.DataSet.Connections;
 import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.DataSetType;
@@ -51,6 +52,7 @@ import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.SearchCriteria.MatchCl
 import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.SearchCriteria.MatchClauseAttribute;
 import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.SearchSubCriteria;
 import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.SpaceWithProjectsAndRoleAssignments;
+import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Vocabulary;
 import ch.systemsx.cisd.openbis.systemtest.SystemTestCase;
 
 /**
@@ -584,6 +586,16 @@ public class GeneralInformationServiceTest extends SystemTestCase
                 generalInformationService.listDataSetsForSample(sessionToken, sample, false);
         assertTrue(dataSets.size() > 0);
         assertNotNull(dataSets.get(0).getRegistrationDetails().getRegistrationDate());
+
+        // vocabularies
+        Map<Vocabulary, List<VocabularyTerm>> termMap =
+                generalInformationService.getVocabularyTermsMap(sessionToken);
+        ArrayList<Vocabulary> vocabs = new ArrayList<Vocabulary>(termMap.keySet().size());
+        vocabs.addAll(termMap.keySet());
+        List<VocabularyTerm> terms = termMap.get(vocabs.get(0));
+        assertTrue(terms.size() > 0);
+        assertNotNull(terms.get(0).getRegistrationDetails().getUserId());
+        assertNotNull(terms.get(0).getRegistrationDetails().getRegistrationDate());
     }
 
     private void checkRegistrationDetails(EntityRegistrationDetails registrationDetails)
-- 
GitLab