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