コード例 #1
0
  /** Creates the organization refs. */
  protected void createOrgRefs() {
    OrgAuthorityClient orgAuthClient = new OrgAuthorityClient();
    // orgAuthRefName =
    //	OrgAuthorityClientUtils.createOrgAuthRefName(ORGANIZATION_AUTHORITY_NAME, null);
    PoxPayloadOut multipart =
        OrgAuthorityClientUtils.createOrgAuthorityInstance(
            ORGANIZATION_AUTHORITY_NAME,
            ORGANIZATION_AUTHORITY_NAME,
            orgAuthClient.getCommonPartName());
    ClientResponse<Response> res = orgAuthClient.create(multipart);
    int statusCode = res.getStatus();

    Assert.assertTrue(
        testRequestType.isValidStatusCode(statusCode),
        invalidStatusCodeMessage(testRequestType, statusCode));
    Assert.assertEquals(statusCode, STATUS_CREATED);
    orgAuthCSID = extractId(res);

    currentOwnerOrgCSID =
        createOrganization("olivierOwnerCompany", "Olivier Owner Company", "Olivier Owner Company");
    orgIdsCreated.add(currentOwnerOrgCSID);
    currentOwnerRefName =
        OrgAuthorityClientUtils.getOrgRefName(orgAuthCSID, currentOwnerOrgCSID, orgAuthClient);

    String newOrgCSID =
        createOrganization(
            "debbieDepositorAssocs",
            "Debbie Depositor & Associates",
            "Debbie Depositor & Associates");
    depositorRefName =
        OrgAuthorityClientUtils.getOrgRefName(orgAuthCSID, newOrgCSID, orgAuthClient);
    orgIdsCreated.add(newOrgCSID);

    newOrgCSID =
        createOrganization(
            "andrewCheckerAssessorLtd",
            "Andrew Checker-Assessor Ltd.",
            "Andrew Checker-Assessor Ltd.");
    conditionCheckerAssessorRefName =
        OrgAuthorityClientUtils.getOrgRefName(orgAuthCSID, newOrgCSID, orgAuthClient);
    orgIdsCreated.add(newOrgCSID);

    newOrgCSID =
        createOrganization("ingridInsurerBureau", "Ingrid Insurer Bureau", "Ingrid Insurer Bureau");
    insurerRefName = OrgAuthorityClientUtils.getOrgRefName(orgAuthCSID, newOrgCSID, orgAuthClient);
    orgIdsCreated.add(newOrgCSID);

    newOrgCSID = createOrganization("vinceValuerLLC", "Vince Valuer LLC", "Vince Valuer LLC");
    valuerRefName = OrgAuthorityClientUtils.getOrgRefName(orgAuthCSID, newOrgCSID, orgAuthClient);
    orgIdsCreated.add(newOrgCSID);
  }
コード例 #2
0
  protected String createOrganization(String shortId, String shortName, String longName) {
    OrgAuthorityClient orgAuthClient = new OrgAuthorityClient();
    Map<String, String> orgInfo = new HashMap<String, String>();
    orgInfo.put(OrganizationJAXBSchema.SHORT_IDENTIFIER, shortId);
    orgInfo.put(OrganizationJAXBSchema.SHORT_NAME, shortName);
    orgInfo.put(OrganizationJAXBSchema.LONG_NAME, longName);
    PoxPayloadOut multipart =
        OrgAuthorityClientUtils.createOrganizationInstance(
            null, // orgAuthRefName,
            orgInfo,
            orgAuthClient.getItemCommonPartName());
    ClientResponse<Response> res = orgAuthClient.createItem(orgAuthCSID, multipart);
    int statusCode = res.getStatus();

    Assert.assertTrue(
        testRequestType.isValidStatusCode(statusCode),
        invalidStatusCodeMessage(testRequestType, statusCode));
    Assert.assertEquals(statusCode, STATUS_CREATED);
    return extractId(res);
  }