@Test public void shouldNotUpdatePropertiesBecauseOfProviderException() { Mockito.when(provider.get()) .thenReturn( CompletableFuture .completedFuture((Collection<DynamicProperty>) Collections.<DynamicProperty>emptyList()) .whenComplete((dynamicProperties, throwable) -> { throw new IllegalStateException(); }) ); poller.handle(1L); }
@Override public void handle(Long event) { logger.debug("Running dynamic-properties poller for {}", api); authenticateAsAdmin(); provider.get() .whenComplete((dynamicProperties, throwable) -> { if (throwable != null) { logger.error("[{}] Unexpected error while getting dynamic properties from provider: {}", api.getId(), provider.name(), throwable); } else if (dynamicProperties != null) { update(dynamicProperties); } }); }
DynamicPropertyUpdater implements Handler<Long> { @Override public void handle(Long event) { logger.debug("Running dynamic-properties poller for {}", api); authenticateAsAdmin(); provider.get() .whenComplete((dynamicProperties, throwable) -> { if (throwable != null) { logger.error("[{}] Unexpected error while getting dynamic properties from provider: {}", api.getId(), provider.name(), throwable); } else if (dynamicProperties != null) { update(dynamicProperties); } }); } }
DynamicPropertyUpdater implements Handler<Long> { @Override public void handle(Long event) { logger.debug("Running dynamic-properties poller for {}", api); authenticateAsAdmin(); provider.get() .whenComplete((dynamicProperties, throwable) -> { if (throwable != null) { logger.error("[{}] Unexpected error while getting dynamic properties from provider: {}", api.getId(), provider.name(), throwable); } else if (dynamicProperties != null) { update(dynamicProperties); } }); } DynamicPropertyUpdater(final ApiEntity api); }
DynamicPropertyUpdater implements Handler<Long> { @Override public void handle(Long event) { logger.debug("Running dynamic-properties poller for {}", api); authenticateAsAdmin(); provider.get() .whenComplete((dynamicProperties, throwable) -> { if (throwable != null) { logger.error("[{}] Unexpected error while getting dynamic properties from provider: {}", api.getId(), provider.name(), throwable); } else if (dynamicProperties != null) { update(dynamicProperties); } }); } DynamicPropertyUpdater(final ApiEntity api); @Override void handle(Long event); void setApiService(ApiService apiService); void setProvider(Provider provider); }
DynamicPropertyUpdater implements Handler<Long> { @Override public void handle(Long event) { logger.debug("Running dynamic-properties poller for {}", api); authenticateAsAdmin(); provider.get() .whenComplete((dynamicProperties, throwable) -> { if (throwable != null) { logger.error("[{}] Unexpected error while getting dynamic properties from provider: {}", api.getId(), provider.name(), throwable); } else if (dynamicProperties != null) { update(dynamicProperties); } }); } DynamicPropertyUpdater(final ApiEntity api); @Override void handle(Long event); void setApiService(ApiService apiService); void setProvider(Provider provider);  }