2 * This document is a part of the source code and related artifacts
3 * for CollectionSpace, an open source collections management system
4 * for museums and related institutions:
6 * http://www.collectionspace.org
7 * http://wiki.collectionspace.org
9 * Copyright (c)) 2009 Regents of the University of California
11 * Licensed under the Educational Community License (ECL), Version 2.0.
12 * You may not use this file except in compliance with this License.
14 * You may obtain a copy of the ECL 2.0 License at
15 * https://source.collectionspace.org/collection-space/LICENSE.txt
17 * Unless required by applicable law or agreed to in writing, software
18 * distributed under the License is distributed on an "AS IS" BASIS,
19 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20 * See the License for the specific language governing permissions and
21 * limitations under the License.
23 package org.collectionspace.services.client.test;
25 import java.io.UnsupportedEncodingException;
26 import java.net.URLEncoder;
27 import java.util.ArrayList;
28 import java.util.HashMap;
29 import java.util.List;
32 import javax.ws.rs.core.Response;
34 import org.collectionspace.services.PersonJAXBSchema;
35 import org.collectionspace.services.client.CollectionSpaceClient;
36 import org.collectionspace.services.client.PersonAuthorityClient;
37 import org.collectionspace.services.client.PersonAuthorityClientUtils;
38 import org.collectionspace.services.client.PoxPayloadOut;
39 import org.collectionspace.services.jaxb.AbstractCommonList;
40 import org.collectionspace.services.person.PersonTermGroup;
41 import org.slf4j.Logger;
42 import org.slf4j.LoggerFactory;
43 import org.testng.Assert;
44 import org.testng.annotations.AfterClass;
45 import org.testng.annotations.BeforeClass;
46 import org.testng.annotations.Test;
49 * PersonAuthoritySearchTest, carries out search (e.g. partial
50 * term matching) tests against a deployed and running PersonAuthority Service.
52 * $LastChangedRevision: 753 $
53 * $LastChangedDate: 2009-09-23 11:03:36 -0700 (Wed, 23 Sep 2009) $
55 public class PersonAuthoritySearchTest extends BaseServiceTest<AbstractCommonList> {
57 private final String CLASS_NAME = PersonAuthoritySearchTest.class.getName();
58 private final Logger logger = LoggerFactory.getLogger(CLASS_NAME);
61 public String getServicePathComponent() {
62 return PersonAuthorityClient.SERVICE_PATH_COMPONENT;
66 protected String getServiceName() {
67 return PersonAuthorityClient.SERVICE_NAME;
70 final String UTF8_CHARSET_NAME = "UTF-8";
72 // Test name for partial term matching: Lech Wałęsa
74 // For details regarding the łę characters in the last name, see:
75 // http://en.wikipedia.org/wiki/L_with_stroke
76 // http://en.wikipedia.org/wiki/%C4%98
79 final String TEST_PARTIAL_TERM_FORE_NAME = "Lech";
81 // Surname (contains single quote character)
82 final String TEST_PARTIAL_TERM_SUR_NAME_QUOTE = "O'Hara";
84 // Surname (contains two non-USASCII range Unicode UTF-8 characters)
85 final String TEST_PARTIAL_TERM_SUR_NAME_UNICODE = "Wałęsa";
86 // Wrong: "Wa" + "\u0142" + "\u0119" + "sa";
87 // Should also work: "Wa" + '\u0142' + '\u0119' + "sa";
88 // Should also work: "Wa\u0142\u0119sa";
92 final String TEST_PARTIAL_TERM_DISPLAY_NAME_UNICODE =
93 TEST_PARTIAL_TERM_FORE_NAME + " " + TEST_PARTIAL_TERM_SUR_NAME_UNICODE;
96 final String TEST_PARTIAL_TERM_DISPLAY_NAME_QUOTE =
97 TEST_PARTIAL_TERM_FORE_NAME + " " + TEST_PARTIAL_TERM_SUR_NAME_QUOTE;
100 final String TEST_SHORT_ID_UNICODE = "lechWalesa";
103 final String TEST_SHORT_ID_QUOTE = "lechOHara";
105 final String TEST_KWD_BIRTH_PLACE = "Popowo, Poland";
107 final String TEST_KWD_UTF8_STYLE = "Appliqu"+'\u00e8'+"d Arts";
109 final String TEST_KWD_BIO_NOTE_NO_QUOTES =
110 "This is a silly bionote with no so-called quotes.";
112 final String TEST_KWD_BIO_NOTE_DBL_QUOTES =
113 "This is a silly \"bionote\" for testing so called quote_handling";
115 final String TEST_KWD_NO_MATCH = "Foobar";
117 // Non-existent partial term name (first letters of each of the words
118 // in a pangram for the English alphabet).
119 private static final String TEST_PARTIAL_TERM_NON_EXISTENT = "jlmbsoq";
121 /** The known resource id. */
122 private String knownResourceId = null;
124 /** The known resource ref name. */
125 //private String knownResourceRefName = null;
127 /** The known item resource id. */
128 private String knownItemResourceId = null;
130 // The resource ID of an item resource used for partial term matching tests.
131 private String knownItemPartialTermResourceId = null;
133 private List<String> allResourceIdsCreated = new ArrayList<String>();
135 /** The all item resource ids created. */
136 private Map<String, String> allItemResourceIdsCreated =
137 new HashMap<String, String>();
139 // The number of matches expected on each partial term.
140 final int NUM_MATCHES_EXPECTED_COMMON = 2;
141 final int NUM_MATCHES_EXPECTED_SPECIFIC = 1;
143 // The minimum number of characters that must be included
144 // a partial term, in order to permit matching to occur.
145 final int PARTIAL_TERM_MIN_LENGTH = 1;
148 * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance()
151 protected CollectionSpaceClient getClientInstance() throws Exception {
152 return new PersonAuthorityClient();
156 protected CollectionSpaceClient getClientInstance(String clientPropertiesFilename) throws Exception {
157 return new PersonAuthorityClient(clientPropertiesFilename);
161 * @see org.collectionspace.services.client.test.BaseServiceTest#getAbstractCommonList(org.jboss.resteasy.client.ClientResponse)
164 protected AbstractCommonList getCommonList(Response response) {
165 return response.readEntity(AbstractCommonList.class);
168 private String getPartialTermCommon() {
169 return TEST_PARTIAL_TERM_FORE_NAME;
172 private String getPartialTermUtf8() {
173 return TEST_PARTIAL_TERM_SUR_NAME_UNICODE;
176 private String getPartialTermQuote() {
177 return TEST_PARTIAL_TERM_SUR_NAME_QUOTE;
180 private String getPartialTermNonExistent() {
181 return TEST_PARTIAL_TERM_NON_EXISTENT;
184 private String getPartialTermMinimumLength() {
185 String partialTerm = getPartialTermCommon();
186 if (partialTerm == null || partialTerm.trim().isEmpty()) {
189 if (partialTerm.length() > PARTIAL_TERM_MIN_LENGTH) {
190 return partialTerm.substring(0, PARTIAL_TERM_MIN_LENGTH);
196 private String getKwdTerm() {
197 return TEST_KWD_BIRTH_PLACE;
200 private String getKwdTermUTF8() {
201 return TEST_KWD_UTF8_STYLE;
204 private String getKwdTermNonExistent() {
205 return TEST_KWD_NO_MATCH;
209 public void setup() {
212 } catch (Exception e) {
213 Assert.fail("Could not create new Authority for search tests.", e);
216 createItemsInAuthorityForPartialTermMatch(knownResourceId, null ); //knownResourceRefName);
217 } catch (Exception e) {
218 Assert.fail("Could not create new item in Authority for search tests.", e);
222 // ---------------------------------------------------------------
223 // CRUD tests : READ_LIST tests by partial term match.
224 // ---------------------------------------------------------------
229 * Reads an item list by partial term.
232 @Test(dataProvider="testName", groups = {"readListByPartialTerm"})
233 public void partialTermMatch(String testName) throws Exception {
234 int numMatchesFound = 0;
235 String partialTerm = getPartialTermCommon();
236 if (logger.isDebugEnabled()) {
237 logger.debug("Attempting match on partial term '" + partialTerm + "' ...");
239 numMatchesFound = readItemListWithFilters(testName, knownResourceId, partialTerm, null);
240 if (logger.isDebugEnabled()) {
241 logger.debug("Found " + numMatchesFound + " match(es), expected " +
242 NUM_MATCHES_EXPECTED_COMMON + " match(es).");
244 Assert.assertEquals(numMatchesFound, NUM_MATCHES_EXPECTED_COMMON);
248 * Reads an item list by partial term, with a partial term that consists
249 * of an all-lowercase variation of the expected match, to test case-insensitive
253 @Test(dataProvider="testName", groups = {"readListByPartialTerm"},
254 dependsOnMethods = {"partialTermMatch"})
255 public void partialTermMatchCaseInsensitiveLowerCase(String testName) throws Exception {
256 int numMatchesFound = 0;
258 final String partialTerm = getPartialTermCommon().toLowerCase();
259 if (logger.isDebugEnabled()) {
260 logger.debug("Attempting match on partial term '" + partialTerm + "' ...");
263 readItemListWithFilters(testName, knownResourceId, partialTerm, null);
264 if (logger.isDebugEnabled()) {
265 logger.debug("Found " + numMatchesFound + " match(es), expected " +
266 NUM_MATCHES_EXPECTED_COMMON + " match(es).");
268 Assert.assertEquals(numMatchesFound, NUM_MATCHES_EXPECTED_COMMON);
272 * Reads an item list by partial term, with a partial term that consists
273 * of an all-uppercase variation of the expected match, to test case-insensitive
277 @Test(dataProvider="testName",
278 groups = {"readListByPartialTerm"}, dependsOnMethods = {"partialTermMatch"})
279 public void partialTermMatchCaseInsensitiveUpperCase(String testName) throws Exception {
280 int numMatchesFound = 0;
282 final String partialTerm = getPartialTermCommon().toUpperCase();
283 if (logger.isDebugEnabled()) {
284 logger.debug("Attempting match on partial term '" + partialTerm + "' ...");
287 readItemListWithFilters(testName, knownResourceId, partialTerm, null);
288 if (logger.isDebugEnabled()) {
289 logger.debug("Found " + numMatchesFound + " match(es), expected " +
290 NUM_MATCHES_EXPECTED_COMMON + " match(es).");
292 Assert.assertEquals(numMatchesFound, NUM_MATCHES_EXPECTED_COMMON);
296 * Reads an item list by partial term, with a partial term that is of
297 * the minimum character length that may be expected to be matched.
300 @Test(dataProvider="testName",
301 groups = {"readListByPartialTerm"}, dependsOnMethods = {"partialTermMatch"})
302 public void partialTermMatchMinimumLength(String testName) throws Exception {
303 int numMatchesFound = 0;
304 String partialTerm = getPartialTermMinimumLength();
305 if (logger.isDebugEnabled()) {
306 logger.debug("Attempting match on partial term '" + partialTerm + "' ...");
308 numMatchesFound = readItemListWithFilters(testName, knownResourceId, partialTerm, null);
309 // Zero matches are expected on a non-existent term.
310 if (logger.isDebugEnabled()) {
311 logger.debug("Found " + numMatchesFound + " match(es), expected " +
312 NUM_MATCHES_EXPECTED_COMMON + " match(es).");
314 Assert.assertEquals(numMatchesFound, NUM_MATCHES_EXPECTED_COMMON);
318 * Reads an item list by partial term, with a partial term that contains
319 * at least one Unicode UTF-8 character (outside the USASCII range).
322 @Test(dataProvider="testName",
323 groups = {"readListByPartialTerm"}, dependsOnMethods = {"partialTermMatch"})
324 public void partialTermMatchUTF8(String testName) throws Exception {
325 int numMatchesFound = 0;
326 String partialTerm = getPartialTermUtf8();
329 ptEncoded = URLEncoder.encode(partialTerm, UTF8_CHARSET_NAME);
331 catch (UnsupportedEncodingException ex) {
332 throw new RuntimeException("Broken VM does not support UTF-8");
334 if (logger.isDebugEnabled()) {
335 logger.debug("Attempting match on partial term '" + partialTerm + "', Encoded:'"+ptEncoded+"' ...");
338 readItemListWithFilters(testName, knownResourceId, partialTerm, null);
339 if (logger.isDebugEnabled()) {
340 logger.debug("Found " + numMatchesFound + " match(es), expected " +
341 NUM_MATCHES_EXPECTED_SPECIFIC + " match(es).");
343 Assert.assertEquals(numMatchesFound, NUM_MATCHES_EXPECTED_SPECIFIC);
347 * Reads an item list by partial term, with a partial term that contains
348 * at least one Unicode UTF-8 character (outside the USASCII range).
351 @Test(dataProvider="testName",
352 groups = {"readListByPartialTerm"}, dependsOnMethods = {"partialTermMatch"})
353 public void partialTermMatchQuote(String testName) throws Exception {
354 int numMatchesFound = 0;
355 String partialTerm = getPartialTermQuote();
356 if (logger.isDebugEnabled()) {
357 logger.debug("Attempting match on partial term '" + partialTerm + "' ...");
360 readItemListWithFilters(testName, knownResourceId, partialTerm, null);
361 if (logger.isDebugEnabled()) {
362 logger.debug("Found " + numMatchesFound + " match(es), expected " +
363 NUM_MATCHES_EXPECTED_SPECIFIC + " match(es).");
365 Assert.assertEquals(numMatchesFound, NUM_MATCHES_EXPECTED_SPECIFIC);
369 * Finds terms by keywords.
372 @Test(dataProvider="testName", groups = {"readListByKwdTerm"})
373 public void keywordTermMatch(String testName) throws Exception {
374 int numMatchesFound = 0;
375 String kwdTerm = getKwdTerm();
376 if (logger.isDebugEnabled()) {
377 logger.debug("Attempting match on kwd term '" + kwdTerm + "' ...");
379 numMatchesFound = readItemListWithFilters(testName, knownResourceId, null, kwdTerm);
380 if (logger.isDebugEnabled()) {
381 logger.debug("Found " + numMatchesFound + " match(es), expected " +
382 NUM_MATCHES_EXPECTED_COMMON + " match(es).");
384 Assert.assertEquals(numMatchesFound, NUM_MATCHES_EXPECTED_COMMON);
388 * Finds terms by keywords.
391 @Test(dataProvider="testName",
392 groups = {"readListByKwdTerm"}, dependsOnMethods = {"keywordTermMatch"})
393 public void keywordTermMatchUTF8(String testName) throws Exception {
394 int numMatchesFound = 0;
395 String kwdTerm = getKwdTermUTF8();
396 if (logger.isDebugEnabled()) {
397 logger.debug("Attempting match on kwd term '" + kwdTerm + "' ...");
399 numMatchesFound = readItemListWithFilters(testName, knownResourceId, null, kwdTerm);
400 if (logger.isDebugEnabled()) {
401 logger.debug("Found " + numMatchesFound + " match(es), expected " +
402 NUM_MATCHES_EXPECTED_COMMON + " match(es).");
404 Assert.assertEquals(numMatchesFound, NUM_MATCHES_EXPECTED_COMMON);
412 * Reads an item list by partial term, with a partial term that is not
413 * expected to be matched by any term in any resource.
416 @Test(dataProvider="testName",
417 groups = {"readListByPartialTerm"}, dependsOnMethods = {"partialTermMatch"})
418 public void partialTermMatchOnNonexistentTerm(String testName) throws Exception {
419 int numMatchesFound = 0;
420 int ZERO_MATCHES_EXPECTED = 0;
421 String partialTerm = getPartialTermNonExistent();
422 if (logger.isDebugEnabled()) {
423 logger.debug("Attempting match on partial term '" + partialTerm + "' ...");
425 numMatchesFound = readItemListWithFilters(testName, knownResourceId, partialTerm, null);
426 // Zero matches are expected on a non-existent term.
427 if (logger.isDebugEnabled()) {
428 logger.debug("Found " + numMatchesFound + " match(es), expected " +
429 ZERO_MATCHES_EXPECTED + " match(es).");
431 Assert.assertEquals(numMatchesFound, ZERO_MATCHES_EXPECTED);
435 * Reads an item list by partial term, with a partial term that is not
436 * expected to be matched by any term in any resource.
439 @Test(dataProvider="testName", groups = {"readListByKwdTerm"},
440 dependsOnMethods = {"keywordTermMatch"})
441 public void keywordTermMatchOnNonexistentTerm(String testName) throws Exception {
442 int numMatchesFound = 0;
443 int ZERO_MATCHES_EXPECTED = 0;
444 String kwdTerm = getKwdTermNonExistent();
445 if (logger.isDebugEnabled()) {
446 logger.debug("Attempting match on kwd term '" + kwdTerm + "' ...");
448 numMatchesFound = readItemListWithFilters(testName, knownResourceId, null, kwdTerm);
449 // Zero matches are expected on a non-existent term.
450 if (logger.isDebugEnabled()) {
451 logger.debug("Found " + numMatchesFound + " match(es), expected " +
452 ZERO_MATCHES_EXPECTED + " match(es).");
454 Assert.assertEquals(numMatchesFound, ZERO_MATCHES_EXPECTED);
458 * Reads an item list by partial term or keywords, given an authority and a term.
459 * Only one of partialTerm or keywords should be specified.
460 * If both are specified, keywords will be ignored.
462 * @param testName Calling test name
463 * @param authorityCsid The CSID of the authority within which partial term matching
465 * @param partialTerm A partial term to match item resources.
466 * @param partialTerm A keyword list to match item resources.
467 * @return The number of item resources matched by the partial term.
470 private int readItemListWithFilters(String testName,
471 String authorityCsid, String partialTerm, String keywords) throws Exception {
474 int expectedStatusCode = Response.Status.OK.getStatusCode();
475 ServiceRequestType requestType = ServiceRequestType.READ_LIST;
476 testSetup(expectedStatusCode, requestType);
478 // Submit the request to the service and store the response.
479 PersonAuthorityClient client = new PersonAuthorityClient();
481 if (authorityCsid != null) {
482 res = client.readItemList(authorityCsid, partialTerm, keywords);
484 Assert.fail("readItemListByPartialTerm passed null csid!");
486 AbstractCommonList list = null;
488 assertStatusCode(res, testName);
489 list = res.readEntity(AbstractCommonList.class);
496 List<AbstractCommonList.ListItem> items = list.getListItem();
497 int nItemsReturned = items.size();
499 return nItemsReturned;
502 // ---------------------------------------------------------------
503 // Cleanup of resources created during testing
504 // ---------------------------------------------------------------
507 * Deletes all resources created by tests, after all tests have been run.
509 * This cleanup method will always be run, even if one or more tests fail.
510 * For this reason, it attempts to remove all resources created
511 * at any point during testing, even if some of those resources
512 * may be expected to be deleted by certain tests.
515 @AfterClass(alwaysRun=true)
516 public void cleanUp() throws Exception {
517 String noTest = System.getProperty("noTestCleanup");
518 if(Boolean.TRUE.toString().equalsIgnoreCase(noTest)) {
519 if (logger.isDebugEnabled()) {
520 logger.debug("Skipping Cleanup phase ...");
524 if (logger.isDebugEnabled()) {
525 logger.debug("Cleaning up temporary resources created for testing ...");
527 String parentResourceId;
528 String itemResourceId;
529 PersonAuthorityClient client = new PersonAuthorityClient();
530 parentResourceId = knownResourceId;
531 // Clean up item resources.
532 for (Map.Entry<String, String> entry : allItemResourceIdsCreated.entrySet()) {
533 itemResourceId = entry.getKey();
534 parentResourceId = entry.getValue();
535 // Note: Any non-success responses from the delete operation
536 // below are ignored and not reported.
537 Response res = client.deleteItem(parentResourceId, itemResourceId);
540 // Clean up authority resources.
541 for (String resourceId : allResourceIdsCreated) {
542 // Note: Any non-success responses are ignored and not reported.
543 client.delete(resourceId).close();
547 // ---------------------------------------------------------------
548 // Utility methods used by tests above
549 // ---------------------------------------------------------------
551 // ---------------------------------------------------------------
552 // Utilities: setup routines for search tests
553 // ---------------------------------------------------------------
555 public void createAuthority() throws Exception {
557 String testName = "createAuthority";
558 if (logger.isDebugEnabled()) {
559 logger.debug(getTestBanner(testName, CLASS_NAME));
563 int expectedStatusCode = Response.Status.CREATED.getStatusCode();
564 ServiceRequestType requestType = ServiceRequestType.CREATE;
565 testSetup(expectedStatusCode, requestType);
567 // Submit the request to the service and store the response.
568 PersonAuthorityClient client = new PersonAuthorityClient();
569 String shortId = createIdentifier();
570 String displayName = "displayName-" + shortId;
571 //String baseRefName = PersonAuthorityClientUtils.createPersonAuthRefName(shortId, null);
572 PoxPayloadOut multipart =
573 PersonAuthorityClientUtils.createPersonAuthorityInstance(
574 displayName, shortId, client.getCommonPartName());
577 Response res = client.create(multipart);
579 assertStatusCode(res, testName);
580 newID = PersonAuthorityClientUtils.extractId(res);
586 // Store the refname from the first resource created
587 // for additional tests below.
588 //knownResourceRefName = baseRefName;
589 // Store the ID returned from the first resource created
590 // for additional tests below.
591 if (knownResourceId == null){
592 knownResourceId = newID;
593 //knownResourceRefName = baseRefName;
596 // Store the IDs from every resource created by tests,
597 // so they can be deleted after tests have been run.
598 allResourceIdsCreated.add(newID);
602 * Creates an item in the authority, used for partial term matching tests.
604 * @param authorityCsid The CSID of the Authority in which the term will be created.
605 * @param authRefName The refName of the Authority in which the term will be created.
607 private void createItemsInAuthorityForPartialTermMatch(
608 String authorityCsid, String authRefName)
611 String testName = "createItemsInAuthorityForPartialTermMatch";
613 int expectedStatusCode = Response.Status.CREATED.getStatusCode();
614 ServiceRequestType requestType = ServiceRequestType.CREATE;
615 testSetup(expectedStatusCode, requestType);
617 // Submit the request to the service and store the response.
618 PersonAuthorityClient client = new PersonAuthorityClient();
619 Map<String, String> partialTermPersonMap = new HashMap<String,String>();
621 // Fill values for the UNICODE item
623 partialTermPersonMap.put(PersonJAXBSchema.SHORT_IDENTIFIER, TEST_SHORT_ID_UNICODE );
624 partialTermPersonMap.put(PersonJAXBSchema.BIRTH_PLACE, TEST_KWD_BIRTH_PLACE);
625 partialTermPersonMap.put(PersonJAXBSchema.GENDER, "male");
626 partialTermPersonMap.put(PersonJAXBSchema.BIO_NOTE, TEST_KWD_BIO_NOTE_NO_QUOTES);
628 List<PersonTermGroup> partialTerms = new ArrayList<PersonTermGroup>();
629 PersonTermGroup term = new PersonTermGroup();
630 term.setTermDisplayName(TEST_PARTIAL_TERM_DISPLAY_NAME_UNICODE);
631 term.setTermName(TEST_PARTIAL_TERM_DISPLAY_NAME_UNICODE);
632 term.setForeName(TEST_PARTIAL_TERM_FORE_NAME);
633 term.setSurName(TEST_PARTIAL_TERM_SUR_NAME_UNICODE);
634 partialTerms.add(term);
636 Map<String, List<String>> partialTermRepeatablesMap = new HashMap<String, List<String>>();
637 ArrayList<String> styles = new ArrayList<String>();
638 styles.add(TEST_KWD_UTF8_STYLE);
639 partialTermRepeatablesMap.put(PersonJAXBSchema.SCHOOLS_OR_STYLES, styles);
641 createItem(testName, authorityCsid, null /*authRefName*/, client,
642 partialTermPersonMap, partialTerms, partialTermRepeatablesMap);
644 // Adjust values for the QUOTE item
646 partialTermPersonMap.put(PersonJAXBSchema.SHORT_IDENTIFIER, TEST_SHORT_ID_QUOTE );
647 partialTermPersonMap.put(PersonJAXBSchema.BIO_NOTE, TEST_KWD_BIO_NOTE_DBL_QUOTES);
649 partialTerms.get(0).setTermDisplayName(TEST_PARTIAL_TERM_DISPLAY_NAME_QUOTE);
650 partialTerms.get(0).setSurName(TEST_PARTIAL_TERM_SUR_NAME_QUOTE);
652 createItem(testName, authorityCsid, null /*authRefName*/, client,
653 partialTermPersonMap, partialTerms, partialTermRepeatablesMap);
656 private void createItem(
658 String authorityCsid,
660 PersonAuthorityClient client,
661 Map<String, String> partialTermPersonMap,
662 List<PersonTermGroup> partialTerms,
663 Map<String, List<String>> partialTermRepeatablesMap) throws Exception {
664 PoxPayloadOut multipart =
665 PersonAuthorityClientUtils.createPersonInstance(authorityCsid, null, //authRefName,
666 partialTermPersonMap, partialTerms, partialTermRepeatablesMap, client.getItemCommonPartName() );
669 Response res = client.createItem(authorityCsid, multipart);
671 newID = PersonAuthorityClientUtils.extractId(res);
678 // Store the ID returned from the first item resource created
679 // for additional tests below.
680 if (knownItemResourceId == null){
681 knownItemResourceId = newID;
682 if (logger.isDebugEnabled()) {
683 logger.debug(testName + ": knownItemPartialTermResourceId=" + knownItemPartialTermResourceId);
687 // Store the IDs from any item resources created
688 // by tests, along with the IDs of their parents, so these items
689 // can be deleted after all tests have been run.
690 allItemResourceIdsCreated.put(newID, authorityCsid);