From 37615fc4e2a123363fbd0f0fcfc35f0a0c208663 Mon Sep 17 00:00:00 2001 From: Aron Roberts Date: Thu, 19 Aug 2010 23:25:02 +0000 Subject: [PATCH] CSPACE-2300: Added borrowersAuthorizer field to LoansIn (aka LoansIn) records, in services schema. Constitutes a Nuxeo document type update, and as such requires an 'ant deploy' and a 2-server restart. --- .../main/config/services/tenant-bindings.xml | 2 ++ .../main/resources/schemas/loansin_common.xsd | 1 + .../client/test/LoaninAuthRefsTest.java | 17 +++++++++++++---- .../jaxb/src/main/resources/loansin-common.xsd | 1 + 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/services/common/src/main/config/services/tenant-bindings.xml b/services/common/src/main/config/services/tenant-bindings.xml index e11388c01..0caf1ff9f 100644 --- a/services/common/src/main/config/services/tenant-bindings.xml +++ b/services/common/src/main/config/services/tenant-bindings.xml @@ -206,6 +206,7 @@ authReflendersAuthorizer authReflendersContact authRefloanInContact + authRefborrowersAuthorizer authReflendersAuthorizer authReflendersContact authRefloanInContact + authRefborrowersAuthorizer + 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 122b15c18..365e7c22d 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 @@ -76,9 +76,10 @@ public class LoaninAuthRefsTest extends BaseServiceTest { private String lendersAuthorizerRefName = null; private String lendersContactRefName = null; private String loanInContactRefName = null; + private String borrowersAuthorizerRefName = null; // FIXME: May change when repeatable / multivalue 'lenders' field is added // to tenant-bindings.xml - private final int NUM_AUTH_REFS_EXPECTED = 4; + private final int NUM_AUTH_REFS_EXPECTED = 5; /* (non-Javadoc) * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance() @@ -123,10 +124,11 @@ public class LoaninAuthRefsTest extends BaseServiceTest { MultipartOutput multipart = createLoaninInstance( "loanInNumber-" + identifier, "returnDate-" + identifier, - lenderRefName, + lenderRefName, lendersAuthorizerRefName, lendersContactRefName, - loanInContactRefName); + loanInContactRefName, + borrowersAuthorizerRefName); ClientResponse response = loaninClient.create(multipart); int statusCode = response.getStatus(); try { @@ -195,6 +197,10 @@ public class LoaninAuthRefsTest extends BaseServiceTest { personIdsCreated.add(csid); loanInContactRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null); + csid = createPerson("Bonnie", "Borrowersauthorizer", "bonnieBorrowersauthorizer", authRefName); + personIdsCreated.add(csid); + borrowersAuthorizerRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null); + // FIXME: Add instance(s) of 'lenders' field when we can work with // repeatable / multivalued authority reference fields. Be sure to // change the NUM_AUTH_REFS_EXPECTED constant accordingly, or otherwise @@ -256,6 +262,7 @@ public class LoaninAuthRefsTest extends BaseServiceTest { Assert.assertEquals(loanin.getLendersAuthorizer(), lendersAuthorizerRefName); Assert.assertEquals(loanin.getLendersContact(), lendersContactRefName); Assert.assertEquals(loanin.getLoanInContact(), loanInContactRefName); + Assert.assertEquals(loanin.getBorrowersAuthorizer(), borrowersAuthorizerRefName); // Get the auth refs and check them ClientResponse res2 = @@ -363,7 +370,8 @@ public class LoaninAuthRefsTest extends BaseServiceTest { String lender, String lendersAuthorizer, String lendersContact, - String loaninContact) { + String loaninContact, + String borrowersAuthorizer) { LoansinCommon loanin = new LoansinCommon(); loanin.setLoanInNumber(loaninNumber); loanin.setLoanInNumber(returnDate); @@ -371,6 +379,7 @@ public class LoaninAuthRefsTest extends BaseServiceTest { loanin.setLendersAuthorizer(lendersAuthorizer); loanin.setLendersContact(lendersContact); loanin.setLoanInContact(loaninContact); + loanin.setBorrowersAuthorizer(borrowersAuthorizer); MultipartOutput multipart = new MultipartOutput(); OutputPart commonPart = multipart.addPart(loanin, MediaType.APPLICATION_XML_TYPE); diff --git a/services/loanin/jaxb/src/main/resources/loansin-common.xsd b/services/loanin/jaxb/src/main/resources/loansin-common.xsd index ae65cf10c..b03aac010 100644 --- a/services/loanin/jaxb/src/main/resources/loansin-common.xsd +++ b/services/loanin/jaxb/src/main/resources/loansin-common.xsd @@ -38,6 +38,7 @@ + -- 2.47.3