[tlinh2110@gmail.com] Remove unused test cases

This commit is contained in:
linhvovn
2017-12-18 22:55:23 +08:00
parent 778177333f
commit fb5dd0a85e
9 changed files with 11 additions and 183 deletions
@@ -1,26 +0,0 @@
package org.baeldung.testmethodsecurity.service;
import org.springframework.security.access.annotation.Secured;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Service;
@Service
public class SystemPropImpl implements SystemPropInterface{
@PreAuthorize("permitAll")
@Override
public String getSystemName() {
return "Method Security";
}
@Override
public String sayHello(){
return sayHi();
}
@Secured("ROLE_USER")
public String sayHi(){
return "Hi";
}
}
@@ -1,11 +0,0 @@
package org.baeldung.testmethodsecurity.service;
public interface SystemPropInterface {
String getSystemName();
String sayHello();
String sayHi();
}
@@ -16,7 +16,7 @@ public class UserRoleService {
UserRoleRepository userRoleRepository;
@PreAuthorize("hasRole('ROLE_VIEWER') or hasAuthority('SYS_ADMIN')")
public String getUserName(){
public String getUsername(){
SecurityContext securityContext = SecurityContextHolder.getContext();
return securityContext.getAuthentication().getName();
}