List of usage examples for org.springframework.security.oauth.provider.filter OAuthProviderProcessingFilter OAUTH_PROCESSING_HANDLED
String OAUTH_PROCESSING_HANDLED
To view the source code for org.springframework.security.oauth.provider.filter OAuthProviderProcessingFilter OAUTH_PROCESSING_HANDLED.
Click Source Link
From source file:ltistarter.controllers.AppControllersTest.java
@Test @Transactional // rollback after public void testLoadLTI() throws Exception { // test minimal LTI launch LtiKeyEntity key = ltiKeyRepository.save(new LtiKeyEntity("AZltiKey", "AZsecret")); MockHttpSession session = makeAuthSession("azeckoski", "ROLE_LTI", "ROLE_OAUTH", "ROLE_USER"); MvcResult result = this.mockMvc .perform(post("/lti").session(session) .requestAttr(OAuthProviderProcessingFilter.OAUTH_PROCESSING_HANDLED, true) // skip OAuth processing in the filter .param(LTIRequest.LTI_VERSION, LTIRequest.LTI_VERSION_1P0) .param(LTIRequest.LTI_MESSAGE_TYPE, LTIRequest.LTI_MESSAGE_TYPE_BASIC) .param(LTIRequest.LTI_CONSUMER_KEY, key.getKeyKey()).param(LTIRequest.LTI_LINK_ID, "Mylink") .param(LTIRequest.LTI_CONTEXT_ID, "courseAZ").param(LTIRequest.LTI_USER_ID, "azeckoski")) .andExpect(status().isOk()).andReturn(); assertNotNull(result);//from www .j a v a2 s. c o m String content = result.getResponse().getContentAsString(); assertNotNull(content); assertTrue(content.contains("Hello Spring Boot")); assertTrue(content.contains("only shown to LTI users")); }