@Test public void testCreateWithDefaults() { // when Bulkhead bulkhead = Bulkhead.ofDefaults("test"); // then assertThat(bulkhead).isNotNull(); assertThat(bulkhead.getBulkheadConfig()).isNotNull(); }
@Test public void testCreateWithNullConfig() { // given Supplier<BulkheadConfig> configSupplier = () -> null; // when Bulkhead bulkhead = Bulkhead.of("test", configSupplier); // then assertThat(bulkhead).isNotNull(); assertThat(bulkhead.getBulkheadConfig()).isNotNull(); }
@Test public void shouldReturnTheCorrectName() { Bulkhead bulkhead = registry.bulkhead("test"); assertThat(bulkhead).isNotNull(); assertThat(bulkhead.getName()).isEqualTo("test"); assertThat(bulkhead.getBulkheadConfig().getMaxConcurrentCalls()).isEqualTo(25); assertThat(bulkhead.getMetrics().getAvailableConcurrentCalls()).isEqualTo(25); }