return getRoute(cloudFoundryClient, domainId, host, path, port)
.otherwiseIfEmpty(ExceptionUtils.illegalArgument("Route for %s does not exist", domain));
}
private static Mono<RouteResource> getRoute(CloudFoundryClient cloudFoundryClient, String domainId, String host, String path, Integer port) {
if (port != null) {
<BUG>return requestRoutes(cloudFoundryClient, domainId, host, path, port)
</BUG>
.singleOrEmpty();
} else {
return requestRoutes(cloudFoundryClient, domainId, host, path, port)

return getRoute(cloudFoundryClient, domainId, host, path, port)
.otherwiseIfEmpty(ExceptionUtils.illegalArgument("Route for %s does not exist", domain));
}
private static Mono<RouteResource> getRoute(CloudFoundryClient cloudFoundryClient, String domainId, String host, String path, Integer port) {
if (port != null) {
return requestRoutes(cloudFoundryClient, domainId, null, null, port)
.singleOrEmpty();
} else {
return requestRoutes(cloudFoundryClient, domainId, host, path, port)
