Polish access modifiers for test classes

See gh-27736
This commit is contained in:
izeye 2021-08-18 00:52:34 +09:00 committed by Andy Wilkinson
parent 2baee89971
commit 8a425dedfd
42 changed files with 45 additions and 46 deletions

View File

@ -27,7 +27,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* *
* @author Andy Wilkinson * @author Andy Wilkinson
*/ */
public class ArtifactoryRepositoryTests { class ArtifactoryRepositoryTests {
@Test @Test
void whenProjectVersionIsMilestoneThenRepositoryIsMilestone() { void whenProjectVersionIsMilestoneThenRepositoryIsMilestone() {

View File

@ -38,14 +38,14 @@ import static org.assertj.core.api.Assertions.assertThat;
* *
* @author Andy Wilkinson * @author Andy Wilkinson
*/ */
public class BomPluginIntegrationTests { class BomPluginIntegrationTests {
private File projectDir; private File projectDir;
private File buildFile; private File buildFile;
@BeforeEach @BeforeEach
public void setup(@TempDir File projectDir) throws IOException { void setup(@TempDir File projectDir) throws IOException {
this.projectDir = projectDir; this.projectDir = projectDir;
this.buildFile = new File(this.projectDir, "build.gradle"); this.buildFile = new File(this.projectDir, "build.gradle");
} }

View File

@ -25,7 +25,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* *
* @author Andy Wilkinson * @author Andy Wilkinson
*/ */
public class ArtifactVersionDependencyVersionTests { class ArtifactVersionDependencyVersionTests {
@Test @Test
void parseWhenVersionIsNotAMavenVersionShouldReturnNull() { void parseWhenVersionIsNotAMavenVersionShouldReturnNull() {

View File

@ -25,7 +25,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* *
* @author Andy Wilkinson * @author Andy Wilkinson
*/ */
public class CalendarVersionDependencyVersionTests { class CalendarVersionDependencyVersionTests {
@Test @Test
void parseWhenVersionIsNotACalendarVersionShouldReturnNull() { void parseWhenVersionIsNotACalendarVersionShouldReturnNull() {

View File

@ -25,7 +25,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* *
* @author Andy Wilkinson * @author Andy Wilkinson
*/ */
public class DependencyVersionTests { class DependencyVersionTests {
@Test @Test
void parseWhenValidMavenVersionShouldReturnArtifactVersionDependencyVersion() { void parseWhenValidMavenVersionShouldReturnArtifactVersionDependencyVersion() {

View File

@ -25,7 +25,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* *
* @author Andy Wilkinson * @author Andy Wilkinson
*/ */
public class NumericQualifierDependencyVersionTests { class NumericQualifierDependencyVersionTests {
@Test @Test
void isNewerThanOnVersionWithNumericQualifierWhenInputHasNoQualifierShouldReturnTrue() { void isNewerThanOnVersionWithNumericQualifierWhenInputHasNoQualifierShouldReturnTrue() {

View File

@ -25,7 +25,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* *
* @author Andy Wilkinson * @author Andy Wilkinson
*/ */
public class ReleaseTrainDependencyVersionTests { class ReleaseTrainDependencyVersionTests {
@Test @Test
void parsingOfANonReleaseTrainVersionReturnsNull() { void parsingOfANonReleaseTrainVersionReturnsNull() {

View File

@ -37,7 +37,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* *
* @author Andy Wilkinson * @author Andy Wilkinson
*/ */
public class ReproduciblePluginsDatActionTests { class ReproduciblePluginsDatActionTests {
@Test @Test
void postProcessingOrdersCategoriesAndPlugins() throws IOException { void postProcessingOrdersCategoriesAndPlugins() throws IOException {

View File

@ -33,7 +33,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy;
* @author Andy Wilkinson * @author Andy Wilkinson
* @author Mike Smithson * @author Mike Smithson
*/ */
public class PluginXmlParserTests { class PluginXmlParserTests {
private final PluginXmlParser parser = new PluginXmlParser(); private final PluginXmlParser parser = new PluginXmlParser();

View File

@ -34,14 +34,14 @@ import static org.assertj.core.api.Assertions.assertThat;
* *
* @author Andy Wilkinson * @author Andy Wilkinson
*/ */
public class OptionalDependenciesPluginIntegrationTests { class OptionalDependenciesPluginIntegrationTests {
private File projectDir; private File projectDir;
private File buildFile; private File buildFile;
@BeforeEach @BeforeEach
public void setup(@TempDir File projectDir) throws IOException { void setup(@TempDir File projectDir) throws IOException {
this.projectDir = projectDir; this.projectDir = projectDir;
this.buildFile = new File(this.projectDir, "build.gradle"); this.buildFile = new File(this.projectDir, "build.gradle");
} }
@ -80,7 +80,7 @@ public class OptionalDependenciesPluginIntegrationTests {
optionalDependenciesAreAddedToSourceSetClasspath("test", "runtimeClasspath"); optionalDependenciesAreAddedToSourceSetClasspath("test", "runtimeClasspath");
} }
public void optionalDependenciesAreAddedToSourceSetClasspath(String sourceSet, String classpath) private void optionalDependenciesAreAddedToSourceSetClasspath(String sourceSet, String classpath)
throws IOException { throws IOException {
try (PrintWriter out = new PrintWriter(new FileWriter(this.buildFile))) { try (PrintWriter out = new PrintWriter(new FileWriter(this.buildFile))) {
out.println("plugins {"); out.println("plugins {");

View File

@ -39,7 +39,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* *
* @author Andy Wilkinson * @author Andy Wilkinson
*/ */
public class DefaultWebMvcTagsProviderTests { class DefaultWebMvcTagsProviderTests {
@Test @Test
void whenTagsAreProvidedThenDefaultTagsArePresent() { void whenTagsAreProvidedThenDefaultTagsArePresent() {

View File

@ -25,7 +25,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* *
* @author Andy Wilkinson * @author Andy Wilkinson
*/ */
public class OutcomeTests { class OutcomeTests {
@Test @Test
void outcomeForInformationalStatusIsInformational() { void outcomeForInformationalStatusIsInformational() {

View File

@ -37,7 +37,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* *
* @author Andy Wilkinson * @author Andy Wilkinson
*/ */
public class DefaultWebFluxTagsProviderTests { class DefaultWebFluxTagsProviderTests {
@Test @Test
void whenTagsAreProvidedThenDefaultTagsArePresent() { void whenTagsAreProvidedThenDefaultTagsArePresent() {

View File

@ -35,7 +35,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
* @author Oliver Gierke * @author Oliver Gierke
*/ */
@SuppressWarnings("resource") @SuppressWarnings("resource")
public class AutoConfigurationPackagesTests { class AutoConfigurationPackagesTests {
@Test @Test
void setAndGet() { void setAndGet() {

View File

@ -32,7 +32,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* *
* @author Andy Wilkinson * @author Andy Wilkinson
*/ */
public class LifecycleAutoConfigurationTests { class LifecycleAutoConfigurationTests {
private final ApplicationContextRunner contextRunner = new ApplicationContextRunner() private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(LifecycleAutoConfiguration.class)); .withConfiguration(AutoConfigurations.of(LifecycleAutoConfiguration.class));

View File

@ -45,7 +45,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Brian Clozel * @author Brian Clozel
*/ */
@Testcontainers(disabledWithoutDocker = true) @Testcontainers(disabledWithoutDocker = true)
public class ReactiveElasticsearchRepositoriesAutoConfigurationTests { class ReactiveElasticsearchRepositoriesAutoConfigurationTests {
@Container @Container
static ElasticsearchContainer elasticsearch = new ElasticsearchContainer(DockerImageNames.elasticsearch()) static ElasticsearchContainer elasticsearch = new ElasticsearchContainer(DockerImageNames.elasticsearch())

View File

@ -45,7 +45,7 @@ import static org.mockito.Mockito.mock;
* @author Brian Clozel * @author Brian Clozel
*/ */
@Testcontainers(disabledWithoutDocker = true) @Testcontainers(disabledWithoutDocker = true)
public class ReactiveElasticsearchRestClientAutoConfigurationTests { class ReactiveElasticsearchRestClientAutoConfigurationTests {
@Container @Container
static ElasticsearchContainer elasticsearch = new ElasticsearchContainer(DockerImageNames.elasticsearch()) static ElasticsearchContainer elasticsearch = new ElasticsearchContainer(DockerImageNames.elasticsearch())

View File

@ -40,7 +40,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Stephane Nicoll * @author Stephane Nicoll
* @author Michael J. Simons * @author Michael J. Simons
*/ */
public class Neo4jReactiveRepositoriesAutoConfigurationTests { class Neo4jReactiveRepositoriesAutoConfigurationTests {
private final ApplicationContextRunner contextRunner = new ApplicationContextRunner() private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withUserConfiguration(MockedDriverConfiguration.class) .withUserConfiguration(MockedDriverConfiguration.class)

View File

@ -43,7 +43,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*/ */
@SpringBootTest @SpringBootTest
@Testcontainers(disabledWithoutDocker = true) @Testcontainers(disabledWithoutDocker = true)
public class Neo4jRepositoriesAutoConfigurationIntegrationTests { class Neo4jRepositoriesAutoConfigurationIntegrationTests {
@Container @Container
private static final Neo4jContainer<?> neo4jServer = new Neo4jContainer<>(DockerImageNames.neo4j()) private static final Neo4jContainer<?> neo4jServer = new Neo4jContainer<>(DockerImageNames.neo4j())

View File

@ -37,7 +37,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Kazuki Shimizu * @author Kazuki Shimizu
*/ */
@ExtendWith(OutputCaptureExtension.class) @ExtendWith(OutputCaptureExtension.class)
public class FreeMarkerAutoConfigurationTests { class FreeMarkerAutoConfigurationTests {
private final BuildOutput buildOutput = new BuildOutput(getClass()); private final BuildOutput buildOutput = new BuildOutput(getClass());

View File

@ -17,11 +17,10 @@
package org.springframework.boot.autoconfigure.packagestest.two; package org.springframework.boot.autoconfigure.packagestest.two;
import org.springframework.boot.autoconfigure.AutoConfigurationPackage; import org.springframework.boot.autoconfigure.AutoConfigurationPackage;
import org.springframework.boot.autoconfigure.AutoConfigurationPackagesTests;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
/** /**
* Sample configuration used in {@link AutoConfigurationPackagesTests}. * Sample configuration used in {@code AutoConfigurationPackagesTests}.
* *
* @author Oliver Gierke * @author Oliver Gierke
*/ */

View File

@ -42,7 +42,7 @@ import static org.assertj.core.api.Assertions.assertThat;
@SpringBootTest @SpringBootTest
@ActiveProfiles({ "test1", "test2" }) @ActiveProfiles({ "test1", "test2" })
@ContextConfiguration(loader = SpringBootTestWithActiveProfilesAndEnvironmentPropertyTests.Loader.class) @ContextConfiguration(loader = SpringBootTestWithActiveProfilesAndEnvironmentPropertyTests.Loader.class)
public class SpringBootTestWithActiveProfilesAndEnvironmentPropertyTests { class SpringBootTestWithActiveProfilesAndEnvironmentPropertyTests {
@Autowired @Autowired
private Environment environment; private Environment environment;

View File

@ -44,7 +44,7 @@ import static org.assertj.core.api.Assertions.assertThat;
@SpringBootTest @SpringBootTest
@ActiveProfiles({ "test1", "test2" }) @ActiveProfiles({ "test1", "test2" })
@ContextConfiguration(loader = SpringBootTestWithActiveProfilesAndSystemEnvironmentPropertyTests.Loader.class) @ContextConfiguration(loader = SpringBootTestWithActiveProfilesAndSystemEnvironmentPropertyTests.Loader.class)
public class SpringBootTestWithActiveProfilesAndSystemEnvironmentPropertyTests { class SpringBootTestWithActiveProfilesAndSystemEnvironmentPropertyTests {
@Autowired @Autowired
private Environment environment; private Environment environment;

View File

@ -33,7 +33,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Andy Wilkinson * @author Andy Wilkinson
*/ */
@ClassPathExclusions({ "reactor-netty*.jar", "jetty-client*.jar" }) @ClassPathExclusions({ "reactor-netty*.jar", "jetty-client*.jar" })
public class WebTestClientContextCustomizerWithoutSupportedHttpClientTests { class WebTestClientContextCustomizerWithoutSupportedHttpClientTests {
@Test @Test
void createContextCustomizerWhenNoSupportedHttpClientIsAvailableShouldReturnNull() { void createContextCustomizerWhenNoSupportedHttpClientIsAvailableShouldReturnNull() {

View File

@ -34,7 +34,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Stephane Nicoll * @author Stephane Nicoll
*/ */
@ClassPathExclusions("spring-webflux*.jar") @ClassPathExclusions("spring-webflux*.jar")
public class WebTestClientContextCustomizerWithoutWebfluxIntegrationTests { class WebTestClientContextCustomizerWithoutWebfluxIntegrationTests {
@Test @Test
void customizerIsNotCreatedWithoutWebClient() { void customizerIsNotCreatedWithoutWebClient() {

View File

@ -44,7 +44,7 @@ import static org.assertj.core.api.Assertions.entry;
* @author Phillip Webb * @author Phillip Webb
* @author Scott Frederick * @author Scott Frederick
*/ */
public class BuildRequestTests { class BuildRequestTests {
@TempDir @TempDir
File tempDir; File tempDir;

View File

@ -26,7 +26,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Wei Jiang * @author Wei Jiang
* @author Scott Frederick * @author Scott Frederick
*/ */
public class DockerConfigurationTests { class DockerConfigurationTests {
@Test @Test
void createDockerConfigurationWithDefaults() { void createDockerConfigurationWithDefaults() {

View File

@ -49,7 +49,7 @@ import static org.assertj.core.api.Assertions.assertThat;
@GradleCompatibility @GradleCompatibility
@Testcontainers(disabledWithoutDocker = true) @Testcontainers(disabledWithoutDocker = true)
@Disabled("Disabled until differences between running locally and in CI can be diagnosed") @Disabled("Disabled until differences between running locally and in CI can be diagnosed")
public class BootBuildImageRegistryIntegrationTests { class BootBuildImageRegistryIntegrationTests {
@Container @Container
static final RegistryContainer registry = new RegistryContainer().withStartupAttempts(5) static final RegistryContainer registry = new RegistryContainer().withStartupAttempts(5)

View File

@ -32,7 +32,7 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
* @author Wei Jiang * @author Wei Jiang
* @author Scott Frederick * @author Scott Frederick
*/ */
public class DockerSpecTests { class DockerSpecTests {
@Test @Test
void asDockerConfigurationWithDefaults() { void asDockerConfigurationWithDefaults() {

View File

@ -37,7 +37,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Andy Wilkinson * @author Andy Wilkinson
*/ */
@ExtendWith(MavenBuildExtension.class) @ExtendWith(MavenBuildExtension.class)
public class BuildInfoIntegrationTests { class BuildInfoIntegrationTests {
@TestTemplate @TestTemplate
void buildInfoPropertiesAreGenerated(MavenBuild mavenBuild) { void buildInfoPropertiesAreGenerated(MavenBuild mavenBuild) {

View File

@ -32,7 +32,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* *
* @author Phillip Webb * @author Phillip Webb
*/ */
public class EclipseM2eIntegrationTests { class EclipseM2eIntegrationTests {
@Test // gh-21992 @Test // gh-21992
void pluginPomIncludesOptionalShadeDependency() throws Exception { void pluginPomIncludesOptionalShadeDependency() throws Exception {

View File

@ -40,7 +40,7 @@ import static org.mockito.Mockito.mock;
* @author Madhura Bhave * @author Madhura Bhave
* @author Scott Frederick * @author Scott Frederick
*/ */
public class CustomLayersProviderTests { class CustomLayersProviderTests {
private CustomLayersProvider customLayersProvider; private CustomLayersProvider customLayersProvider;

View File

@ -31,7 +31,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException
* @author Wei Jiang * @author Wei Jiang
* @author Scott Frederick * @author Scott Frederick
*/ */
public class DockerTests { class DockerTests {
@Test @Test
void asDockerConfigurationWithDefaults() { void asDockerConfigurationWithDefaults() {

View File

@ -37,7 +37,7 @@ import static org.mockito.Mockito.mock;
* @author Madhura Bhave * @author Madhura Bhave
* @author Phillip Webb * @author Phillip Webb
*/ */
public class ConfigTreeConfigDataLoaderTests { class ConfigTreeConfigDataLoaderTests {
private ConfigTreeConfigDataLoader loader = new ConfigTreeConfigDataLoader(); private ConfigTreeConfigDataLoader loader = new ConfigTreeConfigDataLoader();

View File

@ -30,7 +30,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException
* @author Madhura Bhave * @author Madhura Bhave
* @author Phillip Webb * @author Phillip Webb
*/ */
public class ConfigTreeConfigDataResourceTests { class ConfigTreeConfigDataResourceTests {
@Test @Test
void constructorWhenPathStringIsNullThrowsException() { void constructorWhenPathStringIsNullThrowsException() {

View File

@ -34,7 +34,7 @@ import static org.mockito.Mockito.mock;
* @author Madhura Bhave * @author Madhura Bhave
* @author Phillip Webb * @author Phillip Webb
*/ */
public class StandardConfigDataLoaderTests { class StandardConfigDataLoaderTests {
private StandardConfigDataLoader loader = new StandardConfigDataLoader(); private StandardConfigDataLoader loader = new StandardConfigDataLoader();

View File

@ -44,7 +44,7 @@ import static org.mockito.Mockito.mock;
* @author Madhura Bhave * @author Madhura Bhave
* @author Phillip Webb * @author Phillip Webb
*/ */
public class StandardConfigDataLocationResolverTests { class StandardConfigDataLocationResolverTests {
private StandardConfigDataLocationResolver resolver; private StandardConfigDataLocationResolver resolver;

View File

@ -31,7 +31,7 @@ import static org.mockito.Mockito.mock;
* @author Madhura Bhave * @author Madhura Bhave
* @author Phillip Webb * @author Phillip Webb
*/ */
public class StandardConfigDataResourceTests { class StandardConfigDataResourceTests {
StandardConfigDataReference reference = mock(StandardConfigDataReference.class); StandardConfigDataReference reference = mock(StandardConfigDataReference.class);

View File

@ -41,7 +41,7 @@ import static org.mockito.Mockito.verify;
* @author Madhura Bhave * @author Madhura Bhave
*/ */
@ExtendWith(MockitoExtension.class) @ExtendWith(MockitoExtension.class)
public class BoundPropertiesTrackingBindHandlerTests { class BoundPropertiesTrackingBindHandlerTests {
private List<ConfigurationPropertySource> sources = new ArrayList<>(); private List<ConfigurationPropertySource> sources = new ArrayList<>();

View File

@ -43,7 +43,7 @@ import static org.mockito.Mockito.mock;
* @author Ilya Lukyanovich * @author Ilya Lukyanovich
* @author Phillip Webb * @author Phillip Webb
*/ */
public class RestTemplateBuilderClientHttpRequestInitializerTests { class RestTemplateBuilderClientHttpRequestInitializerTests {
private final MockClientHttpRequest request = new MockClientHttpRequest(); private final MockClientHttpRequest request = new MockClientHttpRequest();

View File

@ -29,7 +29,7 @@ import static org.mockito.Mockito.mock;
* *
* @author Phillip Webb * @author Phillip Webb
*/ */
public class WebServerApplicationContextTests { class WebServerApplicationContextTests {
@Test @Test
void hasServerNamespaceWhenContextIsNotWebServerApplicationContextReturnsFalse() { void hasServerNamespaceWhenContextIsNotWebServerApplicationContextReturnsFalse() {

View File

@ -31,7 +31,7 @@ import org.springframework.security.rsocket.metadata.UsernamePasswordMetadata;
import org.springframework.util.MimeTypeUtils; import org.springframework.util.MimeTypeUtils;
@SpringBootTest(properties = "spring.rsocket.server.port=0") @SpringBootTest(properties = "spring.rsocket.server.port=0")
public class SampleRSocketApplicationTests { class SampleRSocketApplicationTests {
@LocalRSocketServerPort @LocalRSocketServerPort
private int port; private int port;