public class MockPropertySource extends PropertiesPropertySource
PropertySource
実装。ユーザー提供の Properties
SE オブジェクトを受け入れるか、構築中に省略した場合、実装はそれ自体を初期化します。setProperty(java.lang.String, java.lang.Object)
および withProperty(java.lang.String, java.lang.Object)
メソッドは、便宜上公開されています。例:
PropertySource<?> source = new MockPropertySource().withProperty("foo", "bar");
MockEnvironment
PropertySource.StubPropertySource
修飾子と型 | フィールドと説明 |
---|---|
static StringSE | MOCK_PROPERTIES_PROPERTY_SOURCE_NAME "mockProperties" は、明示的に名前が指定されていない場合の MockPropertySource インスタンスのデフォルト名です。 |
logger, name, source
コンストラクターと説明 |
---|
MockPropertySource() |
MockPropertySource(PropertiesSE properties) |
MockPropertySource(StringSE name) 独自の内部 Properties SE インスタンスを維持する、指定された名前で新しい MockPropertySource を作成します。 |
MockPropertySource(StringSE name, PropertiesSE properties) 指定された名前で、指定された Properties SE オブジェクトによる新しい MockPropertySource を作成します。 |
修飾子と型 | メソッドと説明 |
---|---|
void | setProperty(StringSE name, ObjectSE value) 基になる Properties SE オブジェクトに指定されたプロパティを設定します。 |
MockPropertySource | withProperty(StringSE name, ObjectSE value) 現在のインスタンスを返す setProperty(java.lang.String, java.lang.Object) の便利なシノニム。 |
getPropertyNames
containsProperty, getProperty
equals, getName, getSource, hashCode, named, toString
cloneSE, finalizeSE, getClassSE, notifySE, notifyAllSE, waitSE, waitSE, waitSE
public static final StringSE MOCK_PROPERTIES_PROPERTY_SOURCE_NAME
MockPropertySource
インスタンスのデフォルト名です。public MockPropertySource()
public MockPropertySource(StringSE name)
Properties
SE インスタンスを維持する、指定された名前で新しい MockPropertySource
を作成します。name
- プロパティソースの名前 public MockPropertySource(PropertiesSE properties)
properties
- 使用するプロパティ public MockPropertySource(StringSE name, PropertiesSE properties)
Properties
SE オブジェクトによる新しい MockPropertySource
を作成します。name
- プロパティソースの名前 properties
- 使用するプロパティ public void setProperty(StringSE name, ObjectSE value)
Properties
SE オブジェクトに指定されたプロパティを設定します。public MockPropertySource withProperty(StringSE name, ObjectSE value)
setProperty(java.lang.String, java.lang.Object)
の便利なシノニム。メソッドチェーンや流れるようなスタイルの使用に役立ちます。MockPropertySource
インスタンス