Refine 'Introduce a shared abstraction for database initialization'

Use test fixtures to keep getSettings() package-private

See gh-46213
This commit is contained in:
Phillip Webb
2025-10-22 19:54:46 -07:00
parent 87954afe37
commit 770c94607c
14 changed files with 52 additions and 38 deletions
@@ -62,9 +62,8 @@ public abstract class AbstractScriptDatabaseInitializer implements ResourceLoade
/**
* Return the {@link DatabaseInitializationSettings} being used by the initializer.
* @return the settings being used
* @since 4.0.0
*/
protected DatabaseInitializationSettings getSettings() {
DatabaseInitializationSettings getSettings() {
return this.settings;
}
@@ -0,0 +1,33 @@
/*
* Copyright 2012-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.boot.sql.init;
/**
* Helper to get the settings used by the {@link AbstractScriptDatabaseInitializer}.
*
* @author Phillip Webb
*/
public final class ScriptDatabaseInitializerSettings {
private ScriptDatabaseInitializerSettings() {
}
public static DatabaseInitializationSettings get(AbstractScriptDatabaseInitializer initializer) {
return initializer.getSettings();
}
}