List of usage examples for org.springframework.http HttpMethod TRACE
HttpMethod TRACE
To view the source code for org.springframework.http HttpMethod TRACE.
Click Source Link
From source file:com.logsniffer.event.publisher.http.HttpPublisherTest.java
@Test public void testTrace() throws PublishException { stubFor(trace(urlEqualTo("/eventId/12345678901")).willReturn(aResponse().withStatus(201))); publisher.setMethod(HttpMethod.TRACE); publisher.setUrl("http://localhost:" + port + "/eventId/12345678901"); Event event = new Event(); event.setId("123"); publisher.publish(event);/*from w w w .j av a2s .c om*/ }
From source file:com.frequentis.maritime.mcsr.config.SecurityConfiguration.java
@Override protected void configure(HttpSecurity http) throws Exception { //super.configure(http); log.debug("Configuring HttpSecurity"); log.debug("RememberMe service {}", rememberMeServices); http.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS) .sessionAuthenticationStrategy(sessionAuthenticationStrategy()).and() .addFilterBefore(basicAuthenticationFilter(), LogoutFilter.class) .addFilterBefore(new SkippingFilter(keycloakPreAuthActionsFilter()), LogoutFilter.class) .addFilterBefore(new SkippingFilter(keycloakAuthenticationProcessingFilter()), X509AuthenticationFilter.class) .exceptionHandling().authenticationEntryPoint(authenticationEntryPoint()).and() // .addFilterAfter(new CsrfCookieGeneratorFilter(), CsrfFilter.class) // .exceptionHandling() // .accessDeniedHandler(new CustomAccessDeniedHandler()) // .authenticationEntryPoint(authenticationEntryPoint) // .and() .rememberMe().rememberMeServices(rememberMeServices).rememberMeParameter("remember-me") .key(jHipsterProperties.getSecurity().getRememberMe().getKey()).and().formLogin() .loginProcessingUrl("/api/authentication").successHandler(ajaxAuthenticationSuccessHandler) .failureHandler(ajaxAuthenticationFailureHandler).usernameParameter("j_username") .passwordParameter("j_password").permitAll().and().logout().logoutUrl("/api/logout") .logoutSuccessHandler(ajaxLogoutSuccessHandler).deleteCookies("JSESSIONID", "CSRF-TOKEN") .permitAll().and().headers().frameOptions().disable().and().authorizeRequests() .antMatchers("/api/register").hasAuthority(AuthoritiesConstants.ADMIN) .antMatchers("/api/elasticsearch/**").permitAll().antMatchers("/api/activate").permitAll() .antMatchers("/api/authenticate").permitAll() .antMatchers("/api/account/reset_password/inactivateit").permitAll() .antMatchers("/api/account/reset_password/finish").permitAll().antMatchers("/api/profile-info") .permitAll().antMatchers("/websocket/tracker").hasAuthority(AuthoritiesConstants.ADMIN) .antMatchers("/websocket/**").permitAll().antMatchers("/management/**") .hasAuthority(AuthoritiesConstants.ADMIN).antMatchers("/v2/api-docs/**").permitAll() .antMatchers(HttpMethod.PUT, "/api/**").authenticated().antMatchers(HttpMethod.POST, "/api/**") .authenticated().antMatchers(HttpMethod.DELETE, "/api/**").authenticated() .antMatchers(HttpMethod.TRACE, "/api/**").authenticated().antMatchers(HttpMethod.HEAD, "/api/**") .authenticated().antMatchers(HttpMethod.PATCH, "/api/**").authenticated() .antMatchers(HttpMethod.OPTIONS, "/api/**").permitAll().antMatchers(HttpMethod.GET, "/api/**") .permitAll().antMatchers("/swagger-resources/configuration/ui").permitAll() .antMatchers("/swagger-ui/index.html").permitAll().and().csrf().disable(); }
From source file:org.springframework.web.client.RestTemplateIntegrationTests.java
@Test public void optionsForAllow() throws URISyntaxException { Set<HttpMethod> allowed = template.optionsForAllow(new URI(baseUrl + "/get")); assertEquals("Invalid response", EnumSet.of(HttpMethod.GET, HttpMethod.OPTIONS, HttpMethod.HEAD, HttpMethod.TRACE), allowed); }