Search in sources :

Example 1 with OrganizationApp

use of com.axway.apim.organization.OrganizationApp in project apim-cli by Axway-API-Management-Plus.

the class ExportOrganizationTestAction method runTest.

@Override
public ExportResult runTest(TestContext context) {
    OrgExportParams params = new OrgExportParams();
    addParameters(params, context);
    params.setName(getVariable(context, PARAM_NAME));
    OrganizationApp app = new OrganizationApp();
    LOG.info("Running " + app.getClass().getSimpleName() + " with params: " + params);
    ExportResult result = app.exportOrgs(params);
    if (this.getExpectedReturnCode(context) != result.getRc()) {
        throw new ValidationException("Expected RC was: " + this.getExpectedReturnCode(context) + " but got: " + result.getRc());
    }
    return result;
}
Also used : OrgExportParams(com.axway.apim.organization.lib.OrgExportParams) ValidationException(com.consol.citrus.exceptions.ValidationException) OrganizationApp(com.axway.apim.organization.OrganizationApp) ExportResult(com.axway.apim.lib.ExportResult)

Example 2 with OrganizationApp

use of com.axway.apim.organization.OrganizationApp in project apim-cli by Axway-API-Management-Plus.

the class ImportOrganizationTestAction method runTest.

@Override
public void runTest(TestContext context) {
    OrgImportParams params = new OrgImportParams();
    addParameters(params, context);
    params.setConfig(this.configFile.getPath());
    OrganizationApp app = new OrganizationApp();
    LOG.info("Running " + app.getClass().getSimpleName() + " with params: " + params);
    int rc = app.importOrganization(params);
    if (this.getExpectedReturnCode(context) != rc) {
        throw new ValidationException("Expected RC was: " + this.getExpectedReturnCode(context) + " but got: " + rc);
    }
}
Also used : OrgImportParams(com.axway.apim.organization.lib.OrgImportParams) ValidationException(com.consol.citrus.exceptions.ValidationException) OrganizationApp(com.axway.apim.organization.OrganizationApp)

Aggregations

OrganizationApp (com.axway.apim.organization.OrganizationApp)2 ValidationException (com.consol.citrus.exceptions.ValidationException)2 ExportResult (com.axway.apim.lib.ExportResult)1 OrgExportParams (com.axway.apim.organization.lib.OrgExportParams)1 OrgImportParams (com.axway.apim.organization.lib.OrgImportParams)1