當前位置: 首頁>>代碼示例>>Java>>正文


Java DispatcherFilter.doFilter方法代碼示例

本文整理匯總了Java中org.springframework.boot.devtools.remote.server.DispatcherFilter.doFilter方法的典型用法代碼示例。如果您正苦於以下問題:Java DispatcherFilter.doFilter方法的具體用法?Java DispatcherFilter.doFilter怎麽用?Java DispatcherFilter.doFilter使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.springframework.boot.devtools.remote.server.DispatcherFilter的用法示例。


在下文中一共展示了DispatcherFilter.doFilter方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: ignoresUnmappedUrl

import org.springframework.boot.devtools.remote.server.DispatcherFilter; //導入方法依賴的package包/類
@Test
public void ignoresUnmappedUrl() throws Exception {
	loadContext("spring.devtools.remote.secret:supersecret");
	DispatcherFilter filter = this.context.getBean(DispatcherFilter.class);
	this.request.setRequestURI("/restart");
	this.request.addHeader(DEFAULT_SECRET_HEADER_NAME, "supersecret");
	filter.doFilter(this.request, this.response, this.chain);
	assertRestartInvoked(false);
}
 
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:10,代碼來源:RemoteDevToolsAutoConfigurationTests.java

示例2: ignoresIfMissingSecretFromRequest

import org.springframework.boot.devtools.remote.server.DispatcherFilter; //導入方法依賴的package包/類
@Test
public void ignoresIfMissingSecretFromRequest() throws Exception {
	loadContext("spring.devtools.remote.secret:supersecret");
	DispatcherFilter filter = this.context.getBean(DispatcherFilter.class);
	this.request.setRequestURI(DEFAULT_CONTEXT_PATH + "/restart");
	filter.doFilter(this.request, this.response, this.chain);
	assertRestartInvoked(false);
}
 
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:9,代碼來源:RemoteDevToolsAutoConfigurationTests.java

示例3: ignoresInvalidSecretInRequest

import org.springframework.boot.devtools.remote.server.DispatcherFilter; //導入方法依賴的package包/類
@Test
public void ignoresInvalidSecretInRequest() throws Exception {
	loadContext("spring.devtools.remote.secret:supersecret");
	DispatcherFilter filter = this.context.getBean(DispatcherFilter.class);
	this.request.setRequestURI(DEFAULT_CONTEXT_PATH + "/restart");
	this.request.addHeader(DEFAULT_SECRET_HEADER_NAME, "invalid");
	filter.doFilter(this.request, this.response, this.chain);
	assertRestartInvoked(false);
}
 
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:10,代碼來源:RemoteDevToolsAutoConfigurationTests.java

示例4: invokeRestartWithDefaultSetup

import org.springframework.boot.devtools.remote.server.DispatcherFilter; //導入方法依賴的package包/類
@Test
public void invokeRestartWithDefaultSetup() throws Exception {
	loadContext("spring.devtools.remote.secret:supersecret");
	DispatcherFilter filter = this.context.getBean(DispatcherFilter.class);
	this.request.setRequestURI(DEFAULT_CONTEXT_PATH + "/restart");
	this.request.addHeader(DEFAULT_SECRET_HEADER_NAME, "supersecret");
	filter.doFilter(this.request, this.response, this.chain);
	assertRestartInvoked(true);
}
 
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:10,代碼來源:RemoteDevToolsAutoConfigurationTests.java

示例5: invokeRestartWithCustomServerContextPath

import org.springframework.boot.devtools.remote.server.DispatcherFilter; //導入方法依賴的package包/類
@Test
public void invokeRestartWithCustomServerContextPath() throws Exception {
	loadContext("spring.devtools.remote.secret:supersecret",
			"server.context-path:/test");
	DispatcherFilter filter = this.context.getBean(DispatcherFilter.class);
	this.request.setRequestURI("/test" + DEFAULT_CONTEXT_PATH + "/restart");
	this.request.addHeader(DEFAULT_SECRET_HEADER_NAME, "supersecret");
	filter.doFilter(this.request, this.response, this.chain);
	assertRestartInvoked(true);
}
 
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:11,代碼來源:RemoteDevToolsAutoConfigurationTests.java

示例6: invokeTunnelWithDefaultSetup

