C
- アプリケーションコンテキスト型 public class ApplicationContextAssert<C extends ApplicationContext> extends org.assertj.core.api.AbstractAssert<ApplicationContextAssert<C>,C>
ApplicationContext
に適用できる AssertJ assertions
。ApplicationContextRunner
, AssertableApplicationContext
修飾子と型 | クラスと説明 |
---|---|
static class | ApplicationContextAssert.Scope アサーションの範囲。 |
修飾子と型 | メソッドと説明 |
---|---|
ApplicationContextAssert<C> | doesNotHaveBean(ClassSE<?> type) アプリケーションコンテキスト(または祖先)に指定された型の Bean が含まれていないことを確認します。 |
ApplicationContextAssert<C> | doesNotHaveBean(ClassSE<?> type, ApplicationContextAssert.Scope scope) アプリケーションコンテキストに、指定された型の Bean が含まれていないことを確認します。 |
ApplicationContextAssert<C> | doesNotHaveBean(StringSE name) 指定された名前の Bean がアプリケーションコンテキストに含まれていないことを確認します。 |
protected C | getApplicationContext() |
<T> org.assertj.core.api.AbstractObjectAssert<?,T> | getBean(ClassSE<T> type) アプリケーションコンテキスト(または祖先)から指定された型の単一の Bean を取得します。Bean はテスト中のオブジェクトになります。 |
<T> org.assertj.core.api.AbstractObjectAssert<?,T> | getBean(ClassSE<T> type, ApplicationContextAssert.Scope scope) アプリケーションコンテキストから指定された型の単一の Bean を取得します。Bean はテスト中のオブジェクトになります。 |
org.assertj.core.api.AbstractObjectAssert<?,ObjectSE> | getBean(StringSE name) 指定された名前の単一の Bean をアプリケーションコンテキストから取得します。Bean はテスト対象のオブジェクトになります。 |
<T> org.assertj.core.api.AbstractObjectAssert<?,T> | getBean(StringSE name, ClassSE<T> type) 指定された名前と型の単一の Bean をアプリケーションコンテキストから取得します。Bean はテスト中のオブジェクトになります。 |
<T> org.assertj.core.api.AbstractObjectArrayAssert<?,StringSE> | getBeanNames(ClassSE<T> type) アプリケーションコンテキストから指定された型の Bean 名を取得します。名前はテスト対象のオブジェクト配列になります。 |
<T> org.assertj.core.api.MapAssert<StringSE,T> | getBeans(ClassSE<T> type) マップ Bean の名前と指定された型のインスタンスをアプリケーションコンテキスト(または祖先)から取得します。マップはテスト対象のオブジェクトになります。 |
<T> org.assertj.core.api.MapAssert<StringSE,T> | getBeans(ClassSE<T> type, ApplicationContextAssert.Scope scope) マップ Bean の名前と特定の型のインスタンスをアプリケーションコンテキストから取得します。マップはテスト対象のオブジェクトになります。 |
org.assertj.core.api.AbstractThrowableAssert<?,? extends ThrowableSE> | getFailure() テスト中のオブジェクトになるアプリケーションコンテキストの実行を停止した障害を取得します。 |
protected ThrowableSE | getStartupFailure() |
ApplicationContextAssert<C> | hasBean(StringSE name) 指定された名前の Bean がアプリケーションコンテキストに含まれていることを確認します。 |
ApplicationContextAssert<C> | hasFailed() アプリケーションが起動に失敗したことを確認します。 |
ApplicationContextAssert<C> | hasNotFailed() アプリケーションが起動に失敗していないことを確認します。 |
ApplicationContextAssert<C> | hasSingleBean(ClassSE<?> type) アプリケーションコンテキスト(または祖先)に、指定された型の単一の Bean が含まれていることを確認します。 |
ApplicationContextAssert<C> | hasSingleBean(ClassSE<?> type, ApplicationContextAssert.Scope scope) アプリケーションコンテキストに、指定された型の単一の Bean が含まれていることを確認します。 |
as, as, asList, asString, describedAs, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, equals, failWithMessage, getWritableAssertionInfo, has, hashCode, hasSameClassAs, hasSameHashCodeAs, hasToString, inBinary, inHexadecimal, is, isEqualTo, isExactlyInstanceOf, isIn, isIn, isInstanceOf, isInstanceOfAny, isInstanceOfSatisfying, isNot, isNotEqualTo, isNotExactlyInstanceOf, isNotIn, isNotIn, isNotInstanceOf, isNotInstanceOfAny, isNotNull, isNotOfAnyClassIn, isNotSameAs, isNull, isOfAnyClassIn, isSameAs, matches, matches, newListAssertInstance, overridingErrorMessage, satisfies, satisfies, setCustomRepresentation, throwAssertionError, usingComparator, usingComparator, usingDefaultComparator, withFailMessage, withRepresentation, withThreadDumpOnError
cloneSE, finalizeSE, getClassSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSE
public ApplicationContextAssert<C> hasBean(StringSE name)
例:
assertThat(context).hasBean("fooBean");
name
- Bean の名前 this
アサーションオブジェクト。AssertionErrorSE
- アプリケーションコンテキストが開始されなかった場合 AssertionErrorSE
- アプリケーションコンテキストに、指定された名前の Bean が含まれていない場合 public ApplicationContextAssert<C> hasSingleBean(ClassSE<?> type)
例:
assertThat(context).hasSingleBean(Foo.class);
type
- Bean 型 this
アサーションオブジェクト。AssertionErrorSE
- アプリケーションコンテキストが開始されなかった場合 AssertionErrorSE
- アプリケーションコンテキストが指定された型の Bean を実行しない場合 AssertionErrorSE
- アプリケーションコンテキストに特定の型の複数の Bean が含まれている public ApplicationContextAssert<C> hasSingleBean(ClassSE<?> type, ApplicationContextAssert.Scope scope)
例:
assertThat(context).hasSingleBean(Foo.class, Scope.NO_ANCESTORS);
type
- Bean 型 scope
- アサーションの範囲 this
アサーションオブジェクト。AssertionErrorSE
- アプリケーションコンテキストが開始されなかった場合 AssertionErrorSE
- アプリケーションコンテキストが指定された型の Bean を実行しない場合 AssertionErrorSE
- アプリケーションコンテキストに特定の型の複数の Bean が含まれている public ApplicationContextAssert<C> doesNotHaveBean(ClassSE<?> type)
例:
assertThat(context).doesNotHaveBean(Foo.class);
type
- Bean 型 this
アサーションオブジェクト。AssertionErrorSE
- アプリケーションコンテキストが開始されなかった場合 AssertionErrorSE
- アプリケーションコンテキストに指定された型の Bean が含まれている場合 public ApplicationContextAssert<C> doesNotHaveBean(ClassSE<?> type, ApplicationContextAssert.Scope scope)
例:
assertThat(context).doesNotHaveBean(Foo.class, Scope.NO_ANCESTORS);
type
- Bean 型 scope
- アサーションの範囲 this
アサーションオブジェクト。AssertionErrorSE
- アプリケーションコンテキストが開始されなかった場合 AssertionErrorSE
- アプリケーションコンテキストに指定された型の Bean が含まれている場合 public ApplicationContextAssert<C> doesNotHaveBean(StringSE name)
例:
assertThat(context).doesNotHaveBean("fooBean");
name
- Bean の名前 this
アサーションオブジェクト。AssertionErrorSE
- アプリケーションコンテキストが開始されなかった場合 AssertionErrorSE
- アプリケーションコンテキストに指定された名前の Bean が含まれている場合 public <T> org.assertj.core.api.AbstractObjectArrayAssert<?,StringSE> getBeanNames(ClassSE<T> type)
例:
assertThat(context).getBeanNames(Foo.class).containsOnly("fooBean");
T
- Bean 型 type
- Bean 型 AssertionErrorSE
- アプリケーションコンテキストが開始されなかった場合 public <T> org.assertj.core.api.AbstractObjectAssert<?,T> getBean(ClassSE<T> type)
null
のアサートが返されます。例:
assertThat(context).getBean(Foo.class).isInstanceOf(DefaultFoo.class); assertThat(context).getBean(Bar.class).isNull();
T
- Bean 型 type
- Bean 型 null
のアサート AssertionErrorSE
- アプリケーションコンテキストが開始されなかった場合 AssertionErrorSE
- アプリケーションコンテキストに特定の型の複数の Bean が含まれている public <T> org.assertj.core.api.AbstractObjectAssert<?,T> getBean(ClassSE<T> type, ApplicationContextAssert.Scope scope)
null
のアサートが返されます。例:
assertThat(context).getBean(Foo.class, Scope.NO_ANCESTORS).isInstanceOf(DefaultFoo.class); assertThat(context).getBean(Bar.class, Scope.NO_ANCESTORS).isNull();
T
- Bean 型 type
- Bean 型 scope
- アサーションの範囲 null
のアサート AssertionErrorSE
- アプリケーションコンテキストが開始されなかった場合 AssertionErrorSE
- アプリケーションコンテキストに特定の型の複数の Bean が含まれている public org.assertj.core.api.AbstractObjectAssert<?,ObjectSE> getBean(StringSE name)
null
のアサートが返されます。例:
assertThat(context).getBean("foo").isInstanceOf(Foo.class); assertThat(context).getBean("foo").isNull();
name
- Bean の名前 null
のアサート AssertionErrorSE
- アプリケーションコンテキストが開始されなかった場合 public <T> org.assertj.core.api.AbstractObjectAssert<?,T> getBean(StringSE name, ClassSE<T> type)
null
のアサートが返されます。例:
assertThat(context).getBean("foo", Foo.class).isInstanceOf(DefaultFoo.class); assertThat(context).getBean("foo", Foo.class).isNull();
T
- Bean 型 name
- Bean の名前 type
- Bean 型 null
のアサート AssertionErrorSE
- アプリケーションコンテキストが開始されなかった場合 AssertionErrorSE
- アプリケーションコンテキストに、指定した名前で型が異なる Bean が含まれている場合 public <T> org.assertj.core.api.MapAssert<StringSE,T> getBeans(ClassSE<T> type)
map
のアサートが返されます。例:
assertThat(context).getBeans(Foo.class).containsKey("foo");
T
- Bean 型 type
- Bean 型 map
のアサート AssertionErrorSE
- アプリケーションコンテキストが開始されなかった場合 public <T> org.assertj.core.api.MapAssert<StringSE,T> getBeans(ClassSE<T> type, ApplicationContextAssert.Scope scope)
map
のアサートが返されます。例:
assertThat(context).getBeans(Foo.class, Scope.NO_ANCESTORS).containsKey("foo");
T
- Bean 型 type
- Bean 型 scope
- アサーションの範囲 map
のアサート AssertionErrorSE
- アプリケーションコンテキストが開始されなかった場合 public org.assertj.core.api.AbstractThrowableAssert<?,? extends ThrowableSE> getFailure()
例:
assertThat(context).getFailure().containsMessage("missing bean");
AssertionErrorSE
- アプリケーションコンテキストが失敗せずに開始した場合 public ApplicationContextAssert<C> hasFailed()
例:
assertThat(context).hasFailed();
this
アサーションオブジェクト。AssertionErrorSE
- アプリケーションコンテキストが失敗せずに開始した場合 public ApplicationContextAssert<C> hasNotFailed()
例:
assertThat(context).hasNotFailed();
this
アサーションオブジェクト。AssertionErrorSE
- アプリケーションコンテキストの開始に失敗した場合 protected final C getApplicationContext()
protected final ThrowableSE getStartupFailure()
Copyright © 2019 Pivotal Software, Inc.. All rights reserved.