BAEL-89 Adding test dependencies
This commit is contained in:
parent
c0e721b92e
commit
a88c500d8d
|
@ -37,6 +37,11 @@
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-web</artifactId>
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
|
|
|
@ -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";
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -14,7 +14,6 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
|
||||||
@Autowired
|
@Autowired
|
||||||
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
|
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
|
||||||
auth.inMemoryAuthentication()
|
auth.inMemoryAuthentication()
|
||||||
.withUser("user").password("password").roles("USER").and()
|
|
||||||
.withUser("admin").password("password").roles("ADMIN");
|
.withUser("admin").password("password").roles("ADMIN");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,8 +22,6 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
|
||||||
http
|
http
|
||||||
.httpBasic().and()
|
.httpBasic().and()
|
||||||
.authorizeRequests()
|
.authorizeRequests()
|
||||||
.antMatchers("/").permitAll()
|
|
||||||
.antMatchers("/tomcat").hasRole("USER")
|
|
||||||
.antMatchers("/tomcat/admin").hasRole("ADMIN")
|
.antMatchers("/tomcat/admin").hasRole("ADMIN")
|
||||||
.anyRequest().authenticated();
|
.anyRequest().authenticated();
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,17 +5,6 @@ import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
public class TestController {
|
public class TestController {
|
||||||
|
|
||||||
@RequestMapping
|
|
||||||
public String helloDefault() {
|
|
||||||
return "hello default";
|
|
||||||
}
|
|
||||||
|
|
||||||
@RequestMapping("/tomcat")
|
|
||||||
public String helloTomcat() {
|
|
||||||
return "hello tomcat";
|
|
||||||
}
|
|
||||||
|
|
||||||
@RequestMapping("/tomcat/admin")
|
@RequestMapping("/tomcat/admin")
|
||||||
public String helloTomcatAdmin() {
|
public String helloTomcatAdmin() {
|
||||||
return "hello tomcat admin";
|
return "hello tomcat admin";
|
||||||
|
|
Loading…
Reference in New Issue