[tlinh2110@gmail.com] Remove unused test cases
This commit is contained in:
-26
@@ -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";
|
||||
}
|
||||
|
||||
}
|
||||
-11
@@ -1,11 +0,0 @@
|
||||
package org.baeldung.testmethodsecurity.service;
|
||||
|
||||
public interface SystemPropInterface {
|
||||
|
||||
String getSystemName();
|
||||
|
||||
String sayHello();
|
||||
|
||||
String sayHi();
|
||||
|
||||
}
|
||||
+1
-1
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user