BAIS 권한 서비스를 Spring Java로 전환 (BAIS-E2E-MIG-001)
This commit is contained in:
parent
571419dd30
commit
bccaa2f4f1
1 changed files with 17 additions and 0 deletions
|
|
@ -0,0 +1,17 @@
|
||||||
|
package com.example.authorization;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
|
|
||||||
|
class AuthorizationServiceTest {
|
||||||
|
|
||||||
|
private final AuthorizationService authorizationService = new AuthorizationService();
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void testHasAccess() {
|
||||||
|
assertTrue(authorizationService.hasAccess("ADMIN", "RESOURCE"));
|
||||||
|
assertTrue(authorizationService.hasAccess("USER", "RESOURCE"));
|
||||||
|
assertFalse(authorizationService.hasAccess("USER", "OTHER_RESOURCE"));
|
||||||
|
assertFalse(authorizationService.hasAccess("GUEST", "RESOURCE"));
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue