コード例 #1
0
  protected void createPersonRefs() throws Exception {
    PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
    // Create a temporary PersonAuthority resource, and its corresponding
    // refName by which it can be identified.
    PoxPayloadOut multipart =
        PersonAuthorityClientUtils.createPersonAuthorityInstance(
            PERSON_AUTHORITY_NAME, PERSON_AUTHORITY_NAME, personAuthClient.getCommonPartName());
    Response res = personAuthClient.create(multipart);
    try {
      int statusCode = res.getStatus();
      Assert.assertTrue(
          testRequestType.isValidStatusCode(statusCode),
          invalidStatusCodeMessage(testRequestType, statusCode));
      Assert.assertEquals(statusCode, STATUS_CREATED);
      personAuthCSID = extractId(res);
    } finally {
      res.close();
    }

    String authRefName = PersonAuthorityClientUtils.getAuthorityRefName(personAuthCSID, null);
    // Create temporary Person resources, and their corresponding refNames
    // by which they can be identified.
    String csid =
        createPerson("Carrie", "ConditionChecker1", "carrieConditionChecker", authRefName);
    personIdsCreated.add(csid);
    conditionCheckerRefName =
        PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
  }