Search in sources :

Example 1 with UserApp

use of com.axway.apim.users.UserApp in project apim-cli by Axway-API-Management-Plus.

the class ExportUserTestAction method runTest.

@Override
public ExportResult runTest(TestContext context) {
    UserExportParams params = new UserExportParams();
    addParameters(params, context);
    params.setLoginName(getParamLoginName(context));
    UserApp app = new UserApp();
    LOG.info("Running " + app.getClass().getSimpleName() + " with params: " + params);
    ExportResult result = app.export(params);
    if (this.getExpectedReturnCode(context) != result.getRc()) {
        throw new ValidationException("Expected RC was: " + this.getExpectedReturnCode(context) + " but got: " + result.getRc());
    }
    return result;
}
Also used : UserExportParams(com.axway.apim.users.lib.params.UserExportParams) ValidationException(com.consol.citrus.exceptions.ValidationException) UserApp(com.axway.apim.users.UserApp) ExportResult(com.axway.apim.lib.ExportResult)

Example 2 with UserApp

use of com.axway.apim.users.UserApp in project apim-cli by Axway-API-Management-Plus.

the class ImportUserTestAction method runTest.

@Override
public void runTest(TestContext context) {
    UserImportParams params = new UserImportParams();
    addParameters(params, context);
    params.setConfig(this.configFile.getPath());
    UserApp app = new UserApp();
    LOG.info("Running " + app.getClass().getSimpleName() + " with params: " + params);
    ImportResult result = app.importUsers(params);
    if (this.getExpectedReturnCode(context) != result.getRc()) {
        throw new ValidationException("Expected RC was: " + this.getExpectedReturnCode(context) + " but got: " + result.getRc());
    }
}
Also used : UserImportParams(com.axway.apim.users.lib.UserImportParams) ImportResult(com.axway.apim.lib.ImportResult) ValidationException(com.consol.citrus.exceptions.ValidationException) UserApp(com.axway.apim.users.UserApp)

Aggregations

UserApp (com.axway.apim.users.UserApp)2 ValidationException (com.consol.citrus.exceptions.ValidationException)2 ExportResult (com.axway.apim.lib.ExportResult)1 ImportResult (com.axway.apim.lib.ImportResult)1 UserImportParams (com.axway.apim.users.lib.UserImportParams)1 UserExportParams (com.axway.apim.users.lib.params.UserExportParams)1