public class MockMvcHtmlUnitDriverBuilder extends MockMvcWebConnectionBuilderSupport<MockMvcHtmlUnitDriverBuilder>
MockMvcHtmlUnitDriverBuilder
は、MockMvc
に委譲し、オプションで特定のリクエストの実際の接続に委譲する HtmlUnitDriver
の構築を簡素化します。 デフォルトでは、ドライバは MockMvc
に委譲して localhost
へのリクエストを処理し、WebClient
に他の URL を処理します(つまり、実際の HTTP リクエストを実行します)。
mockMvcSetup(MockMvc)
, webAppContextSetup(WebApplicationContext)
, webAppContextSetup(WebApplicationContext, MockMvcConfigurer)
, javascriptEnabled(boolean)
, withDelegate(WebConnectionHtmlUnitDriver)
, build()
修飾子 | コンストラクターと説明 |
---|---|
protected | MockMvcHtmlUnitDriverBuilder(MockMvc mockMvc) |
protected | MockMvcHtmlUnitDriverBuilder(WebApplicationContext context) |
protected | MockMvcHtmlUnitDriverBuilder(WebApplicationContext context, MockMvcConfigurer configurer) |
修飾子と型 | メソッドと説明 |
---|---|
org.openqa.selenium.htmlunit.HtmlUnitDriver | build() このビルダーを介して構成された HtmlUnitDriver をビルドします。 |
MockMvcHtmlUnitDriverBuilder | javascriptEnabled(boolean javascriptEnabled) JavaScript を有効にするかどうかを指定します。 |
static MockMvcHtmlUnitDriverBuilder | mockMvcSetup(MockMvc mockMvc) 提供された MockMvc インスタンスに基づいて新しい MockMvcHtmlUnitDriverBuilder を作成します。 |
static MockMvcHtmlUnitDriverBuilder | webAppContextSetup(WebApplicationContext context) 提供された WebApplicationContext に基づいて、新しい MockMvcHtmlUnitDriverBuilder を作成します。 |
static MockMvcHtmlUnitDriverBuilder | webAppContextSetup(WebApplicationContext context, MockMvcConfigurer configurer) |
MockMvcHtmlUnitDriverBuilder | withDelegate(WebConnectionHtmlUnitDriver driver) |
alwaysUseMockMvc, contextPath, createConnection, useMockMvc, useMockMvcForHosts
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSE
protected MockMvcHtmlUnitDriverBuilder(MockMvc mockMvc)
protected MockMvcHtmlUnitDriverBuilder(WebApplicationContext context)
protected MockMvcHtmlUnitDriverBuilder(WebApplicationContext context, MockMvcConfigurer configurer)
public static MockMvcHtmlUnitDriverBuilder mockMvcSetup(MockMvc mockMvc)
MockMvc
インスタンスに基づいて新しい MockMvcHtmlUnitDriverBuilder
を作成します。mockMvc
- 使用する MockMvc
インスタンス (非 null
)public static MockMvcHtmlUnitDriverBuilder webAppContextSetup(WebApplicationContext context)
WebApplicationContext
に基づいて、新しい MockMvcHtmlUnitDriverBuilder
を作成します。context
- WebApplicationContext
から MockMvc
インスタンスを作成する (null
)public static MockMvcHtmlUnitDriverBuilder webAppContextSetup(WebApplicationContext context, MockMvcConfigurer configurer)
context
- WebApplicationContext
から MockMvc
インスタンスを作成する (null
)configurer
- 適用する MockMvcConfigurer
(非 null
)public MockMvcHtmlUnitDriverBuilder javascriptEnabled(boolean javascriptEnabled)
デフォルトは true
です。
javascriptEnabled
- JavaScript を有効にする必要がある場合は true
build()
public MockMvcHtmlUnitDriverBuilder withDelegate(WebConnectionHtmlUnitDriver driver)
driver
- 一致しないリクエストを委譲する WebConnectionHtmlUnitDriver
(非 null
)build()
public org.openqa.selenium.htmlunit.HtmlUnitDriver build()
HtmlUnitDriver
をビルドします。 返されたドライバーは、一致するリクエストの処理には構成された MockMvc
インスタンスを使用し、他のすべてのリクエストにはデリゲート HtmlUnitDriver
を使用します。
デリゲートが明示的に構成されている場合、それが使用されます。それ以外の場合は、BrowserVersion
が CHROME
に設定されたデフォルトの WebConnectionHtmlUnitDriver
がデリゲートとして構成されます。
HtmlUnitDriver
withDelegate(WebConnectionHtmlUnitDriver)