use of com.axway.apim.appexport.lib.AppExportParams in project apim-cli by Axway-API-Management-Plus.
the class ApplicationExportApp method delete.
@CLIServiceMethod(name = "delete", description = "Delete selected application(s) from the API-Manager")
public static int delete(String[] args) {
AppExportParams params;
try {
params = (AppExportParams) AppExportCLIOptions.create(args).getParams();
} catch (AppException e) {
LOG.error("Error " + e.getMessage());
return e.getError().getCode();
}
ApplicationExportApp app = new ApplicationExportApp();
return app.delete(params).getRc();
}
use of com.axway.apim.appexport.lib.AppExportParams in project apim-cli by Axway-API-Management-Plus.
the class ApplicationExportApp method export.
@CLIServiceMethod(name = "get", description = "Get Applications from the API-Manager in different formats")
public static int export(String[] args) {
AppExportParams params;
try {
params = (AppExportParams) AppExportCLIOptions.create(args).getParams();
} catch (AppException e) {
LOG.error("Error " + e.getMessage());
return e.getError().getCode();
}
ApplicationExportApp app = new ApplicationExportApp();
return app.export(params).getRc();
}
use of com.axway.apim.appexport.lib.AppExportParams in project apim-cli by Axway-API-Management-Plus.
the class ExportAppTestAction method runTest.
@Override
public ExportResult runTest(TestContext context) {
AppExportParams params = new AppExportParams();
addParameters(params, context);
params.setName(getVariable(context, PARAM_NAME));
ApplicationExportApp app = new ApplicationExportApp();
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;
}
use of com.axway.apim.appexport.lib.AppExportParams in project apim-cli by Axway-API-Management-Plus.
the class AppCLIOptionsTest method testExportApplicationParameters.
@Test
public void testExportApplicationParameters() throws ParseException, AppException {
String[] args = { "-s", "prod", "-n", "*My Great App*", "-id", "UUID-ID-OF-THE-APP", "-state", "pending", "-orgName", "*Partners*", "-createdBy", "Tom", "-credential", "*9877979779*", "-redirectUrl", "*localhost*", "-o", "json", "-wide" };
CLIOptions options = AppExportCLIOptions.create(args);
AppExportParams params = (AppExportParams) options.getParams();
// Validate core parameters are included
Assert.assertEquals(params.getUsername(), "apiadmin");
Assert.assertEquals(params.getPassword(), "changeme");
Assert.assertEquals(params.getHostname(), "localhost");
// Validate standard export parameters are included
Assert.assertEquals(params.getWide(), Wide.wide);
Assert.assertEquals(params.getOutputFormat(), OutputFormat.json);
// Validate App-Import parameters
Assert.assertEquals(params.getName(), "*My Great App*");
Assert.assertEquals(params.getId(), "UUID-ID-OF-THE-APP");
Assert.assertEquals(params.getState(), "pending");
Assert.assertEquals(params.getOrgName(), "*Partners*");
Assert.assertEquals(params.getCreatedBy(), "Tom");
Assert.assertEquals(params.getCredential(), "*9877979779*");
Assert.assertEquals(params.getRedirectUrl(), "*localhost*");
Assert.assertNotNull(params.getProperties(), "Properties should never be null. They must be created as a base or per stage.");
}
Aggregations