StartApplication is not working
See original GitHub issueHello, I have been assigned to create a method that will start an application. I have the code implemented correctly yet nothing is happening when I run my project. I’m an intern, so i am new to this and therefore I am not so familiar with cloudfoundry overall. If you can help me in any way that would be much appreciated.
My code is written below:
public Mono<Map<String, Object>> startApplication(String orgName, String spaceName, String appName){
return this.getApplications(orgName, spaceName)
.flatMap(ApplicationDetail -> Mono.zip(Mono.just(ApplicationDetail.getName()),Mono.just(ApplicationDetail.getRequestedState().equals("STOPPED") ?
runApplication(orgName, spaceName, appName): "the application is already running")))
.filter(hmap -> hmap.getT1().equalsIgnoreCase(appName))
.collectMap(Tuple2::getT1,Tuple2::getT2);
}
public Mono<Void> runApplication(String appName, String orgName, String spaceName) {
final CloudFoundryOperations cloudFoundryOperations = this.getCloudFoundryOperations(orgName, spaceName);
return cloudFoundryOperations.applications()
.start(StartApplicationRequest.builder()
.name(appName)
.build());
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
startApplication() fails to launch the AUT
startApplication() may fail to launch the Android application. In such a case, please check/try ... Make sure Android Studio is not running.
Read more >squish startApplication() won't start an application with space
You can map your application on the AUT settings and call the application without space while running your test case.
Read more >Windows.startApplication URL address problem - Katalon Studio
Hi How to set the URL address on local machine for test cases? I'm trying to run windows app tests, i can open...
Read more >Enable start application is not working in 32 bit machines ...
Hi, We are using the Installshield 2014 professional to generate a MSI setup for 32/64 bit machines. Modified the printer's config file ...
Read more >Get-StartApps is not recognized as the name of a cmdlet ...
Powershell Debugger Not Loading all Modules : Get-StartApps is not recognized as the name of a cmdlet, function, script file, or operable program...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you for all your help! The method now works properly 👍
Reactor can do conditionals such as
if
in a variety of ways, but often the best approach is a filter. Excuse the formatting as I’m coding in a browser, but I think in your case that would look like this:Incidentally, the
start()
method here already handles this scenario (and handles waiting for the application to start), so be sure you’re not reinventing the wheel.