Fix duplicated tests

Signed-off-by: Hyunwoo Jung <hyunwoojung@kakao.com>

See gh-51722
This commit is contained in:
Hyunwoo Jung
2026-09-15 12:48:22 +01:00
committed by Andy Wilkinson
parent 036caad4e2
commit ed63da9f5d
7 changed files with 9 additions and 34 deletions
@@ -294,16 +294,15 @@ class EnvironmentEndpointTests {
@Test
void propertyEntryWhenShowWhenAuthorized() {
testPropertyEntry(Show.ALWAYS, "bar", "another");
testPropertyEntry(Show.WHEN_AUTHORIZED, "bar", "another");
}
private void testPropertyEntry(Show always, String bar, String another) {
private void testPropertyEntry(Show show, String bar, String another) {
TestPropertyValues.of("my.foo=another").applyToSystemProperties(() -> {
StandardEnvironment environment = new StandardEnvironment();
TestPropertyValues.of("my.foo=bar", "my.foo2=bar2")
.applyTo(environment, TestPropertyValues.Type.MAP, "test");
EnvironmentEntryDescriptor descriptor = new EnvironmentEndpoint(environment, Collections.emptyList(),
always)
EnvironmentEntryDescriptor descriptor = new EnvironmentEndpoint(environment, Collections.emptyList(), show)
.environmentEntry("my.foo");
assertThat(descriptor).isNotNull();
assertThat(descriptor.getProperty()).isNotNull();
@@ -60,13 +60,7 @@ class ChangeableUrlsTests {
}
@Test
void httpUrl() throws Exception {
URL url = new URL("https://spring.io");
assertThat(ChangeableUrls.fromUrls(url)).isEmpty();
}
@Test
void httpsUrl() throws Exception {
void nonFileUrl() throws Exception {
URL url = new URL("https://spring.io");
assertThat(ChangeableUrls.fromUrls(url)).isEmpty();
}
@@ -58,7 +58,8 @@ class MongoAutoConfigurationTests {
@Test
void settingsAdded() {
this.contextRunner.withUserConfiguration(SettingsConfig.class)
this.contextRunner.withPropertyValues("spring.mongodb.host:localhost")
.withUserConfiguration(SettingsConfig.class)
.run((context) -> assertThat(
getSettings(context).getSocketSettings().getConnectTimeout(TimeUnit.MILLISECONDS))
.isEqualTo(300));
@@ -66,7 +67,8 @@ class MongoAutoConfigurationTests {
@Test
void settingsAddedButNoHost() {
this.contextRunner.withUserConfiguration(SettingsConfig.class)
this.contextRunner.withPropertyValues("spring.mongodb.uri:mongodb://localhost/test")
.withUserConfiguration(SettingsConfig.class)
.run((context) -> assertThat(
getSettings(context).getSocketSettings().getConnectTimeout(TimeUnit.MILLISECONDS))
.isEqualTo(300));
@@ -259,14 +259,6 @@ class Neo4jAutoConfigurationTests {
assertThat(mapDriverConfig(properties).encrypted()).isTrue();
}
@Test
void securityWithTrustSignedCertificates() {
Neo4jProperties properties = new Neo4jProperties();
properties.getSecurity().setTrustStrategy(TrustStrategy.TRUST_SYSTEM_CA_SIGNED_CERTIFICATES);
assertThat(mapDriverConfig(properties).trustStrategy().strategy())
.isEqualTo(Config.TrustStrategy.Strategy.TRUST_SYSTEM_CA_SIGNED_CERTIFICATES);
}
@Test
void securityWithTrustAllCertificates() {
Neo4jProperties properties = new Neo4jProperties();
@@ -171,12 +171,6 @@ class TomcatServerPropertiesTests {
assertThat(this.properties.getThreads().getMinSpare()).isEqualTo(getDefaultProtocol().getMinSpareThreads());
}
@Test
void tomcatMaxHttpPostSizeMatchesConnectorDefault() {
assertThat(this.properties.getMaxHttpFormPostSize().toBytes())
.isEqualTo(getDefaultConnector().getMaxPostSize());
}
@Test
void tomcatMaxParameterCountMatchesConnectorDefault() {
assertThat(this.properties.getMaxParameterCount()).isEqualTo(getDefaultConnector().getMaxParameterCount());