@After public void tearDown() throws InterruptedException { bcClient.terminateEnvironment(new TerminateEnvironmentRequest() .withEnvironmentName(TEST_ENVIRONMENTNAME)); AWSTestUtils.waitForEnvironmentToTransitionToStateAndHealth( TEST_ENVIRONMENTNAME, EnvironmentStatus.Terminated, null, bcClient); bcClient.deleteApplication(new DeleteApplicationRequest(TEST_APPNAME)); while (true) { DescribeApplicationsResult appResult = bcClient .describeApplications(); boolean appNameFound = false; for (ApplicationDescription appdesc : appResult.getApplications()) { if (appdesc.getApplicationName().equals(TEST_APPNAME)) { appNameFound = true; break; } } if (!appNameFound) { break; } } }
public static List<ApplicationDescription> getApplications(AWSCredentialsProvider credentials, Regions region) { AWSElasticBeanstalk awseb = getElasticBeanstalk(credentials, Region.getRegion(region)); DescribeApplicationsResult result = awseb.describeApplications(); return result.getApplications(); }
public List<ApplicationDescription> describeApplications(){ awsElasticBeanstalkAsyncClient.setRegion(region); DescribeApplicationsResult result = awsElasticBeanstalkAsyncClient.describeApplications(); return result.getApplications(); }