Examples of circuitBreakers()


Examples of com.yammer.tenacity.core.resources.TenacityCircuitBreakersResource.circuitBreakers()

    @Test
    public void healthyWithNoCircuitBreakers() {
        final TenacityCircuitBreakersResource resource =
                new TenacityCircuitBreakersResource(ImmutableList.<TenacityPropertyKey>of());

        assertThat(resource.circuitBreakers()).isEmpty();

    }

    @Test
    public void healthyWithNonExistentCircuitBreakers() {
View Full Code Here

Examples of com.yammer.tenacity.core.resources.TenacityCircuitBreakersResource.circuitBreakers()

    @Test
    public void healthyWithNonExistentCircuitBreakers() {
        final TenacityCircuitBreakersResource resource =
                new TenacityCircuitBreakersResource(ImmutableList.<TenacityPropertyKey>of(DependencyKey.NON_EXISTENT_HEALTHCHECK));

        assertThat(resource.circuitBreakers()).isEmpty();
    }

    @Test
    public void healthyWithClosedCircuitBreakers() {
        final TenacityCircuitBreakersResource resource =
View Full Code Here

Examples of com.yammer.tenacity.core.resources.TenacityCircuitBreakersResource.circuitBreakers()

        final TenacityCircuitBreakersResource resource =
                new TenacityCircuitBreakersResource(ImmutableList.<TenacityPropertyKey>of(DependencyKey.EXISTENT_HEALTHCHECK));

        new TenacitySuccessCommand(DependencyKey.EXISTENT_HEALTHCHECK).execute();

        assertThat(resource.circuitBreakers())
                .isEqualTo(ImmutableList.of(CircuitBreaker.closed(DependencyKey.EXISTENT_HEALTHCHECK)));
    }

    @Test
    public void healthyExistentAgnostic() {
View Full Code Here

Examples of com.yammer.tenacity.core.resources.TenacityCircuitBreakersResource.circuitBreakers()

        final TenacityCircuitBreakersResource resource =
                new TenacityCircuitBreakersResource(ImmutableList.<TenacityPropertyKey>of(DependencyKey.NON_EXISTENT_HEALTHCHECK, DependencyKey.EXISTENT_HEALTHCHECK));

        new TenacitySuccessCommand(DependencyKey.EXISTENT_HEALTHCHECK).execute();

        assertThat(resource.circuitBreakers())
                .isEqualTo(ImmutableList.of(CircuitBreaker.closed(DependencyKey.EXISTENT_HEALTHCHECK)));
    }

    private static void tryToOpenCircuitBreaker(TenacityPropertyKey key) {
        for (int i = 0; i < 100; i++) {
View Full Code Here

Examples of com.yammer.tenacity.core.resources.TenacityCircuitBreakersResource.circuitBreakers()

        final TenacityCircuitBreakersResource resource =
                new TenacityCircuitBreakersResource(ImmutableList.<TenacityPropertyKey>of(DependencyKey.EXISTENT_HEALTHCHECK));

        tryToOpenCircuitBreaker(DependencyKey.EXISTENT_HEALTHCHECK);

        assertThat(resource.circuitBreakers())
                .isEqualTo(ImmutableList.of(CircuitBreaker.open(DependencyKey.EXISTENT_HEALTHCHECK)));
    }


    @Test
View Full Code Here

Examples of com.yammer.tenacity.core.resources.TenacityCircuitBreakersResource.circuitBreakers()

        final TenacityCircuitBreakersResource resource =
                new TenacityCircuitBreakersResource(ImmutableList.<TenacityPropertyKey>of(DependencyKey.NON_EXISTENT_HEALTHCHECK, DependencyKey.EXISTENT_HEALTHCHECK));

        tryToOpenCircuitBreaker(DependencyKey.EXISTENT_HEALTHCHECK);

        assertThat(resource.circuitBreakers())
                .isEqualTo(ImmutableList.of(CircuitBreaker.open(DependencyKey.EXISTENT_HEALTHCHECK)));
    }

    @Test
    public void multipleOpen() {
View Full Code Here

Examples of com.yammer.tenacity.core.resources.TenacityCircuitBreakersResource.circuitBreakers()

                new TenacityCircuitBreakersResource(ImmutableList.<TenacityPropertyKey>of(DependencyKey.ANOTHER_EXISTENT_HEALTHCHECK, DependencyKey.EXISTENT_HEALTHCHECK));

        tryToOpenCircuitBreaker(DependencyKey.EXISTENT_HEALTHCHECK);
        tryToOpenCircuitBreaker(DependencyKey.ANOTHER_EXISTENT_HEALTHCHECK);

        assertThat(resource.circuitBreakers())
                .containsAll(
                        ImmutableList.of(
                                CircuitBreaker.open(DependencyKey.EXISTENT_HEALTHCHECK),
                                CircuitBreaker.open(DependencyKey.ANOTHER_EXISTENT_HEALTHCHECK)));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.