本文整理汇总了Java中org.springframework.webflow.core.collection.LocalAttributeMap类的典型用法代码示例。如果您正苦于以下问题:Java LocalAttributeMap类的具体用法?Java LocalAttributeMap怎么用?Java LocalAttributeMap使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
LocalAttributeMap类属于org.springframework.webflow.core.collection包,在下文中一共展示了LocalAttributeMap类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onSetUp
import org.springframework.webflow.core.collection.LocalAttributeMap; //导入依赖的package包/类
@Before
public void onSetUp() throws Exception {
this.logoutManager = new LogoutManagerImpl(this.servicesManager,
new SimpleHttpClientFactoryBean().getObject(), new SamlCompliantLogoutMessageCreator());
this.frontChannelLogoutAction = new FrontChannelLogoutAction(this.logoutManager);
this.request = new MockHttpServletRequest();
this.response = new MockHttpServletResponse();
this.requestContext = mock(RequestContext.class);
final ServletExternalContext servletExternalContext = mock(ServletExternalContext.class);
when(this.requestContext.getExternalContext()).thenReturn(servletExternalContext);
when(servletExternalContext.getNativeRequest()).thenReturn(request);
when(servletExternalContext.getNativeResponse()).thenReturn(response);
final LocalAttributeMap flowScope = new LocalAttributeMap();
when(this.requestContext.getFlowScope()).thenReturn(flowScope);
final MockFlowExecutionKey mockFlowExecutionKey = new MockFlowExecutionKey(FLOW_EXECUTION_KEY);
final MockFlowExecutionContext mockFlowExecutionContext = new MockFlowExecutionContext();
mockFlowExecutionContext.setKey(mockFlowExecutionKey);
when(this.requestContext.getFlowExecutionContext()).thenReturn(mockFlowExecutionContext);
}
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:22,代码来源:FrontChannelLogoutActionTests.java
示例2: onSetUp
import org.springframework.webflow.core.collection.LocalAttributeMap; //导入依赖的package包/类
@Before
public void onSetUp() throws Exception {
this.request = new MockHttpServletRequest();
this.response = new MockHttpServletResponse();
this.requestContext = mock(RequestContext.class);
final ServletExternalContext servletExternalContext = mock(ServletExternalContext.class);
when(this.requestContext.getExternalContext()).thenReturn(servletExternalContext);
when(servletExternalContext.getNativeRequest()).thenReturn(request);
when(servletExternalContext.getNativeResponse()).thenReturn(response);
final LocalAttributeMap flowScope = new LocalAttributeMap();
when(this.requestContext.getFlowScope()).thenReturn(flowScope);
this.warnCookieGenerator = new CookieRetrievingCookieGenerator();
this.serviceRegistryDao = new InMemoryServiceRegistryDaoImpl();
this.serviceManager = new DefaultServicesManagerImpl(serviceRegistryDao);
this.serviceManager.setApplicationEventPublisher(mock(ApplicationEventPublisher.class));
this.serviceManager.reload();
this.warnCookieGenerator.setCookieName("test");
this.ticketGrantingTicketCookieGenerator = new CookieRetrievingCookieGenerator();
this.ticketGrantingTicketCookieGenerator.setCookieName(COOKIE_TGC_ID);
this.logoutAction = new LogoutAction();
this.logoutAction.setServicesManager(this.serviceManager);
}
示例3: verifyGetServiceThemeDoesNotExist
import org.springframework.webflow.core.collection.LocalAttributeMap; //导入依赖的package包/类
@Test
public void verifyGetServiceThemeDoesNotExist() {
final RegisteredServiceImpl r = new RegisteredServiceImpl();
r.setTheme("myTheme");
r.setId(1000);
r.setName("Test Service");
r.setServiceId("myServiceId");
this.servicesManager.save(r);
final MockHttpServletRequest request = new MockHttpServletRequest();
final RequestContext ctx = mock(RequestContext.class);
final MutableAttributeMap scope = new LocalAttributeMap();
scope.put("service", org.jasig.cas.services.TestUtils.getService(r.getServiceId()));
when(ctx.getFlowScope()).thenReturn(scope);
RequestContextHolder.setRequestContext(ctx);
request.addHeader("User-Agent", "Mozilla");
assertEquals("test", this.serviceThemeResolver.resolveThemeName(request));
}
示例4: onSetUp
import org.springframework.webflow.core.collection.LocalAttributeMap; //导入依赖的package包/类
@Before
public void onSetUp() throws Exception {
this.request = new MockHttpServletRequest();
this.response = new MockHttpServletResponse();
this.requestContext = mock(RequestContext.class);
final ServletExternalContext servletExternalContext = mock(ServletExternalContext.class);
when(this.requestContext.getExternalContext()).thenReturn(servletExternalContext);
when(servletExternalContext.getNativeRequest()).thenReturn(request);
when(servletExternalContext.getNativeResponse()).thenReturn(response);
final LocalAttributeMap flowScope = new LocalAttributeMap();
when(this.requestContext.getFlowScope()).thenReturn(flowScope);
this.warnCookieGenerator = new CookieRetrievingCookieGenerator();
this.serviceRegistryDao = new InMemoryServiceRegistryDaoImpl();
this.serviceManager = new DefaultServicesManagerImpl(serviceRegistryDao);
this.serviceManager.reload();
this.warnCookieGenerator.setCookieName("test");
this.ticketGrantingTicketCookieGenerator = new CookieRetrievingCookieGenerator();
this.ticketGrantingTicketCookieGenerator.setCookieName(COOKIE_TGC_ID);
this.logoutAction = new LogoutAction();
this.logoutAction.setServicesManager(this.serviceManager);
}
示例5: verifyGetServiceThemeDoesNotExist
import org.springframework.webflow.core.collection.LocalAttributeMap; //导入依赖的package包/类
@Test
public void verifyGetServiceThemeDoesNotExist() {
final RegisteredServiceImpl r = new RegisteredServiceImpl();
r.setTheme("myTheme");
r.setId(1000);
r.setName("Test Service");
r.setServiceId("myServiceId");
this.servicesManager.save(r);
final MockHttpServletRequest request = new MockHttpServletRequest();
final RequestContext ctx = mock(RequestContext.class);
final MutableAttributeMap scope = new LocalAttributeMap();
scope.put("service", TestUtils.getService(r.getServiceId()));
when(ctx.getFlowScope()).thenReturn(scope);
RequestContextHolder.setRequestContext(ctx);
request.addHeader("User-Agent", "Mozilla");
assertEquals("test", this.serviceThemeResolver.resolveThemeName(request));
}
示例6: verifyGetServiceThemeDoesNotExist
import org.springframework.webflow.core.collection.LocalAttributeMap; //导入依赖的package包/类
@Test
public void verifyGetServiceThemeDoesNotExist() {
final RegexRegisteredService r = new RegexRegisteredService();
r.setTheme("myTheme");
r.setId(1000);
r.setName("Test Service");
r.setServiceId("myServiceId");
this.servicesManager.save(r);
final MockHttpServletRequest request = new MockHttpServletRequest();
final RequestContext ctx = mock(RequestContext.class);
final MutableAttributeMap scope = new LocalAttributeMap();
scope.put("service", RegisteredServiceTestUtils.getService(r.getServiceId()));
when(ctx.getFlowScope()).thenReturn(scope);
RequestContextHolder.setRequestContext(ctx);
request.addHeader(WebUtils.USER_AGENT_HEADER, MOZILLA);
assertEquals(DEFAULT_THEME_NAME, this.serviceThemeResolver.resolveThemeName(request));
}
示例7: onSetUp
import org.springframework.webflow.core.collection.LocalAttributeMap; //导入依赖的package包/类
@Before
public void onSetUp() throws Exception {
final DefaultSingleLogoutServiceMessageHandler handler = new DefaultSingleLogoutServiceMessageHandler(new SimpleHttpClientFactoryBean().getObject(),
new SamlCompliantLogoutMessageCreator(), servicesManager, new DefaultSingleLogoutServiceLogoutUrlBuilder(), false,
new DefaultAuthenticationServiceSelectionPlan(new DefaultAuthenticationServiceSelectionStrategy()));
final DefaultLogoutManager logoutManager = new DefaultLogoutManager(new SamlCompliantLogoutMessageCreator(),
handler, false, mock(LogoutExecutionPlan.class));
this.frontChannelLogoutAction = new FrontChannelLogoutAction(logoutManager);
final MockHttpServletRequest request = new MockHttpServletRequest();
final MockHttpServletResponse response = new MockHttpServletResponse();
this.requestContext = mock(RequestContext.class);
final ServletExternalContext servletExternalContext = mock(ServletExternalContext.class);
when(this.requestContext.getExternalContext()).thenReturn(servletExternalContext);
when(servletExternalContext.getNativeRequest()).thenReturn(request);
when(servletExternalContext.getNativeResponse()).thenReturn(response);
final LocalAttributeMap flowScope = new LocalAttributeMap();
when(this.requestContext.getFlowScope()).thenReturn(flowScope);
final MockFlowExecutionKey mockFlowExecutionKey = new MockFlowExecutionKey(FLOW_EXECUTION_KEY);
final MockFlowExecutionContext mockFlowExecutionContext = new MockFlowExecutionContext();
mockFlowExecutionContext.setKey(mockFlowExecutionKey);
when(this.requestContext.getFlowExecutionContext()).thenReturn(mockFlowExecutionContext);
}
示例8: doExecute
import org.springframework.webflow.core.collection.LocalAttributeMap; //导入依赖的package包/类
@Override
protected Event doExecute(final RequestContext requestContext) throws Exception {
final String agent = WebUtils.getHttpServletRequestUserAgent();
final GeoLocationRequest geoLocation = WebUtils.getHttpServletRequestGeoLocation();
if (!adaptiveAuthenticationPolicy.apply(agent, geoLocation)) {
final String msg = "Adaptive authentication policy does not allow this request for " + agent + " and " + geoLocation;
final Map<String, Class<? extends Exception>> map = Collections.singletonMap(
UnauthorizedAuthenticationException.class.getSimpleName(),
UnauthorizedAuthenticationException.class);
final AuthenticationException error = new AuthenticationException(msg, map, Collections.emptyMap());
return new Event(this, CasWebflowConstants.TRANSITION_ID_AUTHENTICATION_FAILURE,
new LocalAttributeMap(CasWebflowConstants.TRANSITION_ID_ERROR, error));
}
final Event serviceTicketEvent = this.serviceTicketRequestWebflowEventResolver.resolveSingle(requestContext);
if (serviceTicketEvent != null) {
fireEventHooks(serviceTicketEvent, requestContext);
return serviceTicketEvent;
}
final Event finalEvent = this.initialAuthenticationAttemptWebflowEventResolver.resolveSingle(requestContext);
fireEventHooks(finalEvent, requestContext);
return finalEvent;
}
示例9: validateEventIdForMatchingTransitionInContext
import org.springframework.webflow.core.collection.LocalAttributeMap; //导入依赖的package包/类
/**
* Validate event for transition.
*
* @param eventId the event id
* @param context the context
* @param attributes the attributes
* @return the event
*/
protected Event validateEventIdForMatchingTransitionInContext(final String eventId, final RequestContext context, final Map<String, Object> attributes) {
try {
final AttributeMap<Object> attributesMap = new LocalAttributeMap<>(attributes);
final Event event = new Event(this, eventId, attributesMap);
LOGGER.debug("Resulting event id is [{}]. Locating transitions in the context for that event id...", event.getId());
final TransitionDefinition def = context.getMatchingTransition(event.getId());
if (def == null) {
LOGGER.warn("Transition definition cannot be found for event [{}]", event.getId());
throw new AuthenticationException();
}
LOGGER.debug("Found matching transition [{}] with target [{}] for event [{}] with attributes [{}].",
def.getId(), def.getTargetStateId(), event.getId(), event.getAttributes());
return event;
} catch (final Exception e) {
throw Throwables.propagate(e);
}
}
示例10: onSetUp
import org.springframework.webflow.core.collection.LocalAttributeMap; //导入依赖的package包/类
@Before
public void onSetUp() throws Exception {
final LogoutManager logoutManager = new LogoutManagerImpl(mock(ServicesManager.class),
new SimpleHttpClient(), new SamlCompliantLogoutMessageCreator());
this.frontChannelLogoutAction = new FrontChannelLogoutAction(logoutManager);
this.request = new MockHttpServletRequest();
this.response = new MockHttpServletResponse();
this.requestContext = mock(RequestContext.class);
final ServletExternalContext servletExternalContext = mock(ServletExternalContext.class);
when(this.requestContext.getExternalContext()).thenReturn(servletExternalContext);
when(servletExternalContext.getNativeRequest()).thenReturn(request);
when(servletExternalContext.getNativeResponse()).thenReturn(response);
final LocalAttributeMap flowScope = new LocalAttributeMap();
when(this.requestContext.getFlowScope()).thenReturn(flowScope);
final MockFlowExecutionKey mockFlowExecutionKey = new MockFlowExecutionKey(FLOW_EXECUTION_KEY);
final MockFlowExecutionContext mockFlowExecutionContext = new MockFlowExecutionContext();
mockFlowExecutionContext.setKey(mockFlowExecutionKey);
when(this.requestContext.getFlowExecutionContext()).thenReturn(mockFlowExecutionContext);
}
示例11: testStartBookingFlow
import org.springframework.webflow.core.collection.LocalAttributeMap; //导入依赖的package包/类
public void testStartBookingFlow() {
Booking booking = createTestBooking();
EasyMock.expect(bookingService.createBooking(1L, "keith")).andReturn(booking);
EasyMock.replay(bookingService);
MutableAttributeMap input = new LocalAttributeMap();
input.put("hotelId", "1");
MockExternalContext context = new MockExternalContext();
context.setCurrentUser("keith");
startFlow(input, context);
assertCurrentStateEquals("enterBookingDetails");
assertResponseWrittenEquals("enterBookingDetails", context);
assertTrue(getRequiredFlowAttribute("booking") instanceof Booking);
EasyMock.verify(bookingService);
}
示例12: verifyFlowExecutorByServerSession
import org.springframework.webflow.core.collection.LocalAttributeMap; //导入依赖的package包/类
@Test
public void verifyFlowExecutorByServerSession() {
final RequestContext ctx = getMockRequestContext();
final LocalAttributeMap map = new LocalAttributeMap<>();
flowExecutorViaServerSessionBindingExecution.launchExecution("login", map, ctx.getExternalContext());
}
示例13: before
import org.springframework.webflow.core.collection.LocalAttributeMap; //导入依赖的package包/类
@Before
public void before() {
final RequestContext ctx = mock(RequestContext.class);
when(ctx.getConversationScope()).thenReturn(new LocalAttributeMap<>());
WebUtils.putAuthentication(CoreAuthenticationTestUtils.getAuthentication(), ctx);
RequestContextHolder.setRequestContext(ctx);
}
示例14: onSetUp
import org.springframework.webflow.core.collection.LocalAttributeMap; //导入依赖的package包/类
@Before
public void onSetUp() throws Exception {
this.request = new MockHttpServletRequest();
this.requestContext = mock(RequestContext.class);
final ServletExternalContext servletExternalContext = mock(ServletExternalContext.class);
when(this.requestContext.getExternalContext()).thenReturn(servletExternalContext);
when(servletExternalContext.getNativeRequest()).thenReturn(request);
when(servletExternalContext.getNativeResponse()).thenReturn(new MockHttpServletResponse());
when(this.requestContext.getFlowScope()).thenReturn(new LocalAttributeMap());
this.serviceManager = new DefaultServicesManager(new InMemoryServiceRegistry());
this.serviceManager.load();
}
示例15: testStartFlow
import org.springframework.webflow.core.collection.LocalAttributeMap; //导入依赖的package包/类
@Test
public void testStartFlow() {
ReconciliationCriteria criteria = constructReconciliationCriteria(RUDYARD, KIPLING, null, EMAIL_ADDRESS, PHONE_NUMBER, new Date(0), OR_WEBAPP_IDENTIFIER);
MutableAttributeMap input = new LocalAttributeMap();
input.put("personSearch", criteria);
ExternalContext context = new MockExternalContext();
startFlow(context);
assertCurrentStateEquals("addPerson");
}