BAEL-89 Adding test dependencies

This commit is contained in:
tschiman 2016-11-17 20:32:44 -07:00
parent c0e721b92e
commit a88c500d8d
4 changed files with 5 additions and 29 deletions

View File

@ -37,6 +37,11 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>

View File

@ -1,15 +0,0 @@
package com.baeldung.spring.session.tomcatex;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* Created by tschi on 11/12/2016.
*/
@RestController
public class TestController {
@RequestMapping
public String helloJetty() {
return "hello Jetty";
}
}

View File

@ -14,7 +14,6 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
auth.inMemoryAuthentication()
.withUser("user").password("password").roles("USER").and()
.withUser("admin").password("password").roles("ADMIN");
}
@ -23,8 +22,6 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
http
.httpBasic().and()
.authorizeRequests()
.antMatchers("/").permitAll()
.antMatchers("/tomcat").hasRole("USER")
.antMatchers("/tomcat/admin").hasRole("ADMIN")
.anyRequest().authenticated();
}

View File

@ -5,17 +5,6 @@ import org.springframework.web.bind.annotation.RestController;
@RestController
public class TestController {
@RequestMapping
public String helloDefault() {
return "hello default";
}
@RequestMapping("/tomcat")
public String helloTomcat() {
return "hello tomcat";
}
@RequestMapping("/tomcat/admin")
public String helloTomcatAdmin() {
return "hello tomcat admin";