@Test @SuppressWarnings("unchecked") public void timeLimiterPositiveWithSupplier() { TimeLimiterRegistry registry = new InMemoryTimeLimiterRegistry(config); Supplier<TimeLimiterConfig> timeLimiterConfigSupplier = mock(Supplier.class); given(timeLimiterConfigSupplier.get()).willReturn(config); TimeLimiter firstTimeLimiter = registry.timeLimiter("test", timeLimiterConfigSupplier); verify(timeLimiterConfigSupplier, times(1)).get(); TimeLimiter sameAsFirst = registry.timeLimiter("test", timeLimiterConfigSupplier); verify(timeLimiterConfigSupplier, times(1)).get(); TimeLimiter anotherLimit = registry.timeLimiter("test1", timeLimiterConfigSupplier); verify(timeLimiterConfigSupplier, times(2)).get(); then(firstTimeLimiter).isEqualTo(sameAsFirst); then(firstTimeLimiter).isNotEqualTo(anotherLimit); }
@Override public TimeLimiter timeLimiter(final String name) { return timeLimiter(name, getDefaultConfig(), HashMap.empty()); }
InMemoryTimeLimiterRegistry extends
    AbstractRegistry<TimeLimiter, TimeLimiterConfig> implements TimeLimiterRegistry { @Override public TimeLimiter timeLimiter(final String name) { return timeLimiter(name, getDefaultConfig(), HashMap.empty()); } }
InMemoryTimeLimiterRegistry extends
    AbstractRegistry<TimeLimiter, TimeLimiterConfig> implements TimeLimiterRegistry { @Override public TimeLimiter timeLimiter(final String name) { return timeLimiter(name, getDefaultConfig(), HashMap.empty()); } InMemoryTimeLimiterRegistry();  InMemoryTimeLimiterRegistry(io.vavr.collection.Map<String, String> tags);  InMemoryTimeLimiterRegistry(Map<String, TimeLimiterConfig> configs);  InMemoryTimeLimiterRegistry(Map<String, TimeLimiterConfig> configs,
        io.vavr.collection.Map<String, String> tags);  InMemoryTimeLimiterRegistry(Map<String, TimeLimiterConfig> configs,
        RegistryEventConsumer<TimeLimiter> registryEventConsumer);  InMemoryTimeLimiterRegistry(Map<String, TimeLimiterConfig> configs,
        RegistryEventConsumer<TimeLimiter> registryEventConsumer,
        io.vavr.collection.Map<String, String> tags);  InMemoryTimeLimiterRegistry(Map<String, TimeLimiterConfig> configs,
        List<RegistryEventConsumer<TimeLimiter>> registryEventConsumers);  InMemoryTimeLimiterRegistry(Map<String, TimeLimiterConfig> configs,
        List<RegistryEventConsumer<TimeLimiter>> registryEventConsumers,
        io.vavr.collection.Map<String, String> tags);  InMemoryTimeLimiterRegistry(TimeLimiterConfig defaultConfig);  InMemoryTimeLimiterRegistry(TimeLimiterConfig defaultConfig,
        io.vavr.collection.Map<String, String> tags);  InMemoryTimeLimiterRegistry(TimeLimiterConfig defaultConfig,
        RegistryEventConsumer<TimeLimiter> registryEventConsumer);  InMemoryTimeLimiterRegistry(TimeLimiterConfig defaultConfig,
        RegistryEventConsumer<TimeLimiter> registryEventConsumer,
        io.vavr.collection.Map<String, String> tags);  InMemoryTimeLimiterRegistry(TimeLimiterConfig defaultConfig,
        List<RegistryEventConsumer<TimeLimiter>> registryEventConsumers);  InMemoryTimeLimiterRegistry(TimeLimiterConfig defaultConfig,
        List<RegistryEventConsumer<TimeLimiter>> registryEventConsumers,
        io.vavr.collection.Map<String, String> tags); }
