@@ -0,0 +1,2665 @@
+/*%0A * Copyright 2012-2018 the original author or authors.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage org.springframework.boot.actuate.autoconfigure.metrics.export.properties;%0A%0Aimport java.time.Duration;%0A%0Aimport org.junit.Test;%0A%0Aimport static org.assertj.core.api.Assertions.assertThat;%0A%0A/**%0A * Base test for %7B@link StepRegistryPropertiesConfigAdapter%7D implementations.%0A *%0A * @author Stephane Nicoll%0A */%0Apublic abstract class StepRegistryPropertiesConfigAdapterTests%3CP extends StepRegistryProperties, A extends StepRegistryPropertiesConfigAdapter%3CP%3E%3E %7B%0A%0A%09protected abstract P createProperties();%0A%0A%09protected abstract A createConfigAdapter(P properties);%0A%0A%09@Test%0A%09public void whenPropertiesStepIsSetAdapterStepReturnsIt() %7B%0A%09%09P properties = createProperties();%0A%09%09properties.setStep(Duration.ofSeconds(42));%0A%09%09assertThat(createConfigAdapter(properties).step())%0A%09%09%09%09.isEqualTo(Duration.ofSeconds(42));%0A%09%7D%0A%0A%09@Test%0A%09public void whenPropertiesEnabledIsSetAdapterEnabledReturnsIt() %7B%0A%09%09P properties = createProperties();%0A%09%09properties.setEnabled(false);%0A%09%09assertThat(createConfigAdapter(properties).enabled()).isFalse();%0A%09%7D%0A%0A%09@Test%0A%09public void whenPropertiesConnectTimeoutIsSetAdapterConnectTimeoutReturnsIt() %7B%0A%09%09P properties = createProperties();%0A%09%09properties.setConnectTimeout(Duration.ofMinutes(42));%0A%09%09assertThat(createConfigAdapter(properties).connectTimeout())%0A%09%09%09%09.isEqualTo(Duration.ofMinutes(42));%0A%09%7D%0A%0A%09@Test%0A%09public void whenPropertiesReadTimeoutIsSetAdapterReadTimeoutReturnsIt() %7B%0A%09%09P properties = createProperties();%0A%09%09properties.setReadTimeout(Duration.ofMillis(42));%0A%09%09assertThat(createConfigAdapter(properties).readTimeout())%0A%09%09%09%09.isEqualTo(Duration.ofMillis(42));%0A%09%7D%0A%0A%09@Test%0A%09public void whenPropertiesNumThreadsIsSetAdapterNumThreadsReturnsIt() %7B%0A%09%09P properties = createProperties();%0A%09%09properties.setNumThreads(42);%0A%09%09assertThat(createConfigAdapter(properties).numThreads()).isEqualTo(42);%0A%09%7D%0A%0A%09@Test%0A%09public void whenPropertiesBatchSizeIsSetAdapterBatchSizeReturnsIt() %7B%0A%09%09P properties = createProperties();%0A%09%09properties.setBatchSize(10042);%0A%09%09assertThat(createConfigAdapter(properties).batchSize()).isEqualTo(10042);%0A%09%7D%0A%0A%7D%0A

Add base test for StepRegistryPropertiesConfigAdapter