コード例 #1
0
  /////////////////////////////////////////////////////////////////////////////////////////
  //  TEST
  /////////////////////////////////////////////////////////////////////////////////////////
  //	@Test
  public void testGuaranteeXml() {
    AA88ClientAPI api = TestAPIBase.getClientApi(AA88ClientAPI.class);

    AA88UserContext userContext = api.getUserContext();
    String userContextXml = api.getModelObjectsMarshaller().xmlFromBean(userContext);
    System.out.println(userContextXml);

    AA88Guarantee mockGuarantee =
        AA88MockObjectsBuilder.buildMockGuarantee(
            TEST_FILELIST_FOLDER_PATH, AA88GuaranteedUnitID.forId("test1.txt"));
    String xml = api.getModelObjectsMarshaller().xmlFromBean(mockGuarantee);
    System.out.println(xml);
  }
コード例 #2
0
  //	@After
  public void tearDown() throws Exception {
    AA88ClientAPI api = TestAPIBase.getClientApi(AA88ClientAPI.class);

    if (CollectionUtils.hasData(_testedGuaranteesOids)) {
      for (AA88GuaranteeOID oid : _testedGuaranteesOids) {
        // [1]: Delete the guarantee publish requests at the DB (if exists)

        Collection<AA88GuaranteePublishRequestOID> deletedGuaranteePubRequestOids =
            api.guaranteesAPI()
                .getForPublishRequestCRUD()
                .deleteAllPublishRequestsForGuaranteeWithOid(oid);
        // [2]: Delete the guarantee record at the DB
        AA88Guarantee deletedGuarantee = api.guaranteesAPI().getForCRUD().delete(oid);
        // [3] - Delete the guarantee zip file & folder
        STORAGE_SERVICES.deleteGuaranteedUnitStorage(
            api.getUserContext(),
            deletedGuarantee.getSourceSystemId(),
            deletedGuarantee.getGuaranteedUnitId());
      }
    }
  }