인증/권한 저위험 파일 Spring 전환 스파이크 #7

Open
forge-bot wants to merge 9 commits from forge/BAIS-SPRING-DEV-AUTH-001-attempt-1 into main
9 changed files with 123 additions and 0 deletions

View file

@ -0,0 +1,3 @@
# BAIS-SPRING-DEV-AUTH-001-attempt-1
Forge 이슈 작업 브랜치 `forge/BAIS-SPRING-DEV-AUTH-001-attempt-1`.

View file

@ -0,0 +1,23 @@
package com.example.authentication;
public class Sau02f220uDto {
private String username;
private String password;
// Getters and Setters
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
}

View file

@ -0,0 +1,10 @@
package com.example.authentication;
import org.springframework.stereotype.Repository;
@Repository
public class Sau02f220uRepository {
public void save(Sau02f220uDto dto) {
// Save logic here
}
}

View file

@ -0,0 +1,10 @@
package com.example.authentication;
import org.springframework.stereotype.Service;
@Service
public class Sau02f220uService {
public void authenticate(Sau02f220uDto dto) {
// Authentication logic here
}
}

View file

@ -0,0 +1,23 @@
package com.example.authorization;
public class Maz02f116rDto {
private String role;
private String permissions;
// Getters and Setters
public String getRole() {
return role;
}
public void setRole(String role) {
this.role = role;
}
public String getPermissions() {
return permissions;
}
public void setPermissions(String permissions) {
this.permissions = permissions;
}
}

View file

@ -0,0 +1,10 @@
package com.example.authorization;
import org.springframework.stereotype.Repository;
@Repository
public class Maz02f116rRepository {
public void save(Maz02f116rDto dto) {
// Save logic here
}
}

View file

@ -0,0 +1,10 @@
package com.example.authorization;
import org.springframework.stereotype.Service;
@Service
public class Maz02f116rService {
public void authorize(Maz02f116rDto dto) {
// Authorization logic here
}
}

View file

@ -0,0 +1,17 @@
package com.example.authentication;
import org.junit.jupiter.api.Test;
import static org.mockito.Mockito.*;
class Sau02f220uServiceTest {
@Test
void testAuthenticate() {
Sau02f220uService service = new Sau02f220uService();
Sau02f220uDto dto = new Sau02f220uDto();
dto.setUsername("testUser");
dto.setPassword("testPass");
service.authenticate(dto);
// Add assertions here
}
}

View file

@ -0,0 +1,17 @@
package com.example.authorization;
import org.junit.jupiter.api.Test;
import static org.mockito.Mockito.*;
class Maz02f116rServiceTest {
@Test
void testAuthorize() {
Maz02f116rService service = new Maz02f116rService();
Maz02f116rDto dto = new Maz02f116rDto();
dto.setRole("admin");
dto.setPermissions("read, write");
service.authorize(dto);
// Add assertions here
}
}