From 90dd15adf49764d17b143001e2e2ce506b1be843 Mon Sep 17 00:00:00 2001 From: Aron Roberts Date: Thu, 3 May 2012 18:09:10 -0700 Subject: [PATCH] CSPACE-5155: Updated AuthRefs tests in ten services and AuthRefsDocs test in Intake to create Person items using new schema with repeatable term group. --- .../services/client/test/AcquisitionAuthRefsTest.java | 9 ++++++++- .../services/client/test/BlobAuthRefsTest.java | 9 ++++++++- .../client/test/CollectionObjectAuthRefsTest.java | 9 ++++++++- .../services/client/test/IntakeAuthRefsTest.java | 9 ++++++++- .../services/client/test/PersonAuthRefDocsTest.java | 9 ++++++++- .../services/client/test/LoaninAuthRefsTest.java | 9 ++++++++- .../services/client/test/LoanoutAuthRefsTest.java | 9 ++++++++- .../services/client/test/MediaAuthRefsTest.java | 9 ++++++++- .../services/client/test/MovementAuthRefsTest.java | 9 ++++++++- .../services/client/test/ObjectExitAuthRefsTest.java | 11 ++++++++++- .../client/test/OrgAuthorityAuthRefsTest.java | 9 ++++++++- 11 files changed, 90 insertions(+), 11 deletions(-) diff --git a/services/acquisition/client/src/test/java/org/collectionspace/services/client/test/AcquisitionAuthRefsTest.java b/services/acquisition/client/src/test/java/org/collectionspace/services/client/test/AcquisitionAuthRefsTest.java index a7980074e..2c068d838 100644 --- a/services/acquisition/client/src/test/java/org/collectionspace/services/client/test/AcquisitionAuthRefsTest.java +++ b/services/acquisition/client/src/test/java/org/collectionspace/services/client/test/AcquisitionAuthRefsTest.java @@ -44,6 +44,7 @@ import org.collectionspace.services.acquisition.AcquisitionFunding; import org.collectionspace.services.acquisition.AcquisitionFundingList; import org.collectionspace.services.acquisition.AcquisitionSourceList; import org.collectionspace.services.acquisition.OwnerList; +import org.collectionspace.services.person.PersonTermGroup; import org.jboss.resteasy.client.ClientResponse; @@ -200,10 +201,16 @@ public class AcquisitionAuthRefsTest extends BaseServiceTest personInfo.put(PersonJAXBSchema.FORE_NAME, firstName); personInfo.put(PersonJAXBSchema.SUR_NAME, surName); personInfo.put(PersonJAXBSchema.SHORT_IDENTIFIER, shortId); + List personTerms = new ArrayList(); + PersonTermGroup term = new PersonTermGroup(); + String termName = firstName + " " + surName; + term.setTermDisplayName(termName); + term.setTermName(termName); + personTerms.add(term); PersonAuthorityClient personAuthClient = new PersonAuthorityClient(); PoxPayloadOut multipart = PersonAuthorityClientUtils.createPersonInstance(personAuthCSID, - authRefName, personInfo, null, personAuthClient.getItemCommonPartName()); + authRefName, personInfo, personTerms, personAuthClient.getItemCommonPartName()); ClientResponse res = personAuthClient.createItem(personAuthCSID, multipart); int statusCode = res.getStatus(); diff --git a/services/blob/client/src/test/java/org/collectionspace/services/client/test/BlobAuthRefsTest.java b/services/blob/client/src/test/java/org/collectionspace/services/client/test/BlobAuthRefsTest.java index 8f5626471..b8a547394 100644 --- a/services/blob/client/src/test/java/org/collectionspace/services/client/test/BlobAuthRefsTest.java +++ b/services/blob/client/src/test/java/org/collectionspace/services/client/test/BlobAuthRefsTest.java @@ -41,6 +41,7 @@ import org.collectionspace.services.client.PoxPayloadOut; import org.collectionspace.services.common.authorityref.AuthorityRefList; import org.collectionspace.services.jaxb.AbstractCommonList; import org.collectionspace.services.blob.BlobsCommon; +import org.collectionspace.services.person.PersonTermGroup; import org.jboss.resteasy.client.ClientResponse; @@ -157,8 +158,14 @@ public class BlobAuthRefsTest extends BaseServiceTest { personInfo.put(PersonJAXBSchema.FORE_NAME, firstName); personInfo.put(PersonJAXBSchema.SUR_NAME, surName); personInfo.put(PersonJAXBSchema.SHORT_IDENTIFIER, shortId); + List personTerms = new ArrayList(); + PersonTermGroup term = new PersonTermGroup(); + String termName = firstName + " " + surName; + term.setTermDisplayName(termName); + term.setTermName(termName); + personTerms.add(term); PoxPayloadOut multipart = PersonAuthorityClientUtils.createPersonInstance(personAuthCSID, - authRefName, personInfo, null, personAuthClient.getItemCommonPartName()); + authRefName, personInfo, personTerms, personAuthClient.getItemCommonPartName()); ClientResponse res = personAuthClient.createItem(personAuthCSID, multipart); try { assertStatusCode(res, "createPerson (not a surefire test)"); diff --git a/services/collectionobject/client/src/test/java/org/collectionspace/services/client/test/CollectionObjectAuthRefsTest.java b/services/collectionobject/client/src/test/java/org/collectionspace/services/client/test/CollectionObjectAuthRefsTest.java index 666fa56bb..9df304abc 100644 --- a/services/collectionobject/client/src/test/java/org/collectionspace/services/client/test/CollectionObjectAuthRefsTest.java +++ b/services/collectionobject/client/src/test/java/org/collectionspace/services/client/test/CollectionObjectAuthRefsTest.java @@ -53,6 +53,7 @@ import org.collectionspace.services.collectionobject.FieldCollectorList; import org.collectionspace.services.collectionobject.TitleGroup; import org.collectionspace.services.collectionobject.TitleGroupList; import org.collectionspace.services.jaxb.AbstractCommonList; +import org.collectionspace.services.person.PersonTermGroup; import org.jboss.resteasy.client.ClientResponse; @@ -246,10 +247,16 @@ public class CollectionObjectAuthRefsTest extends BaseServiceTest personTerms = new ArrayList(); + PersonTermGroup term = new PersonTermGroup(); + String termName = firstName + " " + surName; + term.setTermDisplayName(termName); + term.setTermName(termName); + personTerms.add(term); PersonAuthorityClient personAuthClient = new PersonAuthorityClient(); PoxPayloadOut multipart = PersonAuthorityClientUtils.createPersonInstance(personAuthCSID, - personAuthRefName, personInfo, null, personAuthClient.getItemCommonPartName()); + personAuthRefName, personInfo, personTerms, personAuthClient.getItemCommonPartName()); ClientResponse res = personAuthClient.createItem(personAuthCSID, multipart); int statusCode = res.getStatus(); diff --git a/services/intake/client/src/test/java/org/collectionspace/services/client/test/IntakeAuthRefsTest.java b/services/intake/client/src/test/java/org/collectionspace/services/client/test/IntakeAuthRefsTest.java index 394649af2..e2e05f436 100644 --- a/services/intake/client/src/test/java/org/collectionspace/services/client/test/IntakeAuthRefsTest.java +++ b/services/intake/client/src/test/java/org/collectionspace/services/client/test/IntakeAuthRefsTest.java @@ -43,6 +43,7 @@ import org.collectionspace.services.intake.ConditionCheckerOrAssessorList; import org.collectionspace.services.intake.IntakesCommon; import org.collectionspace.services.intake.InsurerList; import org.collectionspace.services.jaxb.AbstractCommonList; +import org.collectionspace.services.person.PersonTermGroup; import org.jboss.resteasy.client.ClientResponse; @@ -202,9 +203,15 @@ public class IntakeAuthRefsTest extends BaseServiceTest { personInfo.put(PersonJAXBSchema.FORE_NAME, firstName); personInfo.put(PersonJAXBSchema.SUR_NAME, surName); personInfo.put(PersonJAXBSchema.SHORT_IDENTIFIER, shortId); + List personTerms = new ArrayList(); + PersonTermGroup term = new PersonTermGroup(); + String termName = firstName + " " + surName; + term.setTermDisplayName(termName); + term.setTermName(termName); + personTerms.add(term); PoxPayloadOut multipart = PersonAuthorityClientUtils.createPersonInstance(personAuthCSID, - authRefName, personInfo, null, personAuthClient.getItemCommonPartName()); + authRefName, personInfo, personTerms, personAuthClient.getItemCommonPartName()); ClientResponse res = personAuthClient.createItem(personAuthCSID, multipart); int statusCode = res.getStatus(); diff --git a/services/intake/client/src/test/java/org/collectionspace/services/client/test/PersonAuthRefDocsTest.java b/services/intake/client/src/test/java/org/collectionspace/services/client/test/PersonAuthRefDocsTest.java index f5ae2be1a..58ea50411 100644 --- a/services/intake/client/src/test/java/org/collectionspace/services/client/test/PersonAuthRefDocsTest.java +++ b/services/intake/client/src/test/java/org/collectionspace/services/client/test/PersonAuthRefDocsTest.java @@ -42,6 +42,7 @@ import org.collectionspace.services.intake.ConditionCheckerOrAssessorList; import org.collectionspace.services.intake.IntakesCommon; import org.collectionspace.services.intake.InsurerList; import org.collectionspace.services.jaxb.AbstractCommonList; +import org.collectionspace.services.person.PersonTermGroup; import org.jboss.resteasy.client.ClientResponse; @@ -228,9 +229,15 @@ public class PersonAuthRefDocsTest extends BaseServiceTest { personInfo.put(PersonJAXBSchema.FORE_NAME, firstName); personInfo.put(PersonJAXBSchema.SUR_NAME, surName); personInfo.put(PersonJAXBSchema.SHORT_IDENTIFIER, shortId); + List personTerms = new ArrayList(); + PersonTermGroup term = new PersonTermGroup(); + String termName = firstName + " " + surName; + term.setTermDisplayName(termName); + term.setTermName(termName); + personTerms.add(term); PoxPayloadOut multipart = PersonAuthorityClientUtils.createPersonInstance(personAuthCSID, - authRefName, personInfo, null, personAuthClient.getItemCommonPartName()); + authRefName, personInfo, personTerms, personAuthClient.getItemCommonPartName()); ClientResponse res = personAuthClient.createItem(personAuthCSID, multipart); int statusCode = res.getStatus(); diff --git a/services/loanin/client/src/test/java/org/collectionspace/services/client/test/LoaninAuthRefsTest.java b/services/loanin/client/src/test/java/org/collectionspace/services/client/test/LoaninAuthRefsTest.java index 0b382bde2..d83dc751e 100644 --- a/services/loanin/client/src/test/java/org/collectionspace/services/client/test/LoaninAuthRefsTest.java +++ b/services/loanin/client/src/test/java/org/collectionspace/services/client/test/LoaninAuthRefsTest.java @@ -44,6 +44,7 @@ import org.collectionspace.services.jaxb.AbstractCommonList; import org.collectionspace.services.loanin.LenderGroup; import org.collectionspace.services.loanin.LenderGroupList; import org.collectionspace.services.loanin.LoansinCommon; +import org.collectionspace.services.person.PersonTermGroup; import org.jboss.resteasy.client.ClientResponse; @@ -209,9 +210,15 @@ public class LoaninAuthRefsTest extends BaseServiceTest { personInfo.put(PersonJAXBSchema.FORE_NAME, firstName); personInfo.put(PersonJAXBSchema.SUR_NAME, surName); personInfo.put(PersonJAXBSchema.SHORT_IDENTIFIER, shortId); + List personTerms = new ArrayList(); + PersonTermGroup term = new PersonTermGroup(); + String termName = firstName + " " + surName; + term.setTermDisplayName(termName); + term.setTermName(termName); + personTerms.add(term); PoxPayloadOut multipart = PersonAuthorityClientUtils.createPersonInstance(personAuthCSID, - authRefName, personInfo, null, personAuthClient.getItemCommonPartName()); + authRefName, personInfo, personTerms, personAuthClient.getItemCommonPartName()); ClientResponse res = personAuthClient.createItem(personAuthCSID, multipart); int statusCode = res.getStatus(); diff --git a/services/loanout/client/src/test/java/org/collectionspace/services/client/test/LoanoutAuthRefsTest.java b/services/loanout/client/src/test/java/org/collectionspace/services/client/test/LoanoutAuthRefsTest.java index cf5eb9b3d..dc2d03765 100644 --- a/services/loanout/client/src/test/java/org/collectionspace/services/client/test/LoanoutAuthRefsTest.java +++ b/services/loanout/client/src/test/java/org/collectionspace/services/client/test/LoanoutAuthRefsTest.java @@ -41,6 +41,7 @@ import org.collectionspace.services.common.authorityref.AuthorityRefList; import org.collectionspace.services.common.datetime.GregorianCalendarDateTimeUtils; import org.collectionspace.services.jaxb.AbstractCommonList; import org.collectionspace.services.loanout.LoansoutCommon; +import org.collectionspace.services.person.PersonTermGroup; import org.jboss.resteasy.client.ClientResponse; @@ -203,9 +204,15 @@ public class LoanoutAuthRefsTest extends BaseServiceTest { personInfo.put(PersonJAXBSchema.FORE_NAME, firstName); personInfo.put(PersonJAXBSchema.SUR_NAME, surName); personInfo.put(PersonJAXBSchema.SHORT_IDENTIFIER, shortId); + List personTerms = new ArrayList(); + PersonTermGroup term = new PersonTermGroup(); + String termName = firstName + " " + surName; + term.setTermDisplayName(termName); + term.setTermName(termName); + personTerms.add(term); PoxPayloadOut multipart = PersonAuthorityClientUtils.createPersonInstance(personAuthCSID, - authRefName, personInfo, null, personAuthClient.getItemCommonPartName()); + authRefName, personInfo, personTerms, personAuthClient.getItemCommonPartName()); ClientResponse res = personAuthClient.createItem(personAuthCSID, multipart); int statusCode = res.getStatus(); diff --git a/services/media/client/src/test/java/org/collectionspace/services/client/test/MediaAuthRefsTest.java b/services/media/client/src/test/java/org/collectionspace/services/client/test/MediaAuthRefsTest.java index 6e18ebf66..e69847e6b 100644 --- a/services/media/client/src/test/java/org/collectionspace/services/client/test/MediaAuthRefsTest.java +++ b/services/media/client/src/test/java/org/collectionspace/services/client/test/MediaAuthRefsTest.java @@ -41,6 +41,7 @@ import org.collectionspace.services.client.PoxPayloadOut; import org.collectionspace.services.common.authorityref.AuthorityRefList; import org.collectionspace.services.jaxb.AbstractCommonList; import org.collectionspace.services.media.MediaCommon; +import org.collectionspace.services.person.PersonTermGroup; import org.jboss.resteasy.client.ClientResponse; @@ -157,8 +158,14 @@ public class MediaAuthRefsTest extends BaseServiceTest { personInfo.put(PersonJAXBSchema.FORE_NAME, firstName); personInfo.put(PersonJAXBSchema.SUR_NAME, surName); personInfo.put(PersonJAXBSchema.SHORT_IDENTIFIER, shortId); + List personTerms = new ArrayList(); + PersonTermGroup term = new PersonTermGroup(); + String termName = firstName + " " + surName; + term.setTermDisplayName(termName); + term.setTermName(termName); + personTerms.add(term); PoxPayloadOut multipart = PersonAuthorityClientUtils.createPersonInstance( - personAuthCSID, authRefName, personInfo, null, personAuthClient.getItemCommonPartName()); + personAuthCSID, authRefName, personInfo, personTerms, personAuthClient.getItemCommonPartName()); ClientResponse res = personAuthClient.createItem(personAuthCSID, multipart); try { assertStatusCode(res, "createPerson (not a surefire test)"); diff --git a/services/movement/client/src/test/java/org/collectionspace/services/client/test/MovementAuthRefsTest.java b/services/movement/client/src/test/java/org/collectionspace/services/client/test/MovementAuthRefsTest.java index a1b38a63b..473a109a2 100644 --- a/services/movement/client/src/test/java/org/collectionspace/services/client/test/MovementAuthRefsTest.java +++ b/services/movement/client/src/test/java/org/collectionspace/services/client/test/MovementAuthRefsTest.java @@ -43,6 +43,7 @@ import org.collectionspace.services.common.authorityref.AuthorityRefList; import org.collectionspace.services.common.datetime.GregorianCalendarDateTimeUtils; import org.collectionspace.services.jaxb.AbstractCommonList; import org.collectionspace.services.movement.MovementsCommon; +import org.collectionspace.services.person.PersonTermGroup; import org.jboss.resteasy.client.ClientResponse; @@ -179,9 +180,15 @@ public class MovementAuthRefsTest extends BaseServiceTest { personInfo.put(PersonJAXBSchema.FORE_NAME, firstName); personInfo.put(PersonJAXBSchema.SUR_NAME, surName); personInfo.put(PersonJAXBSchema.SHORT_IDENTIFIER, shortId); + List personTerms = new ArrayList(); + PersonTermGroup term = new PersonTermGroup(); + String termName = firstName + " " + surName; + term.setTermDisplayName(termName); + term.setTermName(termName); + personTerms.add(term); PoxPayloadOut multipart = PersonAuthorityClientUtils.createPersonInstance(personAuthCSID, - authRefName, personInfo, null, personAuthClient.getItemCommonPartName()); + authRefName, personInfo, personTerms, personAuthClient.getItemCommonPartName()); ClientResponse res = personAuthClient.createItem(personAuthCSID, multipart); int statusCode = res.getStatus(); diff --git a/services/objectexit/client/src/test/java/org/collectionspace/services/client/test/ObjectExitAuthRefsTest.java b/services/objectexit/client/src/test/java/org/collectionspace/services/client/test/ObjectExitAuthRefsTest.java index 53836d431..2f7bf8776 100644 --- a/services/objectexit/client/src/test/java/org/collectionspace/services/client/test/ObjectExitAuthRefsTest.java +++ b/services/objectexit/client/src/test/java/org/collectionspace/services/client/test/ObjectExitAuthRefsTest.java @@ -42,6 +42,7 @@ import org.collectionspace.services.common.authorityref.AuthorityRefList; import org.collectionspace.services.common.datetime.GregorianCalendarDateTimeUtils; import org.collectionspace.services.jaxb.AbstractCommonList; import org.collectionspace.services.objectexit.ObjectexitCommon; +import org.collectionspace.services.person.PersonTermGroup; import org.jboss.resteasy.client.ClientResponse; @@ -165,7 +166,15 @@ public class ObjectExitAuthRefsTest extends BaseServiceTest personInfo.put(PersonJAXBSchema.FORE_NAME, firstName); personInfo.put(PersonJAXBSchema.SUR_NAME, surName); personInfo.put(PersonJAXBSchema.SHORT_IDENTIFIER, shortId); - PoxPayloadOut multipart = PersonAuthorityClientUtils.createPersonInstance(personAuthCSID, authRefName, personInfo, null, personAuthClient.getItemCommonPartName()); + List personTerms = new ArrayList(); + PersonTermGroup term = new PersonTermGroup(); + String termName = firstName + " " + surName; + term.setTermDisplayName(termName); + term.setTermName(termName); + personTerms.add(term); + PoxPayloadOut multipart = + PersonAuthorityClientUtils.createPersonInstance(personAuthCSID, + authRefName, personInfo, personTerms, personAuthClient.getItemCommonPartName()); ClientResponse res = personAuthClient.createItem(personAuthCSID, multipart); try { assertStatusCode(res, "createPerson (not a surefire test)"); diff --git a/services/organization/client/src/test/java/org/collectionspace/services/client/test/OrgAuthorityAuthRefsTest.java b/services/organization/client/src/test/java/org/collectionspace/services/client/test/OrgAuthorityAuthRefsTest.java index f705278bf..903013576 100644 --- a/services/organization/client/src/test/java/org/collectionspace/services/client/test/OrgAuthorityAuthRefsTest.java +++ b/services/organization/client/src/test/java/org/collectionspace/services/client/test/OrgAuthorityAuthRefsTest.java @@ -43,6 +43,7 @@ import org.collectionspace.services.jaxb.AbstractCommonList; import org.collectionspace.services.organization.MainBodyGroup; import org.collectionspace.services.organization.MainBodyGroupList; import org.collectionspace.services.organization.OrganizationsCommon; +import org.collectionspace.services.person.PersonTermGroup; import org.jboss.resteasy.client.ClientResponse; @@ -269,9 +270,15 @@ public class OrgAuthorityAuthRefsTest extends BaseServiceTest personTerms = new ArrayList(); + PersonTermGroup term = new PersonTermGroup(); + String termName = firstName + " " + surName; + term.setTermDisplayName(termName); + term.setTermName(termName); + personTerms.add(term); PoxPayloadOut multipart = PersonAuthorityClientUtils.createPersonInstance(personAuthCSID, - authRefName, personInfo, null, personAuthClient.getItemCommonPartName()); + authRefName, personInfo, personTerms, personAuthClient.getItemCommonPartName()); String result = null; ClientResponse res = personAuthClient.createItem(personAuthCSID, multipart); -- 2.47.3