本文整理汇总了Java中org.springframework.security.web.PortResolver类的典型用法代码示例。如果您正苦于以下问题:Java PortResolver类的具体用法?Java PortResolver怎么用?Java PortResolver使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PortResolver类属于org.springframework.security.web包,在下文中一共展示了PortResolver类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: test_for_issue
import org.springframework.security.web.PortResolver; //导入依赖的package包/类
public void test_for_issue() throws Exception {
MockHttpServletRequest mockReq = new MockHttpServletRequest();
DefaultSavedRequest request = new DefaultSavedRequest(mockReq, new PortResolver() {
public int getServerPort(ServletRequest servletRequest) {
return 0;
}
});
String str = JSON.toJSONString(request, SerializerFeature.WriteClassName);
// System.out.println(str);
JSON.parseObject(str, Object.class, config);
JSON.parseObject(str);
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:18,代码来源:DefaultSavedRequestTest.java
示例2: testDisplayLoginPageWithOriginalSavedRequestIfSetupComplete
import org.springframework.security.web.PortResolver; //导入依赖的package包/类
@Test
public void testDisplayLoginPageWithOriginalSavedRequestIfSetupComplete() throws Exception {
when(mockEnvironment.getProperty(SETUP_COMPLETE)).thenReturn("true");
when(mockEnvironment.getProperty(HmpProperties.VERSION)).thenReturn("fred");
when(mockSyncService.isOperationalSynching()).thenReturn(Boolean.FALSE);
when(mockSyncService.isReindexAllComplete()).thenReturn(Boolean.TRUE);
when(mockSyncService.isDataStreamEnabled()).thenReturn(Boolean.TRUE);
MockHttpServletRequest mockOriginalRequest = new MockHttpServletRequest();
mockOriginalRequest.setScheme("https");
mockOriginalRequest.setServerName("example.org");
mockOriginalRequest.setServerPort(3333);
mockOriginalRequest.setRequestURI("/foo/bar/baz");
PortResolver mockPortResolver = mock(PortResolver.class);
when(mockPortResolver.getServerPort(mockOriginalRequest)).thenReturn(3333);
// spring security will have put the original request in the session
mockSession.setAttribute("SPRING_SECURITY_SAVED_REQUEST", new DefaultSavedRequest(mockOriginalRequest, mockPortResolver));
ModelAndView mav = c.login(mockRequest, mockResponse);
assertThat(mav.getViewName(), equalTo("/auth/login"));
assertThat(((String) mav.getModel().get("hmpVersion")), equalTo("fred"));
}
开发者ID:KRMAssociatesInc,项目名称:eHMP,代码行数:25,代码来源:AuthControllerTests.java
示例3: testDisplayLoginPageAfterAjaxRequestWhichFailedDueToExpiredSession
import org.springframework.security.web.PortResolver; //导入依赖的package包/类
@Test
public void testDisplayLoginPageAfterAjaxRequestWhichFailedDueToExpiredSession() throws Exception {
when(mockEnvironment.getProperty(SETUP_COMPLETE)).thenReturn("true");
when(mockEnvironment.getProperty(HmpProperties.VERSION)).thenReturn("fred");
when(mockSyncService.isOperationalSynching()).thenReturn(Boolean.FALSE);
when(mockSyncService.isReindexAllComplete()).thenReturn(Boolean.TRUE);
when(mockSyncService.isDataStreamEnabled()).thenReturn(Boolean.TRUE);
MockHttpServletRequest mockOriginalRequest = new MockHttpServletRequest();
mockOriginalRequest.addHeader("X-Requested-With", "XMLHttpRequest");
mockOriginalRequest.setScheme("https");
mockOriginalRequest.setServerName("example.org");
mockOriginalRequest.setServerPort(3333);
mockOriginalRequest.setRequestURI("/foo/bar/baz");
PortResolver mockPortResolver = mock(PortResolver.class);
when(mockPortResolver.getServerPort(mockOriginalRequest)).thenReturn(3333);
// spring security will have put the original request in the session
mockSession.setAttribute("SPRING_SECURITY_SAVED_REQUEST", new DefaultSavedRequest(mockOriginalRequest, mockPortResolver));
ModelAndView mav = c.login(mockRequest, mockResponse);
assertThat(mav.getViewName(), equalTo("/auth/login"));
assertThat(((String) mav.getModel().get("hmpVersion")), equalTo("fred"));
}
开发者ID:KRMAssociatesInc,项目名称:eHMP,代码行数:26,代码来源:AuthControllerTests.java
示例4: testDisplaySyncStatusPageWhenOperationalSyncIncomplete
import org.springframework.security.web.PortResolver; //导入依赖的package包/类
@Test
public void testDisplaySyncStatusPageWhenOperationalSyncIncomplete() throws Exception {
when(mockEnvironment.getProperty(SETUP_COMPLETE)).thenReturn("true");
when(mockEnvironment.getProperty(HmpProperties.VERSION)).thenReturn("fred");
when(mockSyncService.isOperationalSynching()).thenReturn(Boolean.TRUE);
MockHttpServletRequest mockOriginalRequest = new MockHttpServletRequest();
mockOriginalRequest.addHeader("X-Requested-With", "XMLHttpRequest");
mockOriginalRequest.setScheme("https");
mockOriginalRequest.setServerName("example.org");
mockOriginalRequest.setServerPort(3333);
mockOriginalRequest.setRequestURI("/foo/bar/baz");
PortResolver mockPortResolver = mock(PortResolver.class);
when(mockPortResolver.getServerPort(mockOriginalRequest)).thenReturn(3333);
// spring security will have put the original request in the session
mockSession.setAttribute("SPRING_SECURITY_SAVED_REQUEST", new DefaultSavedRequest(mockOriginalRequest, mockPortResolver));
ModelAndView mav = c.login(mockRequest, mockResponse);
assertThat(mav.getViewName(), equalTo("/auth/initializing"));
assertThat(((String) mav.getModel().get("hmpVersion")), equalTo("fred"));
}
开发者ID:KRMAssociatesInc,项目名称:eHMP,代码行数:24,代码来源:AuthControllerTests.java
示例5: testDisplayReindexStatusPageWhenReindexingIncomplete
import org.springframework.security.web.PortResolver; //导入依赖的package包/类
@Test
public void testDisplayReindexStatusPageWhenReindexingIncomplete() throws Exception {
when(mockEnvironment.getProperty(SETUP_COMPLETE)).thenReturn("true");
when(mockEnvironment.getProperty(HmpProperties.VERSION)).thenReturn("fred");
when(mockSyncService.isOperationalSynching()).thenReturn(Boolean.FALSE);
when(mockSyncService.isReindexAllComplete()).thenReturn(Boolean.FALSE);
MockHttpServletRequest mockOriginalRequest = new MockHttpServletRequest();
mockOriginalRequest.addHeader("X-Requested-With", "XMLHttpRequest");
mockOriginalRequest.setScheme("https");
mockOriginalRequest.setServerName("example.org");
mockOriginalRequest.setServerPort(3333);
mockOriginalRequest.setRequestURI("/foo/bar/baz");
PortResolver mockPortResolver = mock(PortResolver.class);
when(mockPortResolver.getServerPort(mockOriginalRequest)).thenReturn(3333);
// spring security will have put the original request in the session
mockSession.setAttribute("SPRING_SECURITY_SAVED_REQUEST", new DefaultSavedRequest(mockOriginalRequest, mockPortResolver));
ModelAndView mav = c.login(mockRequest, mockResponse);
assertThat(mav.getViewName(), equalTo("/auth/reindexing"));
assertThat(((String) mav.getModel().get("hmpVersion")), equalTo("fred"));
}
开发者ID:KRMAssociatesInc,项目名称:eHMP,代码行数:25,代码来源:AuthControllerTests.java
示例6: testDisplayDataStreamErrorPageWhenDataStreamFailure
import org.springframework.security.web.PortResolver; //导入依赖的package包/类
@Test
public void testDisplayDataStreamErrorPageWhenDataStreamFailure() throws Exception {
when(mockEnvironment.getProperty(SETUP_COMPLETE)).thenReturn("true");
when(mockEnvironment.getProperty(HmpProperties.VERSION)).thenReturn("fred");
when(mockSyncService.isReindexAllComplete()).thenReturn(Boolean.TRUE);
when(mockSyncService.isOperationalSynching()).thenReturn(Boolean.FALSE);
when(mockSyncService.isDataStreamEnabled()).thenReturn(Boolean.FALSE);
Map<String, Object> derr = new HashMap<>();
derr.put("disableMsg","There's a bar stuck in the foo");
when(mockSyncService.getDataStreamErrorDetails()).thenReturn(derr);
MockHttpServletRequest mockOriginalRequest = new MockHttpServletRequest();
mockOriginalRequest.addHeader("X-Requested-With", "XMLHttpRequest");
mockOriginalRequest.setScheme("https");
mockOriginalRequest.setServerName("example.org");
mockOriginalRequest.setServerPort(3333);
mockOriginalRequest.setRequestURI("/foo/bar/baz");
PortResolver mockPortResolver = mock(PortResolver.class);
when(mockPortResolver.getServerPort(mockOriginalRequest)).thenReturn(3333);
// spring security will have put the original request in the session
mockSession.setAttribute("SPRING_SECURITY_SAVED_REQUEST", new DefaultSavedRequest(mockOriginalRequest, mockPortResolver));
ModelAndView mav = c.login(mockRequest, mockResponse);
assertThat(mav.getViewName(), equalTo("/auth/dataStreamError"));
assertThat(((String) mav.getModel().get("hmpVersion")), equalTo("fred"));
}
开发者ID:KRMAssociatesInc,项目名称:eHMP,代码行数:29,代码来源:AuthControllerTests.java
示例7: setPortResolver
import org.springframework.security.web.PortResolver; //导入依赖的package包/类
public void setPortResolver(PortResolver portResolver) {
this.portResolver = portResolver;
}
开发者ID:marcelothebuilder,项目名称:webpedidos,代码行数:4,代码来源:JsfLoginUrlAuthenticationEntryPoint.java
示例8: getPortResolver
import org.springframework.security.web.PortResolver; //导入依赖的package包/类
protected PortResolver getPortResolver() {
return portResolver;
}
开发者ID:marcelothebuilder,项目名称:webpedidos,代码行数:4,代码来源:JsfLoginUrlAuthenticationEntryPoint.java
示例9: setPortResolver
import org.springframework.security.web.PortResolver; //导入依赖的package包/类
public void setPortResolver(PortResolver portResolver) {
this.portResolver = portResolver;
}
开发者ID:fabiohxcx,项目名称:PedidoVenda,代码行数:4,代码来源:JsfLoginUrlAuthenticationEntryPoint.java
示例10: getPortResolver
import org.springframework.security.web.PortResolver; //导入依赖的package包/类
protected PortResolver getPortResolver() {
return this.portResolver;
}
开发者ID:fabiohxcx,项目名称:PedidoVenda,代码行数:4,代码来源:JsfLoginUrlAuthenticationEntryPoint.java
示例11: setUp
import org.springframework.security.web.PortResolver; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
mockPortResolver = mock(PortResolver.class);
}
开发者ID:KRMAssociatesInc,项目名称:eHMP,代码行数:5,代码来源:WebUtilsTests.java
示例12: getPortResolver
import org.springframework.security.web.PortResolver; //导入依赖的package包/类
/**
* The port resolver.
*
* @return The port resolver.
*/
public PortResolver getPortResolver() {
return portResolver;
}
开发者ID:jungyang,项目名称:oauth-client-master,代码行数:9,代码来源:OAuthConsumerContextFilter.java
示例13: setPortResolver
import org.springframework.security.web.PortResolver; //导入依赖的package包/类
/**
* The port resolver.
*
* @param portResolver The port resolver.
*/
public void setPortResolver(PortResolver portResolver) {
this.portResolver = portResolver;
}
开发者ID:jungyang,项目名称:oauth-client-master,代码行数:9,代码来源:OAuthConsumerContextFilter.java
注:本文中的org.springframework.security.web.PortResolver类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论