import org.springframework.boot.devtools.remote.server.DispatcherFilter; //導入方法依賴的package包/類
@Test
public void invokeTunnelWithDefaultSetup() throws Exception {
	loadContext("spring.devtools.remote.secret:supersecret");
	DispatcherFilter filter = this.context.getBean(DispatcherFilter.class);
	this.request.setRequestURI(DEFAULT_CONTEXT_PATH + "/debug");
	this.request.addHeader(DEFAULT_SECRET_HEADER_NAME, "supersecret");
	filter.doFilter(this.request, this.response, this.chain);
	assertTunnelInvoked(true);
}
 
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:10,代碼來源:RemoteDevToolsAutoConfigurationTests.java

示例7: invokeTunnelWithCustomServerContextPath

import org.springframework.boot.devtools.remote.server.DispatcherFilter; //導入方法依賴的package包/類
@Test
public void invokeTunnelWithCustomServerContextPath() throws Exception {
	loadContext("spring.devtools.remote.secret:supersecret",
			"server.context-path:/test");
	DispatcherFilter filter = this.context.getBean(DispatcherFilter.class);
	this.request.setRequestURI("/test" + DEFAULT_CONTEXT_PATH + "/debug");
	this.request.addHeader(DEFAULT_SECRET_HEADER_NAME, "supersecret");
	filter.doFilter(this.request, this.response, this.chain);
	assertTunnelInvoked(true);
}
 
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:11,代碼來源:RemoteDevToolsAutoConfigurationTests.java

示例8: invokeTunnelWithCustomHeaderName

import org.springframework.boot.devtools.remote.server.DispatcherFilter; //導入方法依賴的package包/類
@Test
public void invokeTunnelWithCustomHeaderName() throws Exception {
	loadContext("spring.devtools.remote.secret:supersecret",
			"spring.devtools.remote.secretHeaderName:customheader");
	DispatcherFilter filter = this.context.getBean(DispatcherFilter.class);
	this.request.setRequestURI(DEFAULT_CONTEXT_PATH + "/debug");
	this.request.addHeader("customheader", "supersecret");
	filter.doFilter(this.request, this.response, this.chain);
	assertTunnelInvoked(true);
}
 
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:11,代碼來源:RemoteDevToolsAutoConfigurationTests.java

示例9: devToolsHealthReturns200

import org.springframework.boot.devtools.remote.server.DispatcherFilter; //導入方法依賴的package包/類
@Test
public void devToolsHealthReturns200() throws Exception {
	loadContext("spring.devtools.remote.secret:supersecret");
	DispatcherFilter filter = this.context.getBean(DispatcherFilter.class);
	this.request.setRequestURI(DEFAULT_CONTEXT_PATH);
	this.request.addHeader(DEFAULT_SECRET_HEADER_NAME, "supersecret");
	this.response.setStatus(500);
	filter.doFilter(this.request, this.response, this.chain);
	assertThat(this.response.getStatus()).isEqualTo(200);
}
 
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:11,代碼來源:RemoteDevToolsAutoConfigurationTests.java

示例10: devToolsHealthWithCustomServerContextPathReturns200

import org.springframework.boot.devtools.remote.server.DispatcherFilter; //導入方法依賴的package包/類
@Test
public void devToolsHealthWithCustomServerContextPathReturns200() throws Exception {
	loadContext("spring.devtools.remote.secret:supersecret",
			"server.context-path:/test");
	DispatcherFilter filter = this.context.getBean(DispatcherFilter.class);
	this.request.setRequestURI("/test" + DEFAULT_CONTEXT_PATH);
	this.request.addHeader(DEFAULT_SECRET_HEADER_NAME, "supersecret");
	this.response.setStatus(500);
	filter.doFilter(this.request, this.response, this.chain);
	assertThat(this.response.getStatus()).isEqualTo(200);
}
 
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:12,代碼來源:RemoteDevToolsAutoConfigurationTests.java

示例11: devToolsHealthReturns200

import org.springframework.boot.devtools.remote.server.DispatcherFilter; //導入方法依賴的package包/類
@Test
public void devToolsHealthReturns200() throws Exception {
	loadContext("spring.devtools.remote.secret:supersecret");
	DispatcherFilter filter = this.context.getBean(DispatcherFilter.class);
	this.request.setRequestURI(DEFAULT_CONTEXT_PATH);
	this.request.addHeader(DEFAULT_SECRET_HEADER_NAME, "supersecret");
	this.response.setStatus(500);
	filter.doFilter(this.request, this.response, this.chain);
	assertThat(this.response.getStatus(), equalTo(200));
}
 
開發者ID:Nephilim84,項目名稱:contestparser,代碼行數:11,代碼來源:RemoteDevToolsAutoConfigurationTests.java


注:本文中的org.springframework.boot.devtools.remote.server.DispatcherFilter.doFilter方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。