public static enum SpringBootTest.WebEnvironment extends EnumSE<SpringBootTest.WebEnvironment>
列挙型定数と説明 |
---|
DEFINED_PORT server.port=0 Environment プロパティを定義せずに(リアクティブ)Web アプリケーションコンテキストを作成します。 |
MOCK サーブレット API がクラスパス上にある場合はモックサーブレット環境で WebApplicationContext を作成し、Spring WebFlux がクラスパス上にある場合は ReactiveWebApplicationContext を作成し、それ以外の場合は通常の ApplicationContext を作成します。 |
NONE |
RANDOM_PORT Web アプリケーションコンテキスト(リアクティブまたはサーブレットベース)を作成し、 server.port=0 Environment プロパティを設定します(通常、ランダムなポートでリスニングをトリガーします)。 |
修飾子と型 | メソッドと説明 |
---|---|
boolean | isEmbedded() 環境が ServletWebServerApplicationContext を使用している場合に戻ります。 |
static SpringBootTest.WebEnvironment | valueOf(StringSE name) 指定された名前を持つこの型の列挙定数を返します。 |
static SpringBootTest.WebEnvironment[] | values() この列挙型の定数を含む配列を、宣言されている順序で返します。 |
cloneSE, compareToSE, equalsSE, finalizeSE, getDeclaringClassSE, hashCodeSE, nameSE, ordinalSE, toStringSE, valueOfSE
getClassSE, notifySE, notifyAllSE, waitSE, waitSE, waitSE
public static final SpringBootTest.WebEnvironment MOCK
WebApplicationContext
を作成し、Spring WebFlux がクラスパス上にある場合は ReactiveWebApplicationContext
を作成し、それ以外の場合は通常の ApplicationContext
を作成します。public static final SpringBootTest.WebEnvironment RANDOM_PORT
server.port=0
Environment
プロパティを設定します(通常、ランダムポートでのリッスンをトリガーします)。多くの場合、テストで @LocalServerPort
注入フィールドと組み合わせて使用されます。public static final SpringBootTest.WebEnvironment DEFINED_PORT
server.port=0
Environment
プロパティを定義せずに(リアクティブ)Web アプリケーションコンテキストを作成します。public static final SpringBootTest.WebEnvironment NONE
public static SpringBootTest.WebEnvironment[] values()
for (SpringBootTest.WebEnvironment c : SpringBootTest.WebEnvironment.values()) System.out.println(c);
public static SpringBootTest.WebEnvironment valueOf(StringSE name)
name
- 返される列挙定数の名前。IllegalArgumentExceptionSE
- この列挙型に指定された名前の定数がない場合 NullPointerExceptionSE
- 引数が null の場合 public boolean isEmbedded()
ServletWebServerApplicationContext
を使用している場合に戻ります。ServletWebServerApplicationContext
が使用されている場合。