Merge branch '2.2.x'

This commit is contained in:
Spencer Gibb
2020-03-25 14:38:21 -04:00
2 changed files with 13 additions and 7 deletions

View File

@@ -19,6 +19,7 @@ package org.springframework.cloud.configuration;
import java.util.Collections;
import java.util.List;
import org.junit.Ignore;
import org.junit.Test;
import static org.assertj.core.api.BDDAssertions.then;
@@ -142,6 +143,7 @@ public class SpringBootDependencyTests {
then(verificationResult.action).isNotEmpty();
}
@Ignore // FIXME: https://github.com/spring-cloud/spring-cloud-commons/issues/717
@Test
public void should_match_against_current_manifest() {
verifyCurrentVersionFromManifest("2.3");

View File

@@ -18,12 +18,12 @@ package org.springframework.cloud.loadbalancer.core;
import java.time.Duration;
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import org.assertj.core.api.Assertions;
import org.assertj.core.util.Lists;
import org.awaitility.Awaitility;
import org.junit.Ignore;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -467,27 +467,31 @@ class HealthCheckServiceInstanceListSupplierTests {
Assertions.assertThat(emitCounter).hasValue(1);
}
@Ignore // Fixme: see https://github.com/spring-cloud/spring-cloud-gateway/issues/1627
@Test
void shouldCancelSubscription() {
final AtomicInteger instancesCanceled = new AtomicInteger();
final AtomicBoolean subscribed = new AtomicBoolean();
ServiceInstanceListSupplier delegate = Mockito
.mock(ServiceInstanceListSupplier.class);
Mockito.when(delegate.get()).thenReturn(Flux.<List<ServiceInstance>>never()
.log("test").doOnCancel(instancesCanceled::incrementAndGet));
Mockito.when(delegate.get())
.thenReturn(Flux.<List<ServiceInstance>>never()
.doOnSubscribe(subscription -> subscribed.set(true))
.doOnCancel(instancesCanceled::incrementAndGet));
listSupplier = new HealthCheckServiceInstanceListSupplier(delegate, healthCheck,
webClient);
listSupplier.afterPropertiesSet();
Awaitility.await("delegate subscription").pollDelay(Duration.ofMillis(50))
.atMost(VERIFY_TIMEOUT).untilTrue(subscribed);
Assertions.assertThat(instancesCanceled).hasValue(0);
listSupplier.destroy();
Awaitility.await().pollDelay(Duration.ofMillis(100)).atMost(VERIFY_TIMEOUT)
.untilAsserted(
Awaitility.await("delegate cancellation").pollDelay(Duration.ofMillis(100))
.atMost(VERIFY_TIMEOUT).untilAsserted(
() -> Assertions.assertThat(instancesCanceled).hasValue(1));
}