|
1 | 1 | /* |
2 | | - * Copyright (C) 2004-2019, GoodData(R) Corporation. All rights reserved. |
| 2 | + * Copyright (C) 2004-2021, GoodData(R) Corporation. All rights reserved. |
3 | 3 | * This source code is licensed under the BSD-style license found in the |
4 | 4 | * LICENSE.txt file in the root directory of this source tree. |
5 | 5 | */ |
|
22 | 22 | import java.io.IOException; |
23 | 23 | import java.util.Collection; |
24 | 24 | import java.util.Map; |
| 25 | +import java.util.Optional; |
25 | 26 |
|
26 | | -import static com.gooddata.sdk.common.util.Validate.isTrue; |
27 | 27 | import static com.gooddata.sdk.common.util.Validate.notNull; |
28 | 28 | import static com.gooddata.sdk.common.util.Validate.notNullState; |
29 | 29 | import static java.lang.String.format; |
@@ -267,13 +267,17 @@ public FutureResult<ProcessStatus> getProcessStatus(final IntegrationProcessStat |
267 | 267 | * You should use the result of {@link #scheduleZendesk4Reload} to see changes in {@link Reload#getStatus()} and |
268 | 268 | * {@link Reload#getProcessId()} or retrieve process URI {@link Reload#getProcessUri()}. |
269 | 269 | * |
270 | | - * @param reload existing reload. |
| 270 | + * @param reload existing reload (self link must be present). |
271 | 271 | * @return same reload with refreshed properties (status, processId, process URI) |
272 | 272 | */ |
273 | 273 | public Reload getZendesk4Reload(final Reload reload) { |
274 | 274 | notNull(reload, "reload"); |
275 | | - isTrue(reload.getUri().isPresent(), "reload.uri"); |
276 | | - return getZendesk4ReloadByUri(reload.getUri().get()); |
| 275 | + final Optional<String> reloadUri = reload.getUri(); |
| 276 | + if (reloadUri.isPresent()) { |
| 277 | + return getZendesk4ReloadByUri(reloadUri.get()); |
| 278 | + } else { |
| 279 | + throw new IllegalArgumentException("Self link in the Reload must be present!"); |
| 280 | + } |
277 | 281 | } |
278 | 282 |
|
279 | 283 | /** |
|
0 commit comments