InMemoryTimeLimiterRegistry extends
    AbstractRegistry<TimeLimiter, TimeLimiterConfig> implements TimeLimiterRegistry { @Override public TimeLimiter timeLimiter(final String name) { return timeLimiter(name, getDefaultConfig(), HashMap.empty()); } InMemoryTimeLimiterRegistry();  InMemoryTimeLimiterRegistry(io.vavr.collection.Map<String, String> tags);  InMemoryTimeLimiterRegistry(Map<String, TimeLimiterConfig> configs);  InMemoryTimeLimiterRegistry(Map<String, TimeLimiterConfig> configs,
        io.vavr.collection.Map<String, String> tags);  InMemoryTimeLimiterRegistry(Map<String, TimeLimiterConfig> configs,
        RegistryEventConsumer<TimeLimiter> registryEventConsumer);  InMemoryTimeLimiterRegistry(Map<String, TimeLimiterConfig> configs,
        RegistryEventConsumer<TimeLimiter> registryEventConsumer,
        io.vavr.collection.Map<String, String> tags);  InMemoryTimeLimiterRegistry(Map<String, TimeLimiterConfig> configs,
        List<RegistryEventConsumer<TimeLimiter>> registryEventConsumers);  InMemoryTimeLimiterRegistry(Map<String, TimeLimiterConfig> configs,
        List<RegistryEventConsumer<TimeLimiter>> registryEventConsumers,
        io.vavr.collection.Map<String, String> tags);  InMemoryTimeLimiterRegistry(TimeLimiterConfig defaultConfig);  InMemoryTimeLimiterRegistry(TimeLimiterConfig defaultConfig,
        io.vavr.collection.Map<String, String> tags);  InMemoryTimeLimiterRegistry(TimeLimiterConfig defaultConfig,
        RegistryEventConsumer<TimeLimiter> registryEventConsumer);  InMemoryTimeLimiterRegistry(TimeLimiterConfig defaultConfig,
        RegistryEventConsumer<TimeLimiter> registryEventConsumer,
        io.vavr.collection.Map<String, String> tags);  InMemoryTimeLimiterRegistry(TimeLimiterConfig defaultConfig,
        List<RegistryEventConsumer<TimeLimiter>> registryEventConsumers);  InMemoryTimeLimiterRegistry(TimeLimiterConfig defaultConfig,
        List<RegistryEventConsumer<TimeLimiter>> registryEventConsumers,
        io.vavr.collection.Map<String, String> tags); @Override Seq<TimeLimiter> getAllTimeLimiters(); @Override TimeLimiter timeLimiter(final String name); @Override TimeLimiter timeLimiter(String name,
        io.vavr.collection.Map<String, String> tags); @Override TimeLimiter timeLimiter(final String name, final TimeLimiterConfig config); @Override TimeLimiter timeLimiter(String name,
        TimeLimiterConfig timeLimiterConfig,
        io.vavr.collection.Map<String, String> tags); @Override TimeLimiter timeLimiter(final String name,
        final Supplier<TimeLimiterConfig> timeLimiterConfigSupplier); @Override TimeLimiter timeLimiter(String name,
        Supplier<TimeLimiterConfig> timeLimiterConfigSupplier,
        io.vavr.collection.Map<String, String> tags); @Override TimeLimiter timeLimiter(String name, String configName); @Override TimeLimiter timeLimiter(String name, String configName,
        io.vavr.collection.Map<String, String> tags); }
InMemoryTimeLimiterRegistry extends
    AbstractRegistry<TimeLimiter, TimeLimiterConfig> implements TimeLimiterRegistry { @Override public TimeLimiter timeLimiter(final String name) { return timeLimiter(name, getDefaultConfig(), HashMap.empty()); } InMemoryTimeLimiterRegistry();  InMemoryTimeLimiterRegistry(io.vavr.collection.Map<String, String> tags);  InMemoryTimeLimiterRegistry(Map<String, TimeLimiterConfig> configs);  InMemoryTimeLimiterRegistry(Map<String, TimeLimiterConfig> configs,
        io.vavr.collection.Map<String, String> tags);  InMemoryTimeLimiterRegistry(Map<String, TimeLimiterConfig> configs,
        RegistryEventConsumer<TimeLimiter> registryEventConsumer);  InMemoryTimeLimiterRegistry(Map<String, TimeLimiterConfig> configs,
        RegistryEventConsumer<TimeLimiter> registryEventConsumer,
        io.vavr.collection.Map<String, String> tags);  InMemoryTimeLimiterRegistry(Map<String, TimeLimiterConfig> configs,
        List<RegistryEventConsumer<TimeLimiter>> registryEventConsumers);  InMemoryTimeLimiterRegistry(Map<String, TimeLimiterConfig> configs,
        List<RegistryEventConsumer<TimeLimiter>> registryEventConsumers,
        io.vavr.collection.Map<String, String> tags);  InMemoryTimeLimiterRegistry(TimeLimiterConfig defaultConfig);  InMemoryTimeLimiterRegistry(TimeLimiterConfig defaultConfig,
        io.vavr.collection.Map<String, String> tags);  InMemoryTimeLimiterRegistry(TimeLimiterConfig defaultConfig,
        RegistryEventConsumer<TimeLimiter> registryEventConsumer);  InMemoryTimeLimiterRegistry(TimeLimiterConfig defaultConfig,
        RegistryEventConsumer<TimeLimiter> registryEventConsumer,
        io.vavr.collection.Map<String, String> tags);  InMemoryTimeLimiterRegistry(TimeLimiterConfig defaultConfig,
        List<RegistryEventConsumer<TimeLimiter>> registryEventConsumers);  InMemoryTimeLimiterRegistry(TimeLimiterConfig defaultConfig,
        List<RegistryEventConsumer<TimeLimiter>> registryEventConsumers,
        io.vavr.collection.Map<String, String> tags); @Override Seq<TimeLimiter> getAllTimeLimiters(); @Override TimeLimiter timeLimiter(final String name); @Override TimeLimiter timeLimiter(String name,
        io.vavr.collection.Map<String, String> tags); @Override TimeLimiter timeLimiter(final String name, final TimeLimiterConfig config); @Override TimeLimiter timeLimiter(String name,
        TimeLimiterConfig timeLimiterConfig,
        io.vavr.collection.Map<String, String> tags); @Override TimeLimiter timeLimiter(final String name,
        final Supplier<TimeLimiterConfig> timeLimiterConfigSupplier); @Override TimeLimiter timeLimiter(String name,
        Supplier<TimeLimiterConfig> timeLimiterConfigSupplier,
        io.vavr.collection.Map<String, String> tags); @Override TimeLimiter timeLimiter(String name, String configName); @Override TimeLimiter timeLimiter(String name, String configName,
        io.vavr.collection.Map<String, String> tags);